0

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).

1

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:

  1. Resize the Physical Volume with pvresize /dev/sda2
  2. Look at either mount, /etc/fstab or vgdisplay or lvdisplay to get your root filesystems volume name. It should be something like /dev/MyVolumeGroup/MyRootVolume.
  3. Add the free space to your volume with the following command: lvextend -l +100%FREE /dev/MyVolumeGroup/MyRootVolume.
  4. Then, resize the filesystem: resize2fs /dev/MyVolumeGroup/MyRootVolume

After this procedure, you should be able to utilize the newly added space.

| improve this answer | |
  • After I use this command I got the error: "Couldn't find valid filesystem superblock." – TheKolanN May 6 '14 at 12:33
  • So did you specify the correct partition? Are you even using an ext filesystem? You can check both by running mount. – Daniel B May 6 '14 at 13:06
  • Of course, the partition I resized to 40GB is /dev/sda2 on my machine. It has lvm2 pv in its "File system" info. – TheKolanN May 6 '14 at 13:10
  • I see, so you’re using LVM and /dev/sda2 is not your root partition but a LVM Physical Volume. I’ll update the answer later. – Daniel B May 6 '14 at 13:13
  • @TheKolanN I’ve updated the answer. – Daniel B May 6 '14 at 14:35
0

The LV will now be 100G, but the overlying filesystem will still be 90G.

LVM utils like lvs, lvdisplay etc. will show 100G

System utils like df, du etc. will show 90G.

Resizing the filesystem will depend on which filesystem you’re using and where it’s mounted.

Assume the LV is mounted at /space

Some common standard filesystems are ext4 and xfs.

If you’re using xfs:

xfs_growfs /dev/sda3

If you’re using ext4:

resize2fs /dev/sda3

| improve this answer | |
  • 1
    Where do those numbers come from? – Scott Apr 23 '19 at 13:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.