Skip to content

Commit 5eb3ea3

Browse files
authored
Update and rename How-to-configure-lvm-raid-on-crypt.md to how-to-configure-lvm-raid-on-crypt.md
1 parent db7f694 commit 5eb3ea3

File tree

1 file changed

+42
-43
lines changed

1 file changed

+42
-43
lines changed

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

Lines changed: 42 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@ author: jofrance
55
ms.service: security
66
ms.topic: article
77
ms.author: jofrance
8-
ms.date: 03/18/2020
8+
ms.date: 03/17/2020
99

1010
ms.custom: seodec18
1111

1212
---
1313

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

16-
his document is a step by step process about how to perform LVM on crypt and Raid on crypt configurations.
17-
18-
## Environment
19-
20-
Linux Distributions
21-
ADE Single Pass
16+
This document is a step by step process about how to perform LVM on crypt and Raid on crypt configurations.
17+
18+
### Environment
19+
20+
- Linux Distributions
21+
- ADE Single Pass
2222
- ADE Dual Pass
2323

2424

@@ -29,29 +29,29 @@ ms.custom: seodec18
2929
- Configure LVM on top of encrypted devices (LVM-on-Crypt)
3030
- Configure RAID on top of encrypted devices (RAID-on-Crypt)
3131

32-
Once the underlying device(s) are encrypted then the LVM/RAID structures are created 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-
The volumes are created and added to /etc/fstab as any other normal LVM file system
32+
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.
3535

36-
![Check disks attached powershell](./media/disk-encryption/lvm-raid-on-crypt/000-lvm-raid-crypt-diagram.png)
36+
![Check disks attached PowerShell](./media/disk-encryption/lvm-raid-on-crypt/000-lvm-raid-crypt-diagram.png)
3737

38-
In a very similar way, the RAID device is created using the encrypted layer on the disks, a filesystem is created on top of the RAID device and added to /etc/fstab as a regular device.
38+
In a similar way, the RAID device is created on top of the encrypted layer on the disks. A filesystem is created on top of the RAID device and added to /etc/fstab as a regular device.
3939

4040
### Considerations
4141

4242
The recommended method to use is LVM-on-Crypt.
43-
RAID is considered when LVM can't be used due to specific application/environment limitations.
44-
You will be using the EncryptFormatAll option, please check all the information about this feature here https://docs.microsoft.com/en-us/azure/virtual-machines/linux/disk-encryption-linux#use-encryptformatall-feature-for-data-disks-on-linux-vms
45-
While this can be done when also encrypting the OS, we're just encrypting Data drives.
46-
This assumes that you already reviewed the 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/en-us/azure/virtual-machines/linux/disk-encryption-cli-quickstart
47-
The ADE dual pass version should no longer be used on new ADE encryptions since it is on deprecation path.
43+
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.
45+
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.
4848

4949
### Procedure
5050

51-
When using the "on crypt" configurations you will be following the process outlined below:
51+
When using the "on crypt" configurations, you'll be following the process outlined below:
5252

