Skip to content

Commit c025141

Browse files
authored
Update how-to-configure-lvm-raid-on-crypt.md
1 parent f3e8df2 commit c025141

File tree

1 file changed

+28
-25
lines changed

1 file changed

+28
-25
lines changed

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

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: How to Configure LVM and RAID on-crypt on a Linux VM
2+
title: How to configure LVM and RAID on-crypt on a Linux VM
33
description: This article provides instructions on configuring LVM and RAID on crypt on Linux VMs.
44
author: jofrance
55
ms.service: security
@@ -11,7 +11,7 @@ ms.custom: seodec18
1111

1212
---
1313

14-
# How to Configure LVM and RAID on-crypt on a Linux VM
14+
# How to configure LVM and RAID on-crypt
1515

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

@@ -22,7 +22,7 @@ This document is a step-by-step process about how to perform LVM on crypt and Ra
2222
- ADE Dual Pass
2323

2424

25-
### Scenarios
25+
## Scenarios
2626

2727
**This scenario is applicable to ADE dual-pass and single-pass extensions.**
2828

@@ -58,8 +58,8 @@ When using the "on crypt" configurations, you'll be following the process outlin
5858

5959
>[!NOTE]
6060
>We're using variables throughout the document, replace the values accordingly.
61-
### General Steps
62-
####Deploy a VM
61+
## General steps
62+
### Deploy a VM
6363
>[!NOTE]
6464
>While this is optional we recommend you to apply this on a newly deployed VM.
6565
@@ -85,7 +85,7 @@ az vm create \
8585
--size ${VMSIZE} \
8686
-o table
8787
```
88-
####Attach disks to the vm:
88+
### Attach disks to the vm:
8989
Repeat for $N number of new disks you want to attach to the VM
9090
PowerShell
9191
```powershell
@@ -107,7 +107,7 @@ az vm disk attach \
107107
--new \
108108
-o table
109109
```
110-
#### Verify the disks are attached to the VM:
110+
### Verify the disks are attached to the VM:
111111
PowerShell:
112112
```powershell
113113
$VM = Get-AzVM -ResourceGroupName ${RGNAME} -Name ${VMNAME}
@@ -126,7 +126,7 @@ OS:
126126
lsblk
127127
```
128128
![Check disks attached portal](./media/disk-encryption/lvm-raid-on-crypt/004-lvm-raid-check-disks-os.png)
129-
#### Configure the disks to be encrypted
129+
### Configure the disks to be encrypted
130130
This configuration is done that the operating system level, the corresponding disks are configured for a traditional ADE encryption:
131131

132132
Filesystems are created on top of the disks.
@@ -142,7 +142,7 @@ lsblk
142142
```
143143
![Check disks attached os](./media/disk-encryption/lvm-raid-on-crypt/004-lvm-raid-check-disks-os.png)
144144

145-
##### Create a filesystem on top of each disk.
145+
### Create a filesystem on top of each disk.
146146
This command iterates an ext4 filesystem creation on each disk defined on the "in" part of the "for" cycle.
147147
```bash
148148
for disk in c d e f; do echo mkfs.ext4 -F /dev/sd${disk}; done |bash
@@ -158,7 +158,7 @@ echo "UUID=${diskuuid} /tempdata${disk} ext4 defaults,nofail 0 0" >> /etc/fstab;
158158
mount -a; \
159159
done
160160
```
161-
##### Verify the disks are mounted properly:
161+
### Verify the disks are mounted properly:
162162
```bash
163163
lsblk
164164
```
@@ -168,7 +168,7 @@ And configured:
168168
cat /etc/fstab
169169
```
170170
![Check fstab](./media/disk-encryption/lvm-raid-on-crypt/007-lvm-raid-verify-temp-fstab.png)
171-
#### Encrypt the data disks:
171+
### Encrypt the data disks:
172172
PowerShell using KEK:
173173
```powershell
174174
$sequenceVersion = [Guid]::NewGuid()
@@ -195,7 +195,10 @@ az vm encryption enable \
195195
--encrypt-format-all \
196196
-o table
197197
```
198-
#### Verify the Encryption Status, continue to the next step only when all the disks are encrypted.
198+
### Verify the encryption status
199+
200+
Continue to the next step only when all the disks are encrypted.
201+
199202
PowerShell:
200203
```powershell
201204
Get-AzVmDiskEncryptionStatus -ResourceGroupName ${RGNAME} -VMName ${VMNAME}
@@ -221,7 +224,7 @@ Do not modify any of these files.
221224
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.
222225

