Fast Disk Cloning

Question :

Fast Disk Cloning,

Answer :

Is there a way to have Linux read ahead when cloning a disk? I use the program named “dd” to clone disks. The last time I did this it seemed as though the OS was reading then writing but never at the same time. Ideally, the destination disk would be constantly writing without waiting that’s of course if the source disk can keep up.

UPDATE: I normally choose a large block size when cloning (ex. 16M or 32MB).


Commodore Jaeger is right about:

dd if=/dev/sda of=/dev/sdb bs=1M  

Also, adjusting “readahead” on the drives usually improves performance. The default may be something like 256, and optimal 1024. Each setup is different, so you would have to run benchmarks to find the best value.

# blockdev --getra /dev/sda  256  # blockdev --setra 1024 /dev/sda  # blockdev --getra /dev/sda  1024  # blockdev --help  Usage:    blockdev -V    blockdev --report [devices]    blockdev [-v|-q] commands devices  Available commands:      --getsz (get size in 512-byte sectors)      --setro (set read-only)      --setrw (set read-write)      --getro (get read-only)      --getss (get sectorsize)      --getbsz    (get blocksize)      --setbsz BLOCKSIZE  (set blocksize)      --getsize   (get 32-bit sector count)      --getsize64 (get size in bytes)      --setra READAHEAD   (set readahead)      --getra (get readahead)      --flushbufs (flush buffers)      --rereadpt  (reread partition table)      --rmpart PARTNO (disable partition)      --rmparts   (disable all partitions)  #  

That’s the answer Fast Disk Cloning, Hope this helps those looking for an answer. Then we suggest to do a search for the next question and find the answer only on our site.

Read More  What good technology podcasts are out there?

Disclaimer :

The answers provided above are only to be used to guide the learning process. The questions above are open-ended questions, meaning that many answers are not fixed as above. I hope this article can be useful, Thank you