Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
How to increase the root partition size on Fedora

How to increase the root partition size on Fedora

Boot up with an Fedora Live USB stick.

  1. Run vgs to check if there's any space:
$ sudo vgs
  VG     #PV #LV #SN Attr   VSize    VFree
  fedora   1   3   0 wz--n- <237.28g    0 
  1. If there is you can just run:
lvresize -L +5G --resizefs /dev/mapper/fedora-root

NB: Remember to check where your fedora root and home partition is mounted by running fdisk -l.

  1. If you don't have any free VFree space, you can shrink your home partition and then extend your root partition afterwards.

To scrink your home partition run:

lvresize -L -10G --resizefs /dev/mapper/fedora-home

And then to extend your root partition run:

lvresize -L +10G --resizefs /dev/mapper/fedora-root
@bcrnkovic

This comment has been minimized.

Copy link

@bcrnkovic bcrnkovic commented Mar 28, 2019

Just what I was looking for... thanks for this!

@Ben1980

This comment has been minimized.

Copy link

@Ben1980 Ben1980 commented Mar 29, 2019

Thanks for the tip. But unfortunately it seems not to work with Fedora 29 on VMWare Workstation. VFree is always 0 but there should be additional 10G available.

Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 2099199 2097152 1G 83 Linux
/dev/sda2 2099200 41943039 39843840 19G 8e Linux LVM

VG #PV #LV #SN Attr VSize VFree
fedora 1 2 0 wz--n- <19.00g 0

@kamalmeh

This comment has been minimized.

Copy link

@kamalmeh kamalmeh commented May 11, 2019

Thanks! Similar issue faced while upgrading my server from fedora 29 to 30.
Downloading failed due to root partition was 100% full after downloading 1.4G our of 1.9G. I was stuck in middle.
I had space available and simply executed the below command my problem was fixed.

[kmehta@dev ~]$ date
Sat May 11 19:28:42 IST 2019
[root@dev ~]# df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 1.4G 0 1.4G 0% /dev
tmpfs 1.5G 0 1.5G 0% /dev/shm
tmpfs 1.5G 1.2M 1.5G 1% /run
tmpfs 1.5G 0 1.5G 0% /sys/fs/cgroup
/dev/mapper/fedora00-root 15G 15G 45M 100% /
tmpfs 1.5G 32K 1.5G 1% /tmp
/dev/sda1 976M 205M 705M 23% /boot
/dev/sdb5 150G 70M 149G 1% /mnt/nas001
/dev/sdc1 1.9T 99G 1.8T 6% /mnt/nas000
tmpfs 288M 0 288M 0% /run/user/1000
[root@dev ~]# lvresize -L +5G --resizefs /dev/mapper/fedora-root
Volume group "fedora" not found
Cannot process volume group fedora
[root@dev ~]# vgs
VG #PV #LV #SN Attr VSize VFree
fedora00 1 2 0 wz--n- <148.05g 130.11g
[root@dev ~]# lvresize -L +35G --resizefs /dev/mapper/fedora00-root
[root@dev ~]# df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 1.4G 0 1.4G 0% /dev
tmpfs 1.5G 0 1.5G 0% /dev/shm
tmpfs 1.5G 1.2M 1.5G 1% /run
tmpfs 1.5G 0 1.5G 0% /sys/fs/cgroup
/dev/mapper/fedora00-root 50G 15G 36G 30% /
tmpfs 1.5G 32K 1.5G 1% /tmp
/dev/sda1 976M 205M 705M 23% /boot
/dev/sdb5 150G 70M 149G 1% /mnt/nas001
/dev/sdc1 1.9T 99G 1.8T 6% /mnt/nas000
tmpfs 288M 0 288M 0% /run/user/1000

Thanks once again.

Regards
Kamal Mehta
https://www.smiansh.com

@mwolski89

This comment has been minimized.

Copy link

@mwolski89 mwolski89 commented Aug 19, 2019

worked for me, thanks a lot 👍

@voneAbides

