Disk expansion after clonezilla restore to a larger disk.

Clonezilla used to restore the clone image to a destiantion 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
Disk /dev/sda: 268.4 GB, 268435456000 bytes, 524288000 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x000b4a67

Device Boot Start End Blocks Id System
/dev/sda1 * 2048 2099199 1048576 83 Linux
/dev/sda2 2099200 454574079 226237440 8e Linux LVM

Delete the partition sda2 and then expand it.
Command (m for help): d
Partition number (1,2, default 2): 2
Partition 2 is deleted

Create the 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):
Using default value 1026048
Last sector, +sectors or +size{K,M,G} (1026048-250069679, default 250069679):
Using default value 250069679
Partition 2 of type Linux and of size 118.8 GiB is set

Change the partition type to lvm
Command (m for help): t
Partition number (1,2, default 2): 8e
Partition number (1,2, default 2): 2

Check the settings once
Command (m for help): p

Disk /dev/sda: 128.0 GB, 128035676160 bytes, 250069680 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x000b6954

Device Boot Start End Blocks Id System
/dev/sda1 * 2048 1026047 512000 83 Linux
/dev/sda2 1026048 250069679 124521816 8e Linux LVM

save the changes if all looks good
Command (m for help): w
The partition table has been altered!

reboot
pvresize -v /dev/sda2

Using physical volume(s) on command line.
Found same device /dev/sda2 with same pvid mclr30SpC7XRj25w9EfRoimsyMVisn4Y
Archiving volume group “centos” metadata (seqno 4).
Resizing volume “/dev/sda2” to 249043632 sectors.
Resizing physical volume /dev/sda2 from 0 to 30400 extents.
Updating physical volume “/dev/sda2”
Creating volume group backup “/etc/lvm/backup/centos” (seqno 5).
Physical volume “/dev/sda2” changed

lvextend -l +100%FREE /dev/centos/root

Size of logical volume centos/root changed from 17.05 GiB (4364 extents) to 116.80 GiB (29900 extents).
Logical volume root successfully resized.

xfs_growfs /dev/centos/root

meta-data=/dev/mapper/centos-root isize=256 agcount=4, agsize=1117184 blks
= sectsz=512 attr=2, projid32bit=1
= crc=0 finobt=0
data = bsize=4096 blocks=4468736, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=0
log =internal bsize=4096 blocks=2560, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
data blocks changed from 4468736 to 30617600