I recently had to clone one USB drive to another on windows. My drive is a multiboot with additional software so I didn't want to just copy all files on the FS. DD was a clear choice, but I wasn't on linux so there were a few things I had to do to get it working.
I had cygwin installed and did the following.
first I had to figure out what /dev/sdX device my f: volume was. To do so run this command in cygwin. (TIP: Make sure you start cygwin with admin privs.. *Right click on cygwin and "Run as Administrator")
cat /proc/partitions
which should output:
8 0 3813383838 sda
8 1 4031 sda3 C:\
8 15 30588303 sdb
8 15 30588303 sdb1 E:\
8 21 30530020 sdc
8 22 30530020 sdc1 F:\
etc...
Here you can clearly see for me to clone my F: drive to my E: drive I'd issue the following command.
There is one more step actually, you have to find the root of your device. Look for an sd* that has a size of your device. This whould be easy as the size should be well known such as 8GB, 16GB, 32GB expanded as bytes as shown above.
dd if=/dev/sdc of=/dev/sdb bs=8M
My image was 32gb.. and I didn't want to just sit and wait with a blinking cursor.. I wanted to see progress so I installed "pv" in cygwin.
dd if=/dev/sdc | pv | dd of=/dev/sdb bs=8M
Now if you want to copy the thumbdrive to an image do the following.
dd if=/dev/sdX | pv | dd of=/cygdrive/c/Users/Myname/Desktop/mythumbdrive.img bs=8M
Hope this helps
With VirtualBox 5.x I have managed to format a USB drive completely to boot GRUB2. Thought I got it to work the first time, but I ended up probably not only needing to install their USB Extension Pack, but also when the VM started up I needed to select the USB drive under devices so the VM had a 'direct' connection to the drive to operate on 'completely'. I just saw you mention VirtualBox and wonder if this note could also help the situation. – Pysis – 2017-03-25T01:30:50.230
Have you tried
dd if=/dev/sdd1 of RPi.img
? – Kruug – 2013-04-10T16:30:14.543If I do that, I only get a ~59 MB file from the 4 GB SD Memory Card. Basically I'm only getting the portion of the card that Windows "sees" when you insert the card in the reader. It's not the full image. – GrandAdmiral – 2013-04-10T16:35:54.023
Could you use a Linux machine, or Linux LiveCD instead of trying in Windows? – Kruug – 2013-04-10T16:40:32.753
Virtual Linux Machines don't seem to see the SD Memory Card (tried VMware Player and VirtualBox) because I'm using the internal reader on the laptop. Then to top it off.... I don't have a CD burner in the laptop either. :) I have a Mac at home that I can use, I was just trying to find something that would work with my current situation.... and figure out if it was even possible. Seemed like cygwin should have worked. – GrandAdmiral – 2013-04-10T16:42:58.023
For creating a Linux bootable device, check out http://unetbootin.sourceforge.net/. It will take a LiveCD and "burn" it to a USB device allowing you to boot from it.
– Kruug – 2013-04-10T16:45:55.1874I found that I can also use 'cat /proc/partitions' to get the name of the attached SD Memory Card. – GrandAdmiral – 2013-05-16T15:18:27.047