Linux – No more space in root filesystem, how could I increase the size

fedorafilesystemslinuxlvmpartitioning

This is my filesystem :

 $ df -h -x tmpfs -x devtmpfs
Filesystem               Size  Used Avail Use% Mounted on
/dev/mapper/fedora-root  9.8G  7.6G  1.7G  83% /
/dev/mapper/fedora-home   50G   27G   21G  57% /home
/dev/sda9               1022M  8.4M 1014M   1% /boot/efi

And as you can see the root filesystem is full.

I already tried to delete all the useless things but still I don't have enough space.

How could I increase it ? I have 60 giga left in my hard drive, is there any way I can move my root filesystem there ?

Best Answer

Good news! pvscan shows PV /dev/sda10 VG fedora lvm2 [141.56 GiB / 77.56 GiB free] — so you should be able to add up to 77.56GiB to any of your filesystems. I'd suggest adding it in smaller blocks (like 10GiB), so you have a reserve to put into /home if you decide you need growth there later.

This is a relatively well-tested and generally safe operation, but all root-level volume and filesystem operations have some risk — make sure you have a functioning backup first. Then....

You can extend your root logical volume to use the free space with lvextend, like this:

sudo lvextend --size +10G --resizefs /dev/fedora/root

(Or -L and -r instead of --size and --resizefs, if you prefer short options.)

Related Question