USB booting :: duplicating/copying usb pendrives
Hi,
I've got a preconfigured usb pendrive, and by now I have also successfully managed to create my own in a system booted from CD. However, what I'd really like to do is configure my (usb-booted) system the way I like it and then basically copy the usb stick.
I've tried the "install to pendrive", but that doesn't seem to work if the system was already booted from a usb stick.
I've tried manually formatting the new stick and then copying /cdrom/* to the new stick, but the system complains that this stick is not bootable (even though it was set to be bootable in cfdisk).
Does anyone know of an easy way for duplicating bootable usb sticks?
Thanks
Have you tried using the dd command? I believe it's the disk dump command. It should be able to make an image of the key and then write that image to a new key. Say your old key that you liked was in sda1 and sda2:
sudo dd if=/dev/sda of=mykey.img
should make a copy of the key and place it into a file called mykey.img. Then write that image to a new key (of the same size???) with
sudo dd if=mykey.img of=/dev/sda
Excellent! This works. And yes, ideally the new stick would be of the same size (or bigger, I assume). I only have a smaller one, so the boot process runs into errors that probably have to do with the fact that data was written in the wrong locations due to the smaller size of the target. But I can tell that this will work.
Thanks a lot.
original here.