1

I have successfully increased the space on AWS EBS volume.

# lsblk
NAME         MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
nvme0n1      259:0    0   64G  0 disk 
├─nvme0n1p1  259:1    0 63.9G  0 part /
├─nvme0n1p14 259:2    0    3M  0 part 
└─nvme0n1p15 259:3    0  124M  0 part /boot/efi
nvme1n1      259:4    0    2T  0 disk 
└─main-var   254:0    0  996G  0 lvm  /var

How can I add the 1T on nvme1n1 to main-var lvm?

1 Answer 1

4

Show the current situation:

lsblk
pvs
df -h

Tell LVM to extend to the full size of the physical device:

pvresize /dev/nvme1n1

Show again to see changes:

pvs

Now you see PFree has increased:

vgs

VFree should have also increased. Extend your volume so it uses that space:

lvextend -L +1T /dev/vgname/lvname

Show the new volume size:

lvs

Now you have to resize your filesystem with either resize2fs, xfs_growfs, etc utility.

3
  • Thanks! pvs not showing me new space dazzled me.
    – b4d
    Dec 13, 2021 at 21:12
  • I have found in the past that with some AMIs if you reboot the server the extra disk space is added automatically. I don't recall which distro this was with.
    – Tim
    Dec 14, 2021 at 0:55
  • unlike debian where it never detects the new size until you reboot
    – exeral
    Dec 14, 2021 at 16:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.