223226
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).
224-
#### Remove the temp folders and temp fstab entries
227+
### Remove the temp folders and temp fstab entries
225228
You unmount the filesystems on the disks that will be used as part of LVM
226229
```bash
227230
for disk in c d e f; do umount /tempdata${disk}; done
@@ -230,7 +233,7 @@ And remove the /etc/fstab entries:
230233
```bash
231234
vi /etc/fstab
232235
```
233-
#### Verify that the disks are not mounted and that the entries on /etc/fstab were removed
236+
### Verify that the disks are not mounted and that the entries on /etc/fstab were removed
234237
```bash
235238
lsblk
236239
```
@@ -240,12 +243,12 @@ And configured:
240243
cat /etc/fstab
241244
```
242245
![Check temp fstab entries are removed](./media/disk-encryption/lvm-raid-on-crypt/013-lvm-raid-verify-fstab-temp-removed.png)
243-
### For LVM-on-Crypt:
246+
## For LVM-on-crypt
244247
Now that the underlying disks are encrypted, you can proceed to create the LVM structures.
245248

246249
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).
247250
### Configure LVM on top of the encrypted layers
248-
#### Create the Physical Volumes
251+
#### Create the physical volumes
249252
You'll get a warning asking if it's OK to wipe out the filesystem signature.
250253

251254
You may continue by entering 'y' or use the echo "y" as shown:
@@ -258,37 +261,37 @@ echo "y" | pvcreate /dev/mapper/4159c60a-a546-455b-985f-92865d51158c
258261
![pvcreate](./media/disk-encryption/lvm-raid-on-crypt/014-lvm-raid-pvcreate.png)
259262
>[!NOTE]
260263
>The /dev/mapper/device names here need to be replaced for your actual values based on the output of lsblk.
261-
#### Verify the Physical Volumes information
264+
#### Verify the physical volumes information
262265
```bash
263266
pvs
264267
```
265268
![check physical volumes 1](./media/disk-encryption/lvm-raid-on-crypt/015-lvm-raid-pvs.png)
266-
#### Create the Volume Group
269+
#### Create the volume group
267270
Create the VG using the same devices already initialized
268271
```bash
269272
vgcreate vgdata /dev/mapper/
270273
```
271-
### Check the VG information
274+
### Check the volume group information
272275
```bash
273276
vgdisplay -v vgdata
274277
```
275278
```bash
276279
pvs
277280
```
278281
![check physical volumes 2](./media/disk-encryption/lvm-raid-on-crypt/016-lvm-raid-pvs-on-vg.png)
279-
#### Create Logical Volumes
282+
#### Create logical volumes
280283
```bash
281284
lvcreate -L 10G -n lvdata1 vgdata
282285
lvcreate -L 7G -n lvdata2 vgdata
283286
```
284-
#### Check the Logical Volumes created
287+
#### Check the logical volumes created
285288
```bash
286289
lvdisplay
287290
lvdisplay vgdata/lvdata1
288291
lvdisplay vgdata/lvdata2
289292
```
290293
![check lvs](./media/disk-encryption/lvm-raid-on-crypt/017-lvm-raid-lvs.png)
291-
#### Create filesystems on top of the LV structures
294+
#### Create filesystems on top of the logical volume(s) structure(s)
292295
```bash
293296
echo "yes" | mkfs.ext4 /dev/vgdata/lvdata1
294297
echo "yes" | mkfs.ext4 /dev/vgdata/lvdata2
@@ -329,7 +332,7 @@ shutdown -r now
329332
lsblk
330333
df -h
331334
```
332-
### For RAID-on-Crypt:
335+
## For RAID-on-Crypt
333336
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.
334337

335338
#### Configure RAID on top of the encrypted layer of the disks
@@ -345,7 +348,7 @@ mdadm --create /dev/md10 \
345348
![mdadm create](./media/disk-encryption/lvm-raid-on-crypt/019-lvm-raid-md-creation.png)
346349
>[!NOTE]
347350
>The /dev/mapper/device names here need to be replaced for your actual values based on the output of lsblk.
348-
#### Check/monitor the raid creation:
351+
#### Check/monitor the RAID creation:
349352
```bash
350353
watch -n1 cat /proc/mdstat
351354
mdadm --examine /dev/mapper/[]
@@ -388,7 +391,7 @@ And when you can log in:
388391
lsblk
389392
df -h
390393
```
391-
## Next Steps
394+
## Next steps
392395

393396
- [Azure Disk Encryption troubleshooting](disk-encryption-troubleshooting.md)
394397

0 commit comments

Comments
 (0)