Linux Logical Volumes

Resize logical volume

# Check disks
lsblk /dev/sda
lsblk /dev/sdb
lsblk /dev/nvme0n1

# Increase the Physical Volume (pv) to max size
pvresize /dev/sda3

# Expand the Logical Volume (LV) to max size to match
lvresize -l +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lv

# Expand the filesystem itself
resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv

Add a second disk to a lvm

# display physical volumes (pv)
pvs
pvdisplay

# display lvm volume groups (vg)
vgs
vgdisplay

# display lvm logical volume (lv)
lvs
lvdisplay

# find out info on all disks
fdisk -l | grep '^Disk /dev/'
lvmdiskscan

# create the physical volume (pv) and verify
# this is if the new disk is named /dev/sdb
pvcreate /dev/sdb
lvmdiskscan -l

# Add new pv named /dev/sdb to an existing lv

# add /dev/sdb to volume group
vgextend ubuntu-vg /dev/sdb

# extend mapped drive to full size
lvm lvextend -l +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lv

# resize to 
resize2fs -p /dev/mapper/ubuntu--vg-ubuntu--lv

# verify
df -H

Fdisk basics

# list partisions
fdisk -l

# open /dev/sdb for editing
# once fdisk is running 'm' is for help
fdisk /dev/sdb

References