Score:0

Resize AWS LVM volume

cn flag
b4d

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?

Score:2
lk flag

show the current situation

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 use 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

cn flag
b4d
Thanks! pvs not showing me new space dazzled me.
Tim avatar
gp flag
Tim
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.
exeral avatar
lk flag
unlike debian where it never detects the new size until you reboot
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.