Skip to main content

You are here

Securely cloning Linux partitions to a different system

Getting a bit-by-bit copy of a partition or an entire hard drive is quite simple using the tool dd.

Depending on what you're trying to accomplish, there are two ways to get a copy of your partitions/drives.

One option is to clone the partition/drive directly to an actual partion/drive of your different system.

dd if=/dev/sdb1 | ssh [email protected] of=/dev/sdb1

Other option is to clone the partition/drive to a raw file on your second system, and associate the raw file to a loopback on your secondary host. This will give you the ability to easily mount the file as it were an actual partion/drive stored on your drive.

dd if=/dev/sdb1 | ssh [email protected] of=/root/rubysecurity_sdb1
[email protected] # losetup /dev/loop2 /root/rubysecurity_sdb1
[email protected] # mount /root/rubysecurity_sdb1 /mnt

Premium Drupal Themes by Adaptivethemes