Table of Contents

Creating an encrypted LVM mirror setup

LVM

Creating the physical volumes (PVs)

Creating the volume group (VG) and logical volume (LV)

Encryption

Creating and opening the encrypted container

Filesystem

Creating the filesystem

e.g.

Mounting the filesystem

or an fstab entry:

Note: At this point, there are now several abstraction levels:

Description Path
the physical devices /dev/sda
/dev/sdb
the volume group (no path in file system)
the logical volume /dev/mapper/webster-websterlv
the unlocked cryptsetup container /dev/mapper/webstercrypt
the file system, once mounted /mnt/webster

Integration

To mount the volume on the next boot, you'll have to follow these steps:

  1. cryptsetup luksOpen /dev/mapper/webster-websterlv webstercrypt
  2. mount /dev/mapper/webstercrypt /mnt/webster

One way to semi-automatically mount the encrypted volume after each boot is described in this article. In this scenario, you can issue a single command after booting, enter the password and systemd will take care of the unlocking, mounting and starting the services depending on that data.

Removing a missing mirror

  1. vgreduce –removemissing –mirrorsonly –force megacherry

"Device /dev/mapper/x does not exist or access denied when opening"

  1. There is no device node in /dev/mapper. Re-activate the volume group:
    vgchange -ay x