You are not logged in.

#1 2024-11-17 17:05:06

Sheeb1
Member
Registered: 2024-06-14
Posts: 21

[SOLVED]Changing the size of home and root partitions (LVM)

Not sure where else to put this, but I tried changing the sizes of my home and root logical volumes since the root one was filling up. I booted into tty and used

$ resize2fs /dev/volgroup0/lv_home 900G
$ lvresize -L -20G volgroup0/lv_home
$ lvresize -L +20G volgroup0/lv_root

I ran lsblk and rebooted. After running lsblk after logging in, this is what I get:

$ lsblk
NAME                    MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
nvme0n1                 259:0    0 953.9G  0 disk  
├─nvme0n1p1             259:1    0     1G  0 part  
├─nvme0n1p2             259:2    0     1G  0 part  /boot
└─nvme0n1p3             259:3    0 951.9G  0 part  
  └─volgroup0           254:0    0 951.9G  0 crypt 
    ├─volgroup0-lv_root 254:1    0    50G  0 lvm   /
    └─volgroup0-lv_home 254:2    0   901G  0 lvm   /home

this looks right, but then when I ran df -H, I got this:

$ df -H
Filesystem                     Size  Used Avail Use% Mounted on
dev                             17G     0   17G   0% /dev
run                             17G  2.7M   17G   1% /run
efivarfs                       449k  309k  135k  70% /sys/firmware/efi/efivars
/dev/mapper/volgroup0-lv_root   32G   30G  243M 100% /
tmpfs                           17G  1.1M   17G   1% /dev/shm
tmpfs                           17G   21k   17G   1% /tmp
tmpfs                          1.1M     0  1.1M   0% /run/credentials/systemd-journald.service
tmpfs                          1.1M     0  1.1M   0% /run/credentials/systemd-udev-load-credentials.service
tmpfs                          1.1M     0  1.1M   0% /run/credentials/systemd-tmpfiles-setup-dev-early.service
tmpfs                          1.1M     0  1.1M   0% /run/credentials/systemd-sysctl.service
tmpfs                          1.1M     0  1.1M   0% /run/credentials/systemd-tmpfiles-setup-dev.service
tmpfs                          1.1M     0  1.1M   0% /run/credentials/systemd-vconsole-setup.service
/dev/nvme0n1p2                 1.1G  351M  600M  37% /boot
/dev/mapper/volgroup0-lv_home  951G   50G  853G   6% /home
tmpfs                          1.1M     0  1.1M   0% /run/credentials/systemd-tmpfiles-setup.service
tmpfs                          1.1M     0  1.1M   0% /run/credentials/systemd-resolved.service
tmpfs                          3.4G   87k  3.4G   1% /run/user/1000

the lv_root is still shown as 30G instead of 50, does anyone know if I forgot to do something or how to fix this? Thanks

Last edited by Sheeb1 (2024-11-19 20:18:35)

Offline

#2 2024-11-18 17:50:50

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 23,303

Re: [SOLVED]Changing the size of home and root partitions (LVM)

file system size and partition (... or LVM volume size) are two different sizes, resize2fs the corresponding file systems. See https://wiki.archlinux.org/title/LVM#Re … _in_one_go for what you could have done and https://wiki.archlinux.org/title/LVM#Re … separately for what you need to do now.

Offline

#3 2024-11-19 20:17:58

Sheeb1
Member
Registered: 2024-06-14
Posts: 21

Re: [SOLVED]Changing the size of home and root partitions (LVM)

Thanks so much, I realized i forgot to run

# resize2fs /dev/MyVolGroup/mediavol

after doing the resizing.

Offline

Board footer

Powered by FluxBB