Skip to content

Commit fc145e7

Browse files
authored
Update troubleshoot-non-boot-scenarios-after-enabling-ade-in-the-os-disk-on-linux-vms.md
1 parent 030f715 commit fc145e7

1 file changed

Lines changed: 19 additions & 17 deletions

File tree

support/azure/virtual-machines/linux/troubleshoot-non-boot-scenarios-after-enabling-ade-in-the-os-disk-on-linux-vms.md

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -38,61 +38,61 @@ If the OS disk is using LVM and you see a message like this:
3838
dracut:/#
3939
```
4040

41-
chances are that the required modules were not added to the initial ram disk image, then try to:
41+
Chances are that the required modules were not added to the initial ram disk image, then try to:
4242

4343
1. [Restore from backup](/azure/backup/restore-azure-encrypted-virtual-machines) and attempt the encryption again.
4444
2. If a restore is not feasible then use either the Azure CLI extension [az vm repair](/azure/virtual-machines/linux/unlock-encrypted-linux-disk-offline-repair#method1) or the [manual method](/azure/virtual-machines/linux/unlock-encrypted-linux-disk-offline-repair#method2) to create a rescue VM, attach and unlock the OS disk of the failed Linux machine to that rescue VM
45-
* Once you are in [chroot](/azure/virtual-machines/linux/chroot-environment-linux), execute the following commands. Replace the kernel and extension version accordingly
45+
3. Once you are in [chroot](/azure/virtual-machines/linux/chroot-environment-linux), execute the following commands. Replace the kernel and extension version accordingly
4646

4747
### [RHEL 8,9](#tab/redhat)
48-
1. Copy the following files from the extension configuration directory to the initramfs scripts directory:
48+
a. Copy the following files from the extension configuration directory to the initramfs scripts directory:
4949

5050
```bash
5151
sudo cp /var/lib/waagent/Microsoft.Azure.Security.AzureDiskEncryptionForLinux-X.X.X.X/main/oscrypto/91adeOnline /usr/lib/dracut/modules.d/
5252
```
5353

54-
2. Regenerate the initramfs image
54+
b. Regenerate the initramfs image
5555

5656
```bash
5757
sudo dracut -f -v /boot/initramfs-X.XX.X-XXX.XX.X.x86_64.img <KERNEL VERSION>
5858
```
5959

60-
3. Test the modified kernel by booting the VM from it, if everything works fine, regenerate the rest of the `initramfs` files if there are more.
60+
c. Test the modified kernel by booting the VM from it, if everything works fine, regenerate the rest of the `initramfs` files if there are more.
6161

62-
### [Ubuntu 20](#tab/ubuntu)
62+
### [Ubuntu](#tab/ubuntu)
6363

6464
> [!NOTE]
6565
> This procedure could apply to non-boot scenarios after upgrading from Ubuntu 18 to Ubuntu 20. Review the scenario to confirm if it applies.
6666

67-
1. Copy the following files from the extension configuration directory to the initramfs scripts directory:
67+
a. Copy the following files from the extension configuration directory to the initramfs scripts directory:
6868

6969
```bash
7070
sudo cd /var/lib/waagent/Microsoft.Azure.Security.AzureDiskEncryptionForLinux-X.x.x.xx/main/oscrypto/ubuntu_2004/encryptscripts
7171
sudo cp crypt-ade-boot /usr/share/initramfs-tools/scripts/init-premount/
7272
sudo cp crypt-ade-hook /usr/share/initramfs-tools/hooks/
7373
```
7474

75-
2. Once the file `crypt-ade-boot` is copied, replace `ROOTPARTUUID` variable in the line below with the OS partition path from `/dev/disk/by-partuuid/`.
75+
b. Once the file `crypt-ade-boot` is copied, replace `ROOTPARTUUID` variable in the line below with the OS partition path from `/dev/disk/by-partuuid/`.
7676

7777
```bash
7878
Example:
7979
sudo ls -l /dev/disk/by-partuuid/ | grep -w <partition containing the OS>
8080
lrwxrwxrwx 1 root root 10 May 18 17:33 ef61c3c3-50bb-40f0-8124-4cbe8cb2a380 -> ../../sda1
8181
```
8282

83-
3. Replace the `ROOTPARTUUID` variable below with the one obtained in the step above. Remember to replace the UUID according to your environment
83+
c. Replace the `ROOTPARTUUID` variable below with the one obtained in the step above. Remember to replace the UUID according to your environment
8484

8585
```bash
8686
cryptsetup luksOpen /dev/disk/by-partuuid/ROOTPARTUUID osencrypt --header /boot/luks/osluksheader -d /mnt/azure_bek_disk/LinuxPassPhraseFileName
8787
```
8888

89-
4. Regenerate the initramfs image
89+
d. Regenerate the initramfs image
9090

9191
```bash
9292
update-initramfs -u -k all
9393
```
9494

95-
5. An output similar to the one below is expected:
95+
e. An output similar to the one below is expected:
9696

9797
```output
9898
update-initramfs: Generating /boot/initrd.img-5.15.0-1038-azure
@@ -104,8 +104,8 @@ chances are that the required modules were not added to the initial ram disk ima
104104
+ exit 0
105105
```
106106

107-
3. Swap the failed OS disk with the one containing the fix.
108-
4. Review the extension and console logs to ensure the encryption process has finished successfully. Example:
107+
4. Swap the failed OS disk with the one containing the fix.
108+
5. Review the extension and console logs to ensure the encryption process has finished successfully. Example:
109109
```output
110110
[AzureDiskEncryption] 3670: [Info] ======= MACHINE STATE: completed =======
111111
[AzureDiskEncryption] 3670: [Info] Encryption succeeded for all volumes
@@ -117,9 +117,9 @@ chances are that the required modules were not added to the initial ram disk ima
117117
[AzureDiskEncryption] 3670: [Info] Executing: pvs
118118
[AzureDiskEncryption] 3670: [Info] Found OS block device: /dev/mapper/osencrypt
119119
```
120-
5. Review the `initramfs` files to ensure that the Azure Disk Encryption modules were propely added
120+
6. Review the `initramfs` files to ensure that the Azure Disk Encryption modules were propely added
121121

122-
### [RHEL 8,9](#tab/redhat)
122+
**RHEL 8,9:**
123123
A similar output to the one below is expected. Replace the `initramfs` file name accordingly.
124124

125125
```output
@@ -129,7 +129,7 @@ chances are that the required modules were not added to the initial ram disk ima
129129
-rwxr--r-- 1 root root 681 Jan 15 2024 usr/sbin/crypt-run-generator-ade
130130
```
131131

132-
### [Ubuntu 20](#tab/ubuntu)
132+
**Ubuntu:**
133133
```output
134134
lsinitramfs /boot/initrd.img-5.15.0-1082-azure | egrep -i ade
135135
boot/luks/osluksheader
@@ -181,7 +181,7 @@ Exception: Encryption failed for name:korn-fromme type:lvm fstype:ext4 mountpoin
181181
## Not enough space in the boot partition (Ubuntu)
182182
183183
> [!NOTE]
184-
> [Ubuntu 24](https://azuremarketplace.microsoft.com/marketplace/apps/canonical.ubuntu-24_04-lts?tab=Overview) images now come with a separate `/boot` partition with 1GB size.
184+
> [Ubuntu 24](https://azuremarketplace.microsoft.com/marketplace/apps/canonical.ubuntu-24_04-lts?tab=Overview) and higher images now come with a separate `/boot` partition with at least 1GB size.
185185
186186
ADE needs a separate partition for `/boot`, for that reason during the extension deployment it creates `/boot` as a separate partition and restore the original files back. At the end of the process a new initial ram disk file is created, if there is not enough space, this step is going to fail. This scenario is particularly complex since there are many variants and as for now [resizing the OS disk](/azure/virtual-machines/linux/how-to-resize-encrypted-lvm#scenarios) is not supported when the OS disk is using ADE.
187187
At the time of writing, only Ubuntu images may fall under this process of boot split.
@@ -212,6 +212,7 @@ In order to identify the cause for packages not being installed review the exten
212212
2. Then, ensure all the packages were successfully installed. Visit [Package management](/azure/virtual-machines/linux/disk-encryption-isolated-network#package-management) for a full list of the required packages based on the Linux distro.
213213
3. If there are errors related to package installation, identify which package failed and why it failed.
214214
4. Ensure the VM has access to the package repositories. Go to [Azure Disk Encryption on an isolated network](/azure/virtual-machines/linux/disk-encryption-isolated-network) in case the VM is under special network requirements.
215+
5. For more information about troubleshooting repository issues see [Troubleshoot common issues in the yum and dnf package management tools for Linux](/azure/virtual-machines/linux/yum-dnf-common-issues?tabs=rhel7%2Crhel) and [Troubleshoot common issues with APT on Ubuntu](/azure/virtual-machines/linux/apt-common-issues-in-ubuntu)
215216
216217
## Missing parameters in the GRUB configuration
217218
@@ -220,6 +221,7 @@ During the encryption process the extension will add a couple of parameters to t
220221
`rd.luks.ade.partuuid` and `rd.luks.ade.bootuuid`
221222
222223
These parameters must be present and properly set to the `UUIDs` accordingly. If this is not case, [offline troubleshooting](/azure/virtual-machines/linux/unlock-encrypted-linux-disk-offline-repair) will be required in order to add the parameter manually. The UUIDs can be obtained in a `chroot` environment by running the command `blkid`.
224+
For more information about regenerating the grub file see [Reinstall GRUB and regenerate the GRUB configuration file manually](/azure/virtual-machines/linux/troubleshoot-vm-boot-error#reinstall-grub-regenerate-grub-configuration-file)
223225
224226
## Missing or corrupted osluksheader file
225227

0 commit comments

Comments
 (0)