How to Extend LVM Partition with lvextend Command in Linux


  • 0
  • 0

This is the File Path you can see all the disk and partition

lsblk

Output:

NAME    MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
loop0   7:0    0  63.4M  1 loop /snap/core20/1974
loop1   7:1    0  63.9M  1 loop /snap/core20/2182
loop2   7:2    0  74.2M  1 loop /snap/core22/1122
loop4   7:4    0    87M  1 loop /snap/lxd/27037
loop5   7:5    0  53.3M  1 loop /snap/snapd/19457
loop6   7:6    0  40.4M  1 loop /snap/snapd/20671
loop7   7:7    0    87M  1 loop /snap/lxd/27428
sda     8:0    0 931.5G  0 disk
├─sda1  8:1    0   100M  0 part
├─sda2  8:2    0    16M  0 part
├─sda3  8:3    0 247.2G  0 part
└─sda4  8:4    0   625M  0 part
nvme0n1 259:0  0 931.5G  0 disk
├─nvme0n1p1 259:1  0     1G  0 part /boot/efi
├─nvme0n1p2 259:2  0     2G  0 part /boot
└─nvme0n1p3 259:3  0 928.5G  0 part
  └─ubuntu--vg-ubuntu--lv 253:0  0   100G  0 lvm  /

To get the name of the part where you want to extend

df -h /

Command to extend the disk

lvextend -l +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lv
resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv

Leave a Reply

Your email address will not be published. Required fields are marked *