This comment has been minimized.

Copy link

@voneAbides voneAbides commented Dec 8, 2019

Thank you. Worked.

@vbasarkar

This comment has been minimized.

Copy link

@vbasarkar vbasarkar commented Feb 3, 2020

Worked for me with Fedora 25.

@luke-h1

This comment has been minimized.

Copy link

@luke-h1 luke-h1 commented Apr 18, 2020

thanks for this.

@dubst3pp4

This comment has been minimized.

Copy link

@dubst3pp4 dubst3pp4 commented Apr 29, 2020

Thank you very much! Works perfectly :-)

@whernandez

This comment has been minimized.

Copy link

@whernandez whernandez commented Aug 19, 2020

Works perfectly, booting from fedora 32. Thanks!

@LeonelSoriano

This comment has been minimized.

Copy link

@LeonelSoriano LeonelSoriano commented Oct 5, 2020

I love man :D

@MadBomber

This comment has been minimized.

Copy link

@MadBomber MadBomber commented Dec 5, 2020

Trying this under Fedora 31 ... Ran into a problem with /home not being able to be unmounted.

[root@frank ~]# vgs
  VG       #PV #LV #SN Attr   VSize    VFree
  fedora     1   3   0 wz--n- <930.51g    0
  fedora00   1   3   0 wz--n-   <1.82t    0
[root@frank ~]# lvresize -L -20G --resizefs /dev/mapper/fedora-home
Do you want to unmount "/home" ? [Y|n] y
umount: /home: target is busy.
fsadm: Cannot proceed with mounted filesystem "/home".
  /usr/sbin/fsadm failed: 1
  Filesystem resize failed.
[root@frank ~]# lvresize -L -20G --resizefs /dev/mapper/fedora-home
Do you want to unmount "/home" ? [Y|n] n
fsadm: Cannot proceed with mounted filesystem "/home".
  /usr/sbin/fsadm failed: 1
  Filesystem resize failed.
[root@frank ~]#
@cankarales

This comment has been minimized.

Copy link

@cankarales cankarales commented Feb 25, 2021

Thank you sir, this worked great. However sudo vgs returned an empty result on my laptop, I'm guessing because the drive is encrypted. I used gparted to unlock it, then I was able to resize partitions :)

@AkashRajpurohit

This comment has been minimized.

Copy link

@AkashRajpurohit AkashRajpurohit commented Mar 1, 2021

Trying this under Fedora 31 ... Ran into a problem with /home not being able to be unmounted.

[root@frank ~]# vgs
  VG       #PV #LV #SN Attr   VSize    VFree
  fedora     1   3   0 wz--n- <930.51g    0
  fedora00   1   3   0 wz--n-   <1.82t    0
[root@frank ~]# lvresize -L -20G --resizefs /dev/mapper/fedora-home
Do you want to unmount "/home" ? [Y|n] y
umount: /home: target is busy.
fsadm: Cannot proceed with mounted filesystem "/home".
  /usr/sbin/fsadm failed: 1
  Filesystem resize failed.
[root@frank ~]# lvresize -L -20G --resizefs /dev/mapper/fedora-home
Do you want to unmount "/home" ? [Y|n] n
fsadm: Cannot proceed with mounted filesystem "/home".
  /usr/sbin/fsadm failed: 1
  Filesystem resize failed.
[root@frank ~]#

If you are still facing this issue, login with root user and try it again.
Please note that login with root means logging out as your non root user and login with credentials root and <YOUR_PASSWORD>. If you are trying the sudo su command to switch the user you still would get this error.

Reason: The non root user has mounted /home directory and possibly the applications running are accessing the file contents inside of /home so that's why we cannot unmount it. Login with root user will solve this problem.

I will post a detailed blog about this on my blogging site as well.
Regards.

Edit:
Written post for this process -

@AlexandreBiondi

This comment has been minimized.

Copy link

@AlexandreBiondi AlexandreBiondi commented Oct 29, 2021

Great ! Thanks for sharing !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment