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).
Answer
Assuming the common case of an ext2/3/4 filesystem, the answer would be resize2fs
, part of the e2fsprogs
package. It can even run on mounted partitions.
Usage:
resize2fs /dev/sda3
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:
- Resize the Physical Volume with
pvresize /dev/sda2
- Look at either
mount
,/etc/fstab
orvgdisplay
orlvdisplay
to get your root filesystems volume name. It should be something like/dev/MyVolumeGroup/MyRootVolume
. - Add the free space to your volume with the following command:
lvextend -l +100%FREE /dev/MyVolumeGroup/MyRootVolume
. - Then, resize the filesystem:
resize2fs /dev/MyVolumeGroup/MyRootVolume
After this procedure, you should be able to utilize the newly added space.
No comments:
Post a Comment