Friday, August 10, 2012

Cloning Bootable Linux Flash Drives

I'm forever forgetting the Linux command to clone Linux flash drives. It comes in handy because it's really easy to accidentally trash the file system if your PC crashes or you accidentally perform and un-graceful shut-down. Keep many and make frequent back-up of your work in progress if you're doing on a flash drive!

Here's the command:

    dd if=/dev/sdc of=/dev/sdd

This is a very powerful command! You will need to invoke the power of sudo! Make sure that if the PC has a hard drive that you don't point the "of" (output file) at it our you'll wipe out what every operating system was on it. Remember that you also need to run this from a drive that isn't your input or output flash drive. For this reason you may need as many as three USB devices to complete this operation. 

Do not run this command verbatim! First do an ls to determine what your current drives are, and make sure to keep them out of this command. Then plug in the source drive, and use ls to find its name (i.e. sdc). Next plug in the destination drive, and again determine its name. Only then run the command. You will find that a 4GB flash drive may take quite a while to copy.