Skip to content

Commit 14b38c7

Browse files
authored
Update how-to-configure-lvm-raid-on-crypt.md
1 parent 5eb3ea3 commit 14b38c7

File tree

1 file changed

+48
-27
lines changed

1 file changed

+48
-27
lines changed

articles/virtual-machines/linux/how-to-configure-lvm-raid-on-crypt.md

Lines changed: 48 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ ms.custom: seodec18
1313

1414
# How to Configure LVM and RAID on-crypt on a Linux VM
1515

16-
This document is a step by step process about how to perform LVM on crypt and Raid on crypt configurations.
16+
This document is a step-by-step process about how to perform LVM on crypt and Raid on crypt configurations.
1717

1818
### Environment
1919

@@ -30,8 +30,9 @@ This document is a step by step process about how to perform LVM on crypt and Ra
3030
- Configure RAID on top of encrypted devices (RAID-on-Crypt)
3131

3232
Once the underlying device(s) are encrypted, then you can create the LVM or RAID structures on top of that encrypted layer.
33-
The Physical Volumes (PV) are created on top and those are used to create the corresponding volume group.
34-
You need to create the volumes and add the required entries on /etc/fstab as any other normal LVM file system.
33+
The Physical Volumes (PV) are created on top of the encrypted Layer.
34+
The Physical Volumes are used to create the volume group.
35+
You create the volumes and add the required entries on /etc/fstab.
3536

3637
![Check disks attached PowerShell](./media/disk-encryption/lvm-raid-on-crypt/000-lvm-raid-crypt-diagram.png)
3738

@@ -40,11 +41,16 @@ In a similar way, the RAID device is created on top of the encrypted layer on th
4041
### Considerations
4142

4243
The recommended method to use is LVM-on-Crypt.
44+
4345
RAID is considered when LVM can't be used because of specific application/environment limitations.
44-
You'll use the EncryptFormatAll option, check all the information about this feature here https://docs.microsoft.com/azure/virtual-machines/linux/disk-encryption-linux#use-encryptformatall-feature-for-data-disks-on-linux-vms.
46+
47+
You'll use the EncryptFormatAll option, information about this feature is located here: https://docs.microsoft.com/azure/virtual-machines/linux/disk-encryption-linux#use-encryptformatall-feature-for-data-disks-on-linux-vms.
48+
4549
While this method can be done when also encrypting the OS, we're just encrypting Data drives.
46-
This procedure assumes you already reviewed and comply with the pre-requisites mentioned here: https://docs.microsoft.com/en-us/azure/virtual-machines/linux/disk-encryption-linux and here https://docs.microsoft.com/azure/virtual-machines/linux/disk-encryption-cli-quickstart.
47-
The ADE dual pass version should no longer be used on new ADE encryptions,it is on deprecation path.
50+
51+
This procedure assumes you already reviewed the pre-requisites mentioned here: https://docs.microsoft.com/en-us/azure/virtual-machines/linux/disk-encryption-linux and here https://docs.microsoft.com/azure/virtual-machines/linux/disk-encryption-cli-quickstart.
52+
53+
The ADE dual pass version is on deprecation path and should no longer be use on new ADE encryptions.
4854

4955
### Procedure
5056

@@ -102,7 +108,7 @@ az vm disk attach \
102108
-o table
103109
```
104110
#### Verify the disks are attached to the VM:
105-
Powershell:
111+
PowerShell:
106112
```powershell
107113
$VM = Get-AzVM -ResourceGroupName ${RGNAME} -Name ${VMNAME}
108114
$VM.StorageProfile.DataDisks | Select-Object Lun,Name,DiskSizeGB
@@ -123,9 +129,11 @@ lsblk
123129
#### Configure the disks to be encrypted
124130
This configuration is done that the operating system level, the corresponding disks are configured for a traditional ADE encryption:
125131

126-
Filesystems are created on top of the disks
127-
Temporary mount points are created to mount the filesystems
128-
The Filesystems are configured on /etc/fstab to be mounted at boot time
132+
Filesystems are created on top of the disks.
133+
134+
Temporary mount points are created to mount the filesystems.
135+
136+
The Filesystems are configured on /etc/fstab to be mounted at boot time.
129137

130138
Check the device letter assigned to the new disks, on this example we're using four data disks
131139

