My goal is so simple, the title says it all, but every way I've tried, I've failed. I've read instructions on various sites (besides here) and they all seem to be missing something... this is what I have:
- 16 gb SanDisk USB 3 drive.
- Debian Jessie machine
- Windows machine, Macbook Pro
Though I can easily create a bootable Windows 10 USB with Rufus, my goal is more educational: I want to understand what is going on, and what is the source of my failure, and if possible, to make it work.
When I try to create a Win10 image in the terminal, I tried this command:
sudo dd if=Windows10.iso of=/dev/sdc1 bs=512k
I get a partition that seems to mount on Debian, but is otherwise unrecognized on Windows and Mac.
Gparted shows this:
By comparison, another normally working USB flash drive (I got 4) reads like this:
I'd read in some places that you're not supposed to output to the partition (sdc1
) but to the drive (sdc
), so I tried this:
sudo pv Windows10.iso | sudo dd of=/dev/sdc bs=5M
(which to those familiar is the same command, piped through dd
, and with sdc
instead).
This appears to nuke the entire partition, as you can see from fdisk
:
This was upsetting, but I decided to start off fresh. I rebooted and ran the following commands:
sudo umount /dev/sdc1
sudo wipefs -a /dev/sdc
sudo fdisk -l
sudo fdisk /dev/sdc
n, p, 1, [enter], [enter], t, 7, w
That should format a new partition and change it from the default (Linux) to the NTFS partition I need. Then I run:
lsblk
and make the NTFS filesystem with this command:
sudo mkfs -t ntfs /dev/sdc1
After which, I tried running dd
, but with an additional option:conv=fdatasync
(which some folks say ensures nothing stays in the cache and may solve this problem).
pv Windows10.iso | sudo dd of=/dev/sdc conv=fdatasync bs=512k
(I dropped the byte size in case that's a problem). Regardless of how I do it, I noticed the following:
dd
does write the files and filesystem, and it is readable in Linux (I can open the files) but it is useless andlsblk
andgparted
both say there is nothing there!- Whether I chose
sdc1
orsdc
seems only to affect how badly the drive is wrecked. One damages the partition, while the other makes it seem like the whole drive is unallocated. - The drive is fine: I went into Windows and with the same 'wrecked' USB drive, copied over the same file and verified that it boots up and works fine.
Keep in mind the dd
command works with gpartedlive. I ran the following code:
sudo wipefs -a /dev/sdc
sudo fdisk /dev/sdc
lsblk
sudo mkfs -t vfat /dev/sdc1
pv gparted-live-1.1.0-1amd64.iso|sudo dd of=/dev/sdc bs=4M conv=fdatasync
and got a fully working gparted
live drive.
This is confusing the heck out of me. I know that I'd save myself the trouble if I just stayed with Rufus, but this is not about going simple, but about understanding what is going on. I know a few GUI tools on Linux might solve the problem, but, again, my hope is to do it using the old Unix terminal if possible. if it's not possible, then I'd like to know why.
So to summarize:
- Why isn't it working? what am I doing wrong?
- Why is dd wrecking the partitions yet it seems to work fine with
gparted
? - Where can I learn more about this less common use of copying images to flash drives?
thank you so much for all your help! you'll save me hours of more headaches!