5353
>[!NOTE]
54-
>We're using variables throughout the document, please replace the values accordingly.
54+
>We're using variables throughout the document, replace the values accordingly.
5555
### General Steps
5656
####Deploy a VM
5757
>[!NOTE]
@@ -67,7 +67,7 @@ New-AzVm -ResourceGroupName ${RGNAME} `
6767
-Credential ${creds} `
6868
-Verbose
6969
```
70-
CLI
70+
CLI:
7171
```bash
7272
az vm create \
7373
-n ${VMNAME} \
@@ -91,7 +91,7 @@ $vm = Get-AzVM -Name ${VMNAME} -ResourceGroupName ${RGNAME}
9191
$vm = Add-AzVMDataDisk -VM $vm -Name $dataDiskName -CreateOption Attach -ManagedDiskId $dataDisk1.Id -Lun 0
9292
Update-AzVM -VM ${VM} -ResourceGroupName ${RGNAME}
9393
```
94-
CLI
94+
CLI:
9595
```bash
9696
az vm disk attach \
9797
-g ${RGNAME} \
@@ -107,42 +107,42 @@ Powershell:
107107
$VM = Get-AzVM -ResourceGroupName ${RGNAME} -Name ${VMNAME}
108108
$VM.StorageProfile.DataDisks | Select-Object Lun,Name,DiskSizeGB
109109
```
110-
![Check disks attached powershell](./media/disk-encryption/lvm-raid-on-crypt/001-lvm-raid-check-disks-powershell.png)
110+
![Check disks attached PowerShell](./media/disk-encryption/lvm-raid-on-crypt/001-lvm-raid-check-disks-powershell.png)
111111
CLI:
112112
```bash
113113
az vm show -g ${RGNAME} -n ${VMNAME} --query storageProfile.dataDisks -o table
114114
```
115-
![Check disks attached cli](./media/disk-encryption/lvm-raid-on-crypt/002-lvm-raid-check-disks-cli.png)
115+
![Check disks attached CLI](./media/disk-encryption/lvm-raid-on-crypt/002-lvm-raid-check-disks-cli.png)
116116
Portal:
117-
![Check disks attached cli](./media/disk-encryption/lvm-raid-on-crypt/003-lvm-raid-check-disks-portal.png)
117+
![Check disks attached CLI](./media/disk-encryption/lvm-raid-on-crypt/003-lvm-raid-check-disks-portal.png)
118118
OS:
119119
```bash
120120
lsblk
121121
```
122122
![Check disks attached portal](./media/disk-encryption/lvm-raid-on-crypt/004-lvm-raid-check-disks-os.png)
123123
#### Configure the disks to be encrypted
124-
This is done that the operating system level, the corresponding disks are configured for a traditional ADE encryption:
124+
This configuration is done that the operating system level, the corresponding disks are configured for a traditional ADE encryption:
125125

126126
Filesystems are created on top of the disks
127127
Temporary mount points are created to mount the filesystems
128128
The Filesystems are configured on /etc/fstab to be mounted at boot time
129129

130-
Check the device letter assigned to the new disks, on this example we're using 4 data disks
130+
Check the device letter assigned to the new disks, on this example we're using four data disks
131131

132132
```bash
133133
lsblk
134134
```
135135
![Check disks attached os](./media/disk-encryption/lvm-raid-on-crypt/004-lvm-raid-check-disks-os.png)
136136

137137
##### Create a filesystem on top of each disk.
138-
This iterates an ext4 filesystem creation on each disk defined on the "in" part of the "for" cycle.
138+
This command iterates an ext4 filesystem creation on each disk defined on the "in" part of the "for" cycle.
139139
```bash
140140
for disk in c d e f; do echo mkfs.ext4 -F /dev/sd${disk}; done |bash
141141
```
142142
![Check disks attached os](./media/disk-encryption/lvm-raid-on-crypt/005-lvm-raid-create-temp-fs.png)
143143
Find the UUID of the filesystems recently created, create a temporary folder to mount it, add the corresponding entries on /etc/fstab and mount all the filesystems.
144144

145-
This also iterates on each disk defined on the "in" part of the "for" cycle:
145+
This command also iterates on each disk defined on the "in" part of the "for" cycle:
146146
```bash
147147
for disk in c d e f; do diskuuid="$(blkid -s UUID -o value /dev/sd${disk})"; \
148148
mkdir /tempdata${disk}; \
@@ -187,7 +187,7 @@ az vm encryption enable \
187187
--encrypt-format-all \
188188
-o table
189189
```
190-
#### Verify the Encryption Status, proceed to the next step only when all the disks are encrypted.
190+
#### Verify the Encryption Status, continue to the next step only when all the disks are encrypted.
191191
PowerShell:
192192
```powershell
193193
Get-AzVmDiskEncryptionStatus -ResourceGroupName ${RGNAME} -VMName ${VMNAME}
@@ -197,19 +197,19 @@ CLI:
197197
```bash
198198
az vm encryption show -n ${VMNAME} -g ${RGNAME} -o table
199199
```
200-
![Check encryption cli](./media/disk-encryption/lvm-raid-on-crypt/009-lvm-raid-verify-encryption-status-cli.png)
200+
![Check encryption CLI](./media/disk-encryption/lvm-raid-on-crypt/009-lvm-raid-verify-encryption-status-cli.png)
201201
Portal:
202202
![Check encryption OS](./media/disk-encryption/lvm-raid-on-crypt/010-lvm-raid-verify-encryption-status-portal.png)
203203
OS Level:
204204
```bash
205205
lsblk
206206
```
207-
![Check encryption cli](./media/disk-encryption/lvm-raid-on-crypt/011-lvm-raid-verify-encryption-status-os.png)
207+
![Check encryption CLI](./media/disk-encryption/lvm-raid-on-crypt/011-lvm-raid-verify-encryption-status-os.png)
208208
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.
209209

