Replacing linux system drive over EFI boot while expanding partitions

By: | Comments: No Comments

Posted in categories: Computer Tips, Work related

If only to replace a system drive, doing a dd of old drive to new drive will work.

However, in most of cases the driving force of replacing drives is that the drive size is not big enough to host increasing size of system files.

In this case, only doing dd will screw you up in the same partition sizes.

There is a workaround, that you can do dd of the boot sector as well as the first partition, then use gparted to expand the first partition to the desired size. Then create a second partition, using dd to sync the second, then expand it to desired size, then the third, until it is done.

In this process, the new partitions of the second and beyond will carry a different UUID, which will prevent you from booting into the new drive properly.

You can either boot into a live CD/USB drive to change the UUIDs to the same with your old drive, or edit the /etc/fstab and /boot/grub2/grub.cfg to replace the corresonding UUID of each mount.

This method is tested working.

Be the first to comment!

Leave a Reply