@@ -205,15 +213,16 @@ OS Level:
205213
lsblk
206214
```
207215
![Check encryption CLI](./media/disk-encryption/lvm-raid-on-crypt/011-lvm-raid-verify-encryption-status-os.png)
208-
You can notice the file systems were added to /var/lib/azure_disk_encryption_config/azure_crypt_mount (in case of an old encryption) or added to /etc/crypttab file in case or a newer encryption.
216+
217+
The extension will add the filesystems to "/var/lib/azure_disk_encryption_config/azure_crypt_mount" (an old encryption) or added to "/etc/crypttab" (new encryptions).
209218

210219
Do not modify any of these files.
211220

212221
This file is going to be taking care of activating these disks during the boot process so they can be later used by LVM or RAID.
213222

214-
Do not worry about the mount points on this file, as ADE will lose the ability to get the disks mounted as a normal file system after we do a pvcreate or mdadm --create on top of those encrypted devices (which will get rid of the file system format we used during the preparation process).
223+
Do not worry about the mount points on this file, as ADE will lose the ability to get the disks mounted as a normal file system after we do create a physical volume or a raid device on top of those encrypted devices(which will get rid of the file system format we used during the preparation process).
215224
#### Remove the temp folders and temp fstab entries
216-
You need to unmount the filesystems on the disks that will be used as part of LVM
225+
You unmount the filesystems on the disks that will be used as part of LVM
217226
```bash
218227
for disk in c d e f; do umount /tempdata${disk}; done
219228
```
@@ -234,10 +243,12 @@ cat /etc/fstab
234243
### For LVM-on-Crypt:
235244
Now that the underlying disks are encrypted, you can proceed to create the LVM structures.
236245

237-
Instead of using the device name, use the /dev/mapper paths for each of the disks to perform a pvcreate (on the crypt layer on top of the disk not on the disk itself).
246+
Instead of using the device name, use the /dev/mapper paths for each of the disks to create a physical volume (on the crypt layer on top of the disk not on the disk itself).
238247
### Configure LVM on top of the encrypted layers
239248
#### Create the Physical Volumes
240-
You'll get a warning asking if it is OK to wipe out the filesystem signature. You may continue by entering 'y' or use the echo "y" as shown:
249+
You'll get a warning asking if it's OK to wipe out the filesystem signature.
250+
251+
You may continue by entering 'y' or use the echo "y" as shown:
241252
```bash
242253
echo "y" | pvcreate /dev/mapper/c49ff535-1df9-45ad-9dad-f0846509f052
243254
echo "y" | pvcreate /dev/mapper/6712ad6f-65ce-487b-aa52-462f381611a1
@@ -247,11 +258,11 @@ echo "y" | pvcreate /dev/mapper/4159c60a-a546-455b-985f-92865d51158c
247258
![pvcreate](./media/disk-encryption/lvm-raid-on-crypt/014-lvm-raid-pvcreate.png)
248259
>[!NOTE]
249260
>The /dev/mapper/device names here need to be replaced for your actual values based on the output of lsblk.
250-
#### Verify the PVs information
261+
#### Verify the Physical Volumes information
251262
```bash
252263
pvs
253264
```
254-
![check pvs 1](./media/disk-encryption/lvm-raid-on-crypt/015-lvm-raid-pvs.png)
265+
![check physical volumes 1](./media/disk-encryption/lvm-raid-on-crypt/015-lvm-raid-pvs.png)
255266
#### Create the Volume Group
256267
Create the VG using the same devices already initialized
257268
```bash
@@ -264,13 +275,13 @@ vgdisplay -v vgdata
264275
```bash
265276
pvs
266277
```
267-
![check pvs 2](./media/disk-encryption/lvm-raid-on-crypt/016-lvm-raid-pvs-on-vg.png)
278+
![check physical volumes 2](./media/disk-encryption/lvm-raid-on-crypt/016-lvm-raid-pvs-on-vg.png)
268279
#### Create Logical Volumes
269280
```bash
270281
lvcreate -L 10G -n lvdata1 vgdata
271282
lvcreate -L 7G -n lvdata2 vgdata
272283
```
273-
#### Check the LVs created
284+
#### Check the Logical Volumes created
274285
```bash
275286
lvdisplay
276287
lvdisplay vgdata/lvdata1
@@ -298,12 +309,18 @@ mount -a
298309
lsblk -fs
299310
df -h
300311
```
301-
![check lvs](./media/disk-encryption/lvm-raid-on-crypt/018-lvm-raid-lsblk-after-lvm.png)
312+
![check logical volumes](./media/disk-encryption/lvm-raid-on-crypt/018-lvm-raid-lsblk-after-lvm.png)
302313
On this variation of lsblk, we're listing the devices showing the dependencies on reverse order, this option helps to identify the devices grouped by the logical volume instead of the original /dev/sd[disk] device names.
303314

304-
Important: Make sure the nofail option is added to the mount point options of the LVM volumes created on top of an ADE encrypted device. Is important to avoid the OS from getting stuck during the boot process (or in maintenance mode). The encrypted disk will be unlocked at the end of the boot process and the LVM volumes and file systems will be automatically mounted until they're unlocked by ADE, if the nofail option is not used, the OS will never get into the stage where ADE is started, and the data disk(s) are unlocked and mounted.
315+
Important: Make sure the "nofail" option is added to the mount point options of the LVM volumes created on top of an ADE encrypted device. Is important to avoid the OS from getting stuck during the boot process (or in maintenance mode).
305316

306-
You can test rebooting the VM and validating the file systems are also automatically getting mounted after boot time. Take under consideration that this process may take several minutes depending on the number of file systems and the sizes
317+
The encrypted disk are unlock at the end of the boot process, the LVM volumes and file systems will be automatically mounted.
318+
319+
If the nofail option isn't used, the OS will never get into the stage where ADE is started, and the data disk(s) are unlocked and mounted.
320+
321+
You can test rebooting the VM and validating the file systems are also automatically getting mounted after boot time.
322+
323+
Take under consideration that this process may take several minutes depending on the number of file systems and the sizes
307324
#### Reboot the VM and verify after reboot
308325
```bash
309326
shutdown -r now
@@ -334,7 +351,7 @@ watch -n1 cat /proc/mdstat
334351
mdadm --examine /dev/mapper/[]
335352
mdadm --detail /dev/md10
336353
```
337-
![mdadm status](./media/disk-encryption/lvm-raid-on-crypt/020-lvm-raid-md-details.png)
354+
![check mdadm](./media/disk-encryption/lvm-raid-on-crypt/020-lvm-raid-md-details.png)
338355
#### Create a filesystem on top of the new Raid device:
339356
```bash
340357
mkfs.ext4 /dev/md10
@@ -352,13 +369,17 @@ Verify that the new filesystems are mounted
352369
lsblk -fs
353370
df -h
354371
```
355-
![mdadm status](./media/disk-encryption/lvm-raid-on-crypt/021-lvm-raid-lsblk-md-details.png)
372+
![check mdadm](./media/disk-encryption/lvm-raid-on-crypt/021-lvm-raid-lsblk-md-details.png)
373+
374+
Important: Make sure the "nofail" option is added to the mount point options of the RAID volumes created on top of an ADE encrypted device.
356375

357-
Important: Make sure the nofail option is added to the mount point options of the RAID volumes created on top of an ADE encrypted device.
376+
Is very important to avoid the OS from getting stuck during the boot process (or in maintenance mode).
358377

359-
This is very important to avoid the OS from getting stuck during the boot process (or in maintenance mode). The encrypted disk will be unlocked at the end of the boot process and the RAID volumes and file systems will be automatically mounted until they're unlocked by ADE, if the nofail option is not used, the OS will never get into the stage where ADE is started, and the data disks are unlocked and mounted.
378+
The encrypted disk will be unlock at the end of the boot process and the RAID volumes and file systems will be automatically mounted until they're unlocked by ADE, if the nofail option is not used.
360379

361-
You can test rebooting the VM and validating the file systems are also automatically getting mounted after boot time. Please take under consideration that this process may take several minutes depending on the amount of file systems and the sizes
380+
The OS will never get into the stage where ADE is started, and the data disks are unlocked and mounted.
381+
382+
You can test rebooting the VM and validating the file systems are also automatically getting mounted after boot time. Take under consideration that this process may take several minutes depending on the number of file systems and the sizes
362383
```bash
363384
shutdown -r now
364385
```

0 commit comments

Comments
 (0)