I resized the root partition with GParted, from 20 GB to 40 GB, but the filesystem still reports a size of 20 GB.
How can I use all 40 GB?
Update
The resized partition was an LVM Physical Volume (/dev/sda2), and the boot partition is ext4 (/dev/sda1).
Best Answer
Assuming the common case of an ext2/3/4 filesystem, the answer would be
resize2fs
, part of thee2fsprogs
package. It can even run on mounted partitions.Usage:
where
/dev/sda3
is the partition you want to resize. This automatically expands the filesystem to occupy the whole partition.Update
In your case, with LVM, there are additional steps necessary:
pvresize /dev/sda2
mount
,/etc/fstab
orvgdisplay
orlvdisplay
to get your root filesystems volume name. It should be something like/dev/MyVolumeGroup/MyRootVolume
.lvextend -l +100%FREE /dev/MyVolumeGroup/MyRootVolume
.resize2fs /dev/MyVolumeGroup/MyRootVolume
After this procedure, you should be able to utilize the newly added space.