What about a fast cloning method for a compact flash/usb memory/external or internal hard-disk drive using a single linux shell command?
Don't simply use:
#dd if=/dev/IN_DEVICE of=/dir/file.img
Try instead:
#dd if=/dev/IN_DEVICE bs=1M iflag=direct | dd of=/dir/file.img bs=1M oflag=direct
It is remarcably faster because:
- using two processes, reading and writing are asyncronous,
- using large block transfers you can reach the maximum throughput,
- the direct I/O may speed up the process a lot if you are using a fast machine,
- you can also rise your drive readahead:
#blockdev --setra 1024 /dev/IN_DEVICE
Use, in another shell:
#watch -n 10 killall -USR1 dd
...to watch progess.