UNIX Disk Cloning
Cloning a disk
Cloning a disk
dd if=/dev/sdb ibs=64K conv=sync,noerror | pv | dd of=/dev/sdd obs=64K
Input File (if) sdb is a block device (containing a single partition sdb1)Output File (of) sdd is a new, unformatted, unpartitioned driveInput/Output Block Size (ibs/obs) of 64K may be a reasonable choice if you are in a hurry.(the default of 512 will be slow, but does, theoretically, have less risk of corruption).(if you can afford a few extra minutes prep it is always better to calculate optimum block size values, see below).The command above could be done as a single dd command but putting in the pv (pipe viewer) displays a progress barConvert (conv) options: sync pads every input block with NULs to bs, noerror continues after read errors.(i.e. we want as close to an exact copy of our disk as we can get but without failing if the source has read errors)
At this point, you should have two identical disks. If you unmount one and mount the other then any applications (e.g. Plex) should not notice any difference.
dd stands for "data definition" although there a many commonly used, and probably more descriptive, misnomers. e.g... "disk destroyer", "delete data", "disk dump", "data dump"
Calculating Optimum Block Size Values
Calculating Optimum Block Size Values
Use the scripts here to test your disk performance...
https://github.com/tdg5/blog/blob/master/_includes/scripts/dd_ibs_test.shhttps://github.com/tdg5/blog/blob/master/_includes/scripts/dd_obs_test.sh- Always test more than once to be sure of your results.
- To reduce risk of corruption always prefer the smallest block size for similar performance.
Alternate methods
Alternate methods
PartImage
Partclone
Clonezilla
Bibliography
Bibliography
https://superuser.com/questions/234199/good-block-size-for-disk-cloning-with-diskdump-ddhttp://blog.tdg5.com/tuning-dd-block-size/https://www.howtoforge.com/tutorial/linux-dd-command-clone-disk-practical-example/https://www.mail-archive.com/eug-lug@efn.org/msg12073.htmlhttps://en.wikipedia.org/wiki/Dd_(Unix)https://www.makeuseof.com/tag/2-methods-to-clone-your-linux-hard-drive/
Calculating Optimum Block Size Valueshttps://github.com/tdg5/blog/blob/master/_includes/scripts/dd_ibs_test.shhttps://github.com/tdg5/blog/blob/master/_includes/scripts/dd_obs_test.sh
Calculating Optimum Block Size Valueshttps://github.com/tdg5/blog/blob/master/_includes/scripts/dd_ibs_test.shhttps://github.com/tdg5/blog/blob/master/_includes/scripts/dd_obs_test.sh