1

I Have created a raspberry pi video loopier on a USB and i can easily clone from one USB to another USB using the dd command. This USB has multiple partitions and i wish to clone in into a empty disk image or something similar so that i can also have a clone of the USB on my computer should i lose the other USB. Is there any way for me to take everything of this USB and put it into a disk image. Any advice would be much appreciated. I have tried using the dd command to clone directly onto the pc but this does not seem to work

i used "sudo dd if=/dev/sdd of=/dev/sdc bs=9M status = progress" to clone from one usb to another so i want to do the exact same but not to another us. i just want a disk image so that i have a clone direcly on my pc

  • i used "sudo dd if=/dev/sdd of=/dev/sdc bs=9M status = progress" to clone from one usb to another so i want to do the exact same but not to another us. i just want a disk image so that i have a clone direcly on my pc – Lawo DemoKit1 Jan 25 at 17:40
  • How exactly did you try "using the dd command to clone directly onto the pc" and why didn't it work? Also, if the files are significantly smaller than the entire USB, you might consider only copying the files (plus whatever bootloader commands are required to "remake" the original USB, if it's even bootable) – Xen2050 Jan 26 at 7:02
1

If your computer uses Linux (or has a Windows version if DD - I assume that exists) you can use dd with an OF as a file, so

  dd if=/dev/sdd of=/path/to/file.name bs=4096

Additional

If you create a large file.with zeros on the USB and delete it you can get a compact compressed file using

dd if=/dev/sdd | gzip > /pathtooutputfile.gz

If you have pv installed you can get a progress report of the copy (and bypass dd)

pv < /dev/sdd | gzip > /path/to/outputfile.gz
  • What do you mean by creating a file with zero's? @davidgo – Lawo DemoKit1 Jan 25 at 19:13
  • If you issue a command like "dd if=/dev/zero of=/path/to/usb/temp.file" it will fill the disk up with zeros (until it dies with an out of disk error). Delete the file and the underlying unused disk will have zeros rather then random junk from previous writes and will compress better. – davidgo Jan 25 at 19:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.