Skip to content

Instantly share code, notes, and snippets.

@jimmydo
Created January 15, 2023 22:59
Show Gist options
  • Save jimmydo/880d196017f860a5b2337dcbbdb17cc8 to your computer and use it in GitHub Desktop.
Save jimmydo/880d196017f860a5b2337dcbbdb17cc8 to your computer and use it in GitHub Desktop.
Grow a file system in a volume group

I noticed that my main file system was only 15G:

$ df -Th
Filesystem              Type      Size  Used Avail Use% Mounted on
...
/dev/mapper/fedora-root xfs        15G  1.7G   14G  11% /
...

The problem was that the logical volume wasn't using all of the free space from the underyling physical volume.

The fix was to extend the logical volume to the remaining free space and then grow the file system to match:

sudo lvextend -l +100%FREE /dev/mapper/fedora-root
sudo xfs_growfs /dev/mapper/fedora-root

The result:

$ df -Th
Filesystem              Type      Size  Used Avail Use% Mounted on
...
/dev/mapper/fedora-root xfs       111G  2.3G  108G   3% /
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment