Resizing root without data loss

Hi! Thank you for reading.

I can’t install apps anymore because my /root is full. I want to resize it. There is plenty of unused space on the drive it is on.

I found at least two discussions on these forums, where the op had the exact same issue. However they were more advanced users, and the replies they got were too open ended for me. I’m a noob!

Here’s my output from df -h and lsblk

Filesystem                      Size  Used Avail Use% Mounted on
devtmpfs                        4,0M     0  4,0M   0% /dev
tmpfs                           6,8G     0  6,8G   0% /dev/shm
tmpfs                           2,7G  1,7M  2,7G   1% /run
**/dev/mapper/fedora_fedora-root   15G   15G 1000M  94% /**
tmpfs                           6,8G  6,4M  6,8G   1% /tmp
/dev/nvme0n1p2                 1014M  340M  675M  34% /boot
/dev/nvme0n1p1                  599M  7,0M  592M   2% /boot/efi
/dev/md127                       14T  3,6T  9,4T  28% /mnt/9c2ffe43-4398-49c3-baa9-740ecb8d41e7
tmpfs                           1,4G  116K  1,4G   1% /run/user/1000


[lomppu@lomppusili ~]$ lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
sda           8:0    0   2,7T  0 disk  
└─sda1        8:1    0   2,7T  0 part  
  └─md127     9:127  0  13,6T  0 raid5 /mnt/9c2ffe43-4398-49c3-baa9-740ecb8d41e7
sdb           8:16   0   2,7T  0 disk  
└─sdb1        8:17   0   2,7T  0 part  
  └─md127     9:127  0  13,6T  0 raid5 /mnt/9c2ffe43-4398-49c3-baa9-740ecb8d41e7
sdc           8:32   0   2,7T  0 disk  
└─sdc1        8:33   0   2,7T  0 part  
  └─md127     9:127  0  13,6T  0 raid5 /mnt/9c2ffe43-4398-49c3-baa9-740ecb8d41e7
sdd           8:48   0   2,7T  0 disk  
└─sdd1        8:49   0   2,7T  0 part  
  └─md127     9:127  0  13,6T  0 raid5 /mnt/9c2ffe43-4398-49c3-baa9-740ecb8d41e7
sde           8:64   0   2,7T  0 disk  
└─sde1        8:65   0   2,7T  0 part  
  └─md127     9:127  0  13,6T  0 raid5 /mnt/9c2ffe43-4398-49c3-baa9-740ecb8d41e7
sdf           8:80   0   2,7T  0 disk  
└─sdf1        8:81   0   2,7T  0 part  
  └─md127     9:127  0  13,6T  0 raid5 /mnt/9c2ffe43-4398-49c3-baa9-740ecb8d41e7
zram0       252:0    0     8G  0 disk  [SWAP]
**nvme0n1     259:0    0 232,9G  0 disk  **
**├─nvme0n1p1 259:1    0   600M  0 part  /boot/efi**
**├─nvme0n1p2 259:2    0     1G  0 part  /boot**
**└─nvme0n1p3 259:3    0 231,3G  0 part  **
**  └─fedora_fedora-root**
**            253:0    0    15G  0 lvm   /**

I read that others with this issue were adviced to use lvresize to resolve this issue, and apparently it worked.

Could someone please take the time to type out more detailed instructions for extending the root without data loss? I have a live bootable media handy, but I’m scared to go poking around the root partition without knowing exactly what I’m doing.

Thank you so much!

could you please post the output of sudo vgs? Also please use </> to mark the output as preformatted text.

pay attention to the value for VFree. This should probably be in your case at more than 200g. That is the amount of extents still available in the volume group fedora.

You can extend the logical volume online with
sudo lvextend -r -L+Xg /dev/mapper/fedora_fedora-root
replace X with the value (in GiB) by which you want to extend the filesystem

i.e.
sudo lvextend -r -L+5g /dev/mapper/fedora_fedora-root would extend the logical volume by 5GiB and resize the filesystem (-r) .

1 Like

I edited you post to use the pre-formatted text markup.

1 Like

Wow, thanks for answering so quickly!!

[lomppu@lomppusili ~]$ sudo vgs
[sudo] password for lomppu: 
  VG            #PV #LV #SN Attr   VSize    VFree   
  fedora_fedora   1   1   0 wz--n- <231,30g <216,30g

You were right, it is over 200g.

Thank you so much! I will try that now.

it worked! thanks again!

1 Like