Linux‎ > ‎

Resize Partition

Resize Linux Partition

First resize the volume

for LVM:

resize the lvm group

lvresize -L 10G /dev/mapper/vg0-var

to extend to the maximum (all available free space)

lvextend -l +100%FREE /dev/mapper/vg0-var

Resize XFS Partition

grow to max size (note that you can only grow XFS partitions)

xfs_growfs /var



Resize ext3 partition


shrink/grow sda6 partition to 4G

resize2fs /dev/sda6 4G

expand partition to the fill the entire partition (run the e2fsck command, which basically defrags and puts all the data at the beginning of the partition, only if you are shrinking the partition).

e2fsck -f /dev/sda6
resize2fs /dev/sda6

create label for /dev/sda6

e2label /dev/sda6 /var
Comments