LVM triple mirror

Page content

HowTo create a tripple mirror (3 disks) with LVM2 in linux.

Recipe:

Create new partitions

pvcreate /dev/sda3

fdisk /dev/nvme0n1 # create new partition "p1" and set type "8e"
fdisk /dev/nvme1n1 # see above
fdisk /dev/nvme2n1 # see above

Create physical volumes

pvcreate /dev/nvme[012]n1p1 

Create volume group

vgcreate vg1 /dev/nvme[012]n1p1 /dev/sda3

HINT: We are using /dev/sda3 as storage for the log mirror.

Create volume group

lvcreate -m2 -l100%FREE --type mirror vg1 /dev/nvme[012]n1p1 /dev/sda3 --mirrorlog disk

Show device and mirroring state

lvs -ao +devices