pvcreate /dev/sdbpvcreate /dev/sdavgcreate webster /dev/sda /dev/sdblvcreate -l 99%FREE -m1 -n websterlv websterlvcreate --type raid5 -i 2 -l 99%FREE yoko -n yokocryptsetup luksFormat /dev/mapper/webster-websterlvcryptsetup luksOpen /dev/mapper/webster-websterlv webstercrypte.g.
mkfs.xfs /dev/mapper/webstercryptmkfs.ext4 /dev/mapper/webstercryptmount /dev/mapper/webstercrypt /mnt/websteror an fstab entry:
/dev/mapper/webstercrypt /mnt/webster xfs defaults,rw,noauto 0 0Note: 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 |
To mount the volume on the next boot, you'll have to follow these steps:
cryptsetup luksOpen /dev/mapper/webster-websterlv webstercryptmount /dev/mapper/webstercrypt /mnt/websterOne 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.
vgreduce –removemissing –mirrorsonly –force megacherryvgchange -ay x