Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a usb stick with two partitions FAT 32 adn ext3. First one is used to boot from using SystemRescueCD. Second one contains the image I use with image recovery tool. I have to copy such an usb 10 times so I thouhgt maybe there is an easy way to do this, something like cp /dev/sdb ?

share|improve this question

2 Answers 2

up vote 7 down vote accepted

you can clone it with dd.

assuming your flash drive is /dev/sbd and you are cloning it to a second flash drive, /dev/sdc

sudo dd if=/dev/sdb of=/dev/sdc bs=4096 conv=notrunc,noerror

You can save a compressed image to your harddrive

sudo dd if=/dev/sdb ibs=4096 conv=noerror | gzip > your_image.gz

Then use the image to make a new flash

dd if=your_image.gz | gunzip | dd of=/dev/sdc
share|improve this answer
    
It works! Thanks a lot. –  tommyk Dec 19 '11 at 12:51
    
You are most welcome –  bodhi.zazen Dec 19 '11 at 15:53

You want to use the dd utility.

Basically, dd if=/dev/xda of=/dev/xdb where xda is the input drive ('if means input file, of means output file).

See this post: http://ubuntuforums.org/showthread.php?p=5627660#post5627660

dd is a utility for bit for bit copies. Make sure to try this on something you don't care about before doing it to a mission critical usb stick.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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