The question is quite simple. I have search for an answer for a while but not sure I got the correct answer. Since mistakes could easily destroy my drive and data, I really want things to be clear.
I am running Ubuntu on a 250GB SSD (
/dev/sda) which has two partitions, each is about 125GB big. The sda1 is mounted to
/ and sda2 is mounted to
/home. Now I want to move everything into a new 1TB SSD (let's say it is
/dev/sdc) and expand each drive into 500GB. After some research, I proposed two approaches:
dd if=/dev/sda of=/dev/sdcto clone the whole disk. After this I should get a bootable disk with two 125 GB partitions and some unallocated space. Right? Then I need resize the sdc1 and sdc1 into 500GB with something like gparted. The resizing might take long, right?
The second approach is format the new drive first, make two 500GB partitions. Do
dd if=/dev/sda1 of=/dev/sdc1and
dd if=/dev/sda2 of=/dev/sdc2to clone both partitions. At this point, this disk should be unbootable, right? In order to make it bootable, I need copy the bootloader into the new one. All I need is the first 446 bytes. So I can
dd if=/dev/sda of=/tmp/mbrsda.bak bs=512 count=1then
dd if=/tmp/mbrsda.bak of=/dev/sdc bs=446 count=1. By doing this I made it bootable and also preserved the partition table for 500GB+500GB. This approach will save me from resizing the disk.
And for both approaches, I need change the UUID in the
/etc/fstab file. This can be done by first mount the new drive after cloning:
sudo mount /dev/sdc1 /mnt/, then edit the
Am I right about all of this?
Any potential risk of messing up my old drive here?