0

Intend to fully clone a physical disk installed with Ubuntu 14.04 LTS operating system to another physical disk. The original is booted from grub with an other disk which is also installed with an operating system. Is it possible to apply this type of clone. If so, then how to do it?

The current configuration is: The original disk to clone is Ubuntu 14.04.3 LTS on /dev/sdb1. Another disk already exists with an operating system installed is /dev/sda1. The grub for the above two disks are on /dev/sdb1. The requirement is clone the disk, say /dev/sdb1, to a new physical disk.

  • Your question is not fully clear. The OS on the second disk may be overwritten or should be kept? Where exactly is the system bootet from? Please add some information about disks (sda, sdb, sdc, ...) and where you boot from and which one to clone to which. – ridgy Apr 22 '17 at 09:41

1 Answers1

1

Be sure to have a current and valid backup of all your important data before messing aroud with disks

Say the third disk is connected as /dev/sdc, you booted from /dev/sdb(as you said grub is there), but the running OS is on /dev/sda. Then dd would be the simplest way to clone sdb to sdc. sdc should at minimum be equal in size as sdb

First make sure you have the correct devices by issuing mount (should only show partitions on /dev/sda) and sudo fstab -l (if the third disk is new, there should be no partitions on it, or only one FAT or NTFS).

After being very sure (the following will destroy all data on /dev/sdc) you might use different ways:

Use the standard block copy program:

sudo dd if=/dev/sdb of=/dev/sdc bs=1M

This will copy each block from /dev/sdb to /dev/sdc. See man dd for more information. If you want more options, e.g. a progress indicator, install dcfldd (should be in the default repositories), and run

sudo dcfldd if=/dev/sdb of=/dev/sdc bs=1M

which will give you a status report every 256 blocks. Adding the option statusinterval=N will report every N blocks.

After you copied the disk block by block, you will have to adapt the partition table, as this will not reflect the new disk geometry. For that, start gparted, select the new disk, and resize (enlarge) the last partition to use the whole disk, depending on your partition layout.

If you prefer an all-in-one solution, you may install clonezilla from the default repositories. This program is able to make partition/disk images and to clone partitions/images (see Clonezilla. I did not work with that for long time, so I cannot give any advice here.

ridgy
  • 2,356
  • 1
    I would recommend Clonezilla because it is safer (there are checkpoints that helps you make sure, that you will write to the correct drive). It is easiest to download a Clonezilla iso file, create a CD or USB boot drive and run the computer from that drive in order to use Clonezilla, http://clonezilla.org – sudodus Apr 29 '17 at 05:22