Disk cloning using dd
This is a step by step solution for the people who want to get straight to the point.
You can print only this page and use it as a quick reference.
Local Step 1:
root@from# dd if=/dev/hda of=/safe/place/hda.mbr.dd bs=1 count=512
root@from# sfdisk –d /dev/hda > /safe/place/hda.pt.sfdisk
root@from# dd if=/dev/hda1 of=/safe/place/hda1.dd bs=512
root@from# dd if=/dev/hda2 of=/safe/place/hda2.dd bs=512
root@from# dd if=/dev/hda3 of=/safe/place/hda3.dd bs=512
root@from# dd if=/dev/hda5 of=/safe/place/hda5.dd bs=512
root@from# dd if=/dev/hda6 of=/safe/place/hda6.dd bs=512
Local Step 2:
root@to# dd if=/safe/place/hda.mbr.dd of=/dev/hdc bs=1
root@to# sfdisk –R /dev/hdc
root@to# sfdisk –n /dev/hdc < /safe/place/hda.pt.sfdisk
root@to# sfdisk /dev/hdc < /safe/place/hda.pt.sfdisk
root@to# dd if=/safe/place/hda1 of=/dev/hdc1 bs=512
root@to# dd if=/safe/place/hda2 of=/dev/hdc2 bs=512
root@to# dd if=/safe/place/hda3 of=/dev/hdc3 bs=512
root@to# dd if=/safe/place/hda5 of=/dev/hdc5 bs=512
root@to# dd if=/safe/place/hda6 of=/dev/hdc6 bs=512
Remote Step 1 (clone the mbr)
root@to# nc –v –l –p 2000 | gzip –cd > /dev/hda
root@from# dd if=/dev/hda bs=512 count=1 | gzip –c9 | nc –q 2
root@to# nc –v –l –p 2000 | gzip –cd > hda.sfdisk
root@from# sfdisk –d /dev/hda | gzip –c9 | nc –q 2
root@to# sfdisk –n /dev/hda < hda.sfdisk
Test OK…
root@to# sfdisk /dev/hda < hda.sfdisk
root@to# sfdisk –R /dev/hda
5.4 Remote Step 2 (clone the partitions):
root@to# nc –v –l –p 2000 | gzip –cd | dd of=/dev/hdaX
root@from# dd if=/dev/hdaX | gzip –c9 | nc –q 2
Repeat this step for the number of partitions that you have. All that will vary is the
partition X eg. hda2, hda3, hda4 etc.
0 Comments:
Post a Comment
<< Home