Mon, June 4, 2018 ยท 1 min read

Disk expansion after clonezilla restore to a larger disk.

Disk expansion after clonezilla restore to a larger disk.

Clonezilla is used to restore the clone image to a destination drive, if the destination drive size is larger than the original source disk cloned then after image restore you will see old disk size instead of new one.

Eg: A clone was done on 250gb hdd and restored to a 1Tb drive after restore the new disk shows 250gb instead of 1tb.

Workaround for this problem would be recreating the partition table from fdisk.

fdisk /dev/sda

Delete the partition sda2 and then expand it:

Command (m for help): d
Partition number (1,2, default 2): 2

Create again the partition with defaults:

Command (m for help): n
Partition type:
p primary (1 primary, 0 extended, 3 free)
e extended
Select (default p): p
Partition number (2-4, default 2):
First sector (1026048-250069679, default 1026048):
Last sector, +sectors or +size{K,M,G} (1026048-250069679, default 250069679):

Change the partition type to lvm:

Command (m for help): t
Partition number (1,2, default 2): 8e

Save the changes:

Command (m for help): w

Reboot, then:

pvresize -v /dev/sda2
lvextend -l +100%FREE /dev/centos/root
xfs_growfs /dev/centos/root