Skip to content

LVM

Creating LVM
wipefs -a /dev/sdc /dev/sdd

pvcreate /dev/sdc /dev/sdd #(1)!

pvs #(2)!

vgcreate <name_of_volume_group> /dev/sdc /dev/sdd #(3)!

vgs #(4)!

lvcreate -T -l 100%FREE --poolmetadatasize 16G <name_of_volume_group>/<name_of_thin_pool> #(5)!

lvs -a #(6)!
  1. create pvs
  2. check if the physical volumes are successfully created
  3. create vg
  4. check if the volume group got created successfully
  5. create a thin pool LV (this might show a warning regarding the maximum size, which is fine)
  6. verify whether everything worked correctly

Removing LVM (e.g. before OS reinstall)

If the installer refuses to proceed because it detects existing LVM on the disks, boot from a live ISO and run:

# 1. Deactivate all logical volumes
sudo vgchange -an

# 2. Remove all LV, VG, PV
sudo lvremove -f $(sudo lvs --noheadings -o lv_path)
sudo vgremove -f $(sudo vgs --noheadings -o vg_name)
sudo pvremove -f $(sudo pvs --noheadings -o pv_name)

# 3. Wipe leftover metadata from disks (substitute your disks)
sudo wipefs -a /dev/sdX

!!! warning Before wipefs, run lsblk to make sure you don't wipe the live USB. After this, restart the installer.