210210
Do not modify any of these files.
211211

212-
This is going to be the file that will be taking care of activating these disks during the boot process so they can be later used by LVM or RAID.
212+
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.
213213

214214
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).
215215
#### Remove the temp folders and temp fstab entries
@@ -237,7 +237,7 @@ Now that the underlying disks are encrypted, you can proceed to create the LVM s
237237
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).
238238
### Configure LVM on top of the encrypted layers
239239
#### Create the Physical Volumes
240-
You will get a warning asking if it is OK to wipe out the filesystem signature, You may proceed by entering 'y' or simply use the echo "y" as shown:
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:
241241
```bash
242242
echo "y" | pvcreate /dev/mapper/c49ff535-1df9-45ad-9dad-f0846509f052
243243
echo "y" | pvcreate /dev/mapper/6712ad6f-65ce-487b-aa52-462f381611a1
@@ -299,11 +299,11 @@ lsblk -fs
299299
df -h
300300
```
301301
![check lvs](./media/disk-encryption/lvm-raid-on-crypt/018-lvm-raid-lsblk-after-lvm.png)
302-
On this variation of lsblk, we're listing the devices showing the dependencies on reverse order, this helps to identify the devices grouped by the logical volume instead of the original /dev/sd[disk] device names.
302+
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.
303303

304-
Important: please make sure the nofail option is added to the mount point options of the LVM volumes created on top of an ADE encrypted device. 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 LVM volumes and file systems will be automatically mounted until they are 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.
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.
305305

306-
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 of the amount of file systems and the sizes
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
307307
#### Reboot the VM and verify after reboot
308308
```bash
309309
shutdown -r now
@@ -313,7 +313,7 @@ lsblk
313313
df -h
314314
```
315315
### For RAID-on-Crypt:
316-
Now the underlying disks are encrypted you can proceed to create the RAID structures, same as LVM, instead of using the device name, use the /dev/mapper paths for each of the disks.
316+
Now the underlying disks are encrypted you can continue to create the RAID structures, same as LVM, instead of using the device name, use the /dev/mapper paths for each of the disks.
317317

318318
#### Configure RAID on top of the encrypted layer of the disks
319319
```bash
@@ -339,7 +339,7 @@ mdadm --detail /dev/md10
339339
```bash
340340
mkfs.ext4 /dev/md10
341341
```
342-
Create a new mountpoint for the filesystem, add the new file system to /etc/fstab and mount it
342+
Create a new mountpoint for the filesystem, add the new file system to /etc/fstab, and mount it
343343
```bash
344344
for device in md10; do diskuuid="$(blkid -s UUID -o value /dev/${device})"; \
345345
mkdir /raiddata; \
@@ -354,15 +354,15 @@ df -h
354354
```
355355
![mdadm status](./media/disk-encryption/lvm-raid-on-crypt/021-lvm-raid-lsblk-md-details.png)
356356

357-
Important: please make sure the nofail option is added to the mount point options of the RAID volumes created on top of an ADE encrypted device.
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.
358358

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 are 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.
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.
360360

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 of the amount of file systems and the sizes
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
362362
```bash
363363
shutdown -r now
364364
```
365-
And when you can login:
365+
And when you can log in:
366366
```bash
367367
lsblk
368368
df -h
@@ -371,4 +371,3 @@ df -h
371371

372372
- [Azure Disk Encryption troubleshooting](disk-encryption-troubleshooting.md)
373373

374-

0 commit comments

Comments
 (0)