Score:0

Properly Extend virtual volumes on a CentOS VM, new space in /dev/cl/ not occupied by /dev/mapper

cn flag

I have a CentOS VM (on a windows host, managed with virtualbox) that ran out of disk space.

I extended the virtual disk size, then used gparted to assign the new space to the existing partition

Then I used lvextend to assign halves of the free space to /dev/cl/home and /dev/cl/root

However df show that the /dev/mapper/cl-home and /dev/mapper/cl-root haven't grown into the now available space even after a reboot.

What am I missing ? Any tutos I found about extending existing logical volumes considered the job done with lvextend...

df gives :

/dev/mapper/cl-root    39G     37G  1,2G  98% /
/dev/mapper/cl-home    19G     13G  5,7G  70% /home
/dev/sda1             976M    672M  238M  74% /boot

and lsblk :

NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda           8:0    0  150G  0 disk 
├─sda1        8:1    0    1G  0 part /boot
└─sda2        8:2    0  149G  0 part 
  ├─cl-root 253:0    0   81G  0 lvm  /
  ├─cl-swap 253:1    0  6,4G  0 lvm  [SWAP]
  └─cl-home 253:2    0 61,6G  0 lvm  /home

and lvdisplay

  --- Logical volume ---
  LV Path                /dev/cl/swap
  LV Name                swap
  VG Name                cl
  LV UUID                <redacted>
  LV Write Access        read/write
  LV Creation host, time <redacted>
  LV Status              available
  # open                 2
  LV Size                6,40 GiB
  Current LE             1639
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     8192
  Block device           253:1
   
  --- Logical volume ---
  LV Path                /dev/cl/home
  LV Name                home
  VG Name                cl
  LV UUID                <redacted>
  LV Write Access        read/write
  LV Creation host, time <redacted>
  LV Status              available
  # open                 1
  LV Size                <61,57 GiB
  Current LE             15761
  Segments               2
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     8192
  Block device           253:2
   
  --- Logical volume ---
  LV Path                /dev/cl/root
  LV Name                root
  VG Name                cl
  LV UUID                <redacted>
  LV Write Access        read/write
  LV Creation host, time <redacted>
  LV Status              available
  # open                 1
  LV Size                <81,03 GiB
  Current LE             20743
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     8192
  Block device           253:0
Score:0
cn flag

Answer given here : https://unix.stackexchange.com/a/671254/494994

resize2fs (for ext4) or xfs_growfs (for xfs) are used to resize the file system to fully use the logical volume alloted.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.