Skip to content

Commit 6d56493

Browse files
authored
Merge pull request #8305 from MicrosoftDocs/main
Auto push to live 2025-02-25 10:00:02
2 parents e0d2c5b + 00f0c59 commit 6d56493

1 file changed

Lines changed: 55 additions & 47 deletions

File tree

support/azure/virtual-machines/linux/chroot-environment-linux.md

Lines changed: 55 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,21 @@ ms.author: genli
2121

2222
[!INCLUDE [CentOS End Of Life](../../../includes/centos-end-of-life-note.md)]
2323

24-
This article describes how to troubleshoot the chroot environment in the rescue virtual machine (VM) in Linux.
24+
This article describes how to troubleshoot the chroot environment on a rescue virtual machine (VM) in Linux.
2525

26-
## Ubuntu 16.x && Ubuntu 18.x && Ubuntu 20.04
26+
## Ubuntu
2727

2828
1. Stop or deallocate the affected VM.
29-
1. Create a rescue VM of the same generation, same OS version, in same resource group and location using managed disk.
30-
1. Use the Azure portal to take a snapshot of the affected virtual machine's OS disk.
29+
1. Create a rescue VM of the same generation and the same OS version in same resource group and location by using a managed disk.
30+
1. Use the Azure portal to take a snapshot of the affected VM's OS disk.
3131
1. Create a disk out of the snapshot of the OS disk, and attach it to the rescue VM.
32-
1. Once the disk has been created, troubleshoot the chroot environment in the rescue VM.
32+
1. After the disk is created, troubleshoot the chroot environment on the rescue VM.
3333

3434
1. Access your VM as the root user by using the following command:
3535

3636
`sudo su -`
3737

38-
1. Find the disk using `dmesg` (the method you use to discover your new disk may vary). The following example uses `dmesg` to filter on Small Computer Systems Interface (SCSI) disks:
38+
1. Find the disk. The method that you use to discover your new disk may vary. We recommend that you use the `dmesg` command. The following example uses `dmesg` to filter on Small Computer Systems Interface (SCSI) disks:
3939

4040
`dmesg | grep SCSI`
4141

@@ -54,15 +54,21 @@ This article describes how to troubleshoot the chroot environment in the rescue
5454
```bash
5555
mkdir /rescue
5656
mount /dev/sdc1 /rescue
57+
mount /dev/sdc16 /rescue/boot
5758
mount /dev/sdc15 /rescue/boot/efi
5859
60+
5961
mount -t proc /proc /rescue/proc
6062
mount -t sysfs /sys /rescue/sys
6163
mount -o bind /dev /rescue/dev
6264
mount -o bind /dev/pts /rescue/dev/pts
6365
mount -o bind /run /rescue/run
6466
chroot /rescue
6567
```
68+
> [!NOTE]
69+
> On newer Ubuntu images, there is only one partition for the `/boot` folder. If you are recovering an older Ubuntu image, you can ignore any errors that occur when you mount `/dev/sdc16` to `/rescue/boot`. However, make sure that there are files in `/rescue/boot` after you complete these steps.
70+
>
71+
> If an error does occur during mounting, you can safely ignore an error that may occur when you unmount `/rescue/boot` in the step 5e.
6672
6773
1. Troubleshoot the chroot environment.
6874
@@ -78,28 +84,29 @@ This article describes how to troubleshoot the chroot environment in the rescue
7884
umount /rescue/run
7985
cd /
8086
umount /rescue/boot/efi
87+
umount /rescue/boot
8188
umount /rescue
8289
```
8390
8491
> [!NOTE]
85-
> If you receive the error message "unable to unmount /rescue," add the `-l` option to the `umount` command, for example, `umount -l /rescue`.
92+
> If you receive an "unable to unmount /rescue" error message, add the `-l` option to the `umount` command. For example: `umount -l /rescue`.
8693
87-
1. Detach the disk from the rescue VM and perform a disk swap with the original VM.
88-
1. Start the original VM and check its connectivity.
94+
1. Detach the disk from the rescue VM, and then perform a disk swap with the original VM.
95+
1. Start the original VM, and check its connectivity.
8996
90-
## RHEL/Centos/Oracle 6.x && Oracle 8.x && RHEL/Centos 7.x with RAW Partitions
97+
## RHEL/Centos/Oracle 6._x_ , Oracle 8._x_ and RHEL/Centos 7._x_ with RAW partitions
9198
9299
1. Stop or deallocate the affected VM.
93-
1. Create a rescue VM image of the same OS version in the same resource group (RSG) and location using a managed disk.
94-
1. Use the Azure portal to take a snapshot of the affected virtual machine's OS disk.
95-
1. Create a disk out of the snapshot of the OS disk, and attach it to the rescue VM.
96-
1. Once the disk has been created, troubleshoot the chroot environment in the rescue VM.
100+
1. Create a rescue VM image of the same OS version in the same resource group (RSG) and location by using a managed disk.
101+
1. Use the Azure portal to take a snapshot of the affected VM's OS disk.
102+
1. Create a disk out of the snapshot of the OS disk, and then attach it to the rescue VM.
103+
1. After the disk is created, troubleshoot the chroot environment on the rescue VM.
97104
98105
1. Access your VM as the root user by using the following command:
99106
100107
`sudo su -`
101108
102-
1. Find the disk using `dmesg` (the method you use to discover your new disk may vary). The following example uses `dmesg` to filter on SCSI disks:
109+
1. Find the disk. The method that you use to discover your new disk may vary. We recommend that you use the `dmesg` command. The following example uses `dmesg` to filter on SCSI disks:
103110
104111
`dmesg | grep SCSI`
105112
@@ -146,12 +153,12 @@ This article describes how to troubleshoot the chroot environment in the rescue
146153
```
147154
148155
> [!NOTE]
149-
> If you receive the error message "unable to unmount /rescue," add the `-l` option to the `umount` command, for example, `umount -l /rescue`.
156+
> If you receive an "unable to unmount /rescue" error message, add the `-l` option to the `umount` command. For example: `umount -l /rescue`.
150157
151-
1. Detach the disk from the rescue VM and perform a disk swap with the original VM.
152-
1. Start the original VM and check its connectivity.
158+
1. Detach the disk from the rescue VM, and then perform a disk swap with the original VM.
159+
1. Start the original VM, and check its connectivity.
153160
154-
## RHEL/Centos 7.x & 8.X with LVM
161+
## RHEL/Centos 7._x_ and 8._x_ with LVM
155162
156163
> [!NOTE]
157164
> If your original VM includes Logical Volume Manager (LVM) on the OS Disk, create the rescue VM by using the image with raw partitions on the OS Disk.
@@ -166,7 +173,7 @@ This article describes how to troubleshoot the chroot environment in the rescue
166173
167174
`sudo su -`
168175
169-
1. Find the disk using `dmesg` (the method you use to discover your new disk may vary). The following example uses `dmesg` to filter on SCSI disks:
176+
1. Find the disk. The method that you use to discover your new disk may vary. We recommend that5 you use the `dmesg` command. The following example uses `dmesg` to filter on SCSI disks:
170177
171178
`dmesg | grep SCSI`
172179
@@ -228,7 +235,7 @@ This article describes how to troubleshoot the chroot environment in the rescue
228235
mount /dev/sdc1 /rescue/boot/efi
229236
```
230237
231-
The */rescue/boot/* and */rescue/boot/efi* partitions may not always be located on */dev/sdc2* or */dev/sdc1*. If you encounter an error while trying to mount these partitions, check the */rescue/etc/fstab* file to determine the correct devices for the */boot* and */boot/efi* partitions from the broken OS disk. Then, run the `blkid` command and compare the Universal Unique Identifier (UUID) from the */rescue/etc/fstab* file with the output of the `blkid` command to determine the correct device for mounting */rescue/boot/* and */rescue/boot/efi* in the repair VM.
238+
The */rescue/boot/* and */rescue/boot/efi* partitions may not always be located on */dev/sdc2* or */dev/sdc1*. If you encounter an error when you try to mount these partitions, check the */rescue/etc/fstab* file to determine the correct devices for the */boot* and */boot/efi* partitions from the broken OS disk. Then, run the `blkid` command and compare the Universal Unique Identifier (UUID) from the */rescue/etc/fstab* file to the output of the `blkid` command to determine the correct device for mounting */rescue/boot/* and */rescue/boot/efi* in the repair VM.
232239
233240
The `mount /dev/mapper/rootvg-optlv /rescue/opt` command may fail if the *rootvg-optlv* volume group doesn't exist. In this case, you can bypass this command.
234241
@@ -267,19 +274,19 @@ This article describes how to troubleshoot the chroot environment in the rescue
267274
```
268275
269276
> [!NOTE]
270-
> If you receive the error message "unable to unmount /rescue," add the `-l` option to the `umount` command, for example, `umount -l /rescue`.
277+
> If you receive an "unable to unmount /rescue" error message, add the `-l` option to the `umount` command. For example: `umount -l /rescue`.
271278
272-
1. Detach the disk from the rescue VM and perform a disk swap with the original VM.
273-
1. Start the original VM and check its connectivity.
279+
1. Detach the disk from the rescue VM, and then perform a disk swap with the original VM.
280+
1. Start the original VM, and check its connectivity.
274281
275282
### Using the same LVM image
276283
277284
> [!NOTE]
278-
> If you need to deploy the rescue VM by using the same LVM image, you need to modify some aspects of the rescue VM with LVM.
285+
> If you have to deploy the rescue VM by using the same LVM image, you must modify some aspects of the rescue VM with LVM.
279286
280-
The following commands are to be executed on the recovery/rescue VM that's temporarily created for the recovery operation.
287+
The following commands are to be run on the recovery (rescue) VM that's temporarily created for the recovery operation.
281288
282-
1. Use the following command to check the status of the disks prior to attaching the disk you want to rescue:
289+
1. Use the following command to check the status of the disks before you attach the disk that you want to rescue:
283290
284291
```bash
285292
sudo lsblk -f
@@ -302,7 +309,7 @@ The following commands are to be executed on the recovery/rescue VM that's tempo
302309
└─sdb1 ext4 e72e7c2c-db27-4a73-a97e-01d63d21ccf8 /mnt
303310
```
304311

305-
2. Attach the disk you want to rescue as a data drive.
312+
2. Attach the disk that you want to rescue as a data drive.
306313
3. Check the disks again by using the following command:
307314

308315
```bash
@@ -470,7 +477,7 @@ The following commands are to be executed on the recovery/rescue VM that's tempo
470477
sudo mount -o bind /run /rescue/run
471478
```
472479

473-
The */rescue/boot/* and */rescue/boot/efi* partitions may not always be located on */dev/sdc2* or */dev/sdc1*. If you encounter an error while trying to mount these partitions, check the */rescue/etc/fstab* file to determine the correct devices for the */boot* and */boot/efi* partitions from the broken OS disk. Then, run the `blkid` command and compare the UUID from the */rescue/etc/fstab* file with the output of the `blkid` command to determine the correct device for mounting */rescue/boot/* and */rescue/boot/efi* in the repair VM. Duplicated UUIDs may appear in the output. In this scenario, mount the partition that matches the device letter from step 5. In the example of this section, the correct partition you should mount is */dev/sdc*. The *dev/sda* represents the operating system currently in use and should be ignored.
480+
The */rescue/boot/* and */rescue/boot/efi* partitions may not always be located on */dev/sdc2* or */dev/sdc1*. If you encounter an error whem you try to mount these partitions, check the */rescue/etc/fstab* file to determine the correct devices for the */boot* and */boot/efi* partitions from the broken OS disk. Then, run the `blkid` command and compare the UUID from the */rescue/etc/fstab* file to the output of the `blkid` command to determine the correct device for mounting */rescue/boot/* and */rescue/boot/efi* on the repair VM. Duplicated UUIDs may appear in the output. In this scenario, mount the partition that matches the device letter from step 5. In the example of this section, the correct partition that you should mount is */dev/sdc*. The *dev/sda* represents the operating system that's currently in use and should be ignored.
474481

475482
10. Verify the mounts by using the following command:
476483

@@ -512,7 +519,7 @@ The following commands are to be executed on the recovery/rescue VM that's tempo
512519
sudo chroot /rescue/
513520
```
514521

515-
12. Verify the mounts "inside" the chroot environment by using the following command:
522+
12. Verify the mounts that are "inside" the chroot environment by using the following command:
516523

517524
```bash
518525
sudo lsblk -f
@@ -547,7 +554,7 @@ The following commands are to be executed on the recovery/rescue VM that's tempo
547554
```
548555
Now, *rescuemevg-rootlv* is the one mounted on */*.
549556

550-
13. Rename the Volume Group (VG) to keep it consistent by using the following command. Renaming the VG keeps you from facing issues when regenerating the initrd and booting the disk again on the original VM.
557+
13. Rename the Volume Group (VG) to keep it consistent by using the following command. Renaming the VG helps you to avoid issues that might occur when you regenerate the initrd and restart the disk on the original VM.
551558

552559
```bash
553560
sudo vgrename rescuemevg rootvg
@@ -591,14 +598,14 @@ The following commands are to be executed on the recovery/rescue VM that's tempo
591598
└─rootvg-rootlv xfs d8dc4d62-ada5-4952-a0d9-1bce6cb6f809 /
592599
```
593600

594-
15. Proceed with the required activities to rescue the OS. These activities may include regenerating initramfs or the GRUB configuration.
601+
15. Perform the required activities to rescue the OS. These activities may include regenerating initramfs or the GRUB configuration.
595602
16. Exit the chroot environment by using the following command:
596603

597604
```bash
598605
sudo exit
599606
```
600607

601-
17. Unmount and detach the data disk from the rescue VM and perform a disk swap with the original VM by using the following commands:
608+
17. Unmount and detach the data disk from the rescue VM, and then perform a disk swap with the original VM by using the following commands:
602609

603610
```bash
604611
umount /rescue/run/
@@ -616,21 +623,21 @@ The following commands are to be executed on the recovery/rescue VM that's tempo
616623
umount /rescue
617624
```
618625

619-
18. Start the original VM and verify its functionality.
626+
18. Start the original VM, and verify its functionality.
620627

621-
## Oracle 7.x
628+
## Oracle 7._x_
622629

623630
1. Stop or deallocate the affected VM.
624-
1. Create a rescue VM image of the same OS version, in the same resource group (RSG) and location using a managed disk.
625-
1. Use the Azure portal to take a snapshot of the affected virtual machine's OS disk.
631+
1. Create a rescue VM image of the same OS version in the same resource group (RSG) and location by using a managed disk.
632+
1. Use the Azure portal to take a snapshot of the affected VM's OS disk.
626633
1. Create a disk out of the snapshot of the OS disk, and attach it to the rescue VM.
627-
1. Once the disk has been created, troubleshoot the chroot environment in the rescue VM.
634+
1. After the disk is created, troubleshoot the chroot environment on the rescue VM.
628635
629636
1. Access your VM as the root user by using the following command:
630637
631638
`sudo su -`
632639
633-
1. Find the disk by using `dmesg` (the method you use to discover your new disk may vary). The following example uses `dmesg` to filter on SCSI disks:
640+
1. Find the disk. The method that you use to discover your new disk may vary. We recommend that you use the `dmesg` command. The following example uses `dmesg` to filter on SCSI disks:
634641
635642
`dmesg | grep SCSI`
636643
@@ -678,15 +685,15 @@ The following commands are to be executed on the recovery/rescue VM that's tempo
678685
```
679686
680687
> [!NOTE]
681-
> If you receive the error message "unable to unmount /rescue," add the `-l` option to the `umount` command, for example, `umount -l /rescue`.
688+
> If you receive an "unable to unmount /rescue" error message, add the `-l` option to the `umount` command. For example: `umount -l /rescue`.
682689
683-
1. Detach the disk from the rescue VM and perform a disk swap with the original VM.
684-
1. Start the original VM and check its connectivity.
690+
1. Detach the disk from the rescue VM, and then perform a disk swap with the original VM.
691+
1. Start the original VM, and check its connectivity.
685692
686-
## SUSE-SLES 12 SP4, SUSE-SLES 12 SP4 For SAP && ## SUSE-SLES 15 SP1, SUSE-SLES 15 SP1 For SAP
693+
## SUSE-SLES 12 SP4, SUSE-SLES 12 SP4 For SAP, SUSE-SLES 15 SP1 and SUSE-SLES 15 SP1 For SAP
687694
688695
1. Stop or deallocate the affected VM.
689-
1. Create a rescue VM image of the same OS version, in the same resource group (RSG) and location using a managed disk.
696+
1. Create a rescue VM image of the same OS version in the same resource group (RSG) and location by using a managed disk.
690697
1. Use the Azure portal to take a snapshot of the affected virtual machine's OS disk.
691698
1. Create a disk out of the snapshot of the OS disk, and attach it to the rescue VM.
692699
1. Once the disk has been created, troubleshoot the chroot environment in the rescue VM.
@@ -695,7 +702,7 @@ The following commands are to be executed on the recovery/rescue VM that's tempo
695702

696703
`sudo su -`
697704

698-
1. Find the disk using `dmesg` (the method you use to discover your new disk may vary). The following example uses `dmesg` to filter on SCSI disks:
705+
1. Find the disk. The method you use to discover your new disk may vary. We recommend that you use the `dmesg` command. The following example uses `dmesg` to filter on SCSI disks:
699706

700707
`dmesg | grep SCSI`
701708

@@ -745,11 +752,12 @@ The following commands are to be executed on the recovery/rescue VM that's tempo
745752
> [!NOTE]
746753
> If you receive the error message "unable to unmount /rescue," add the `-l` option to the `umount` command, for example, `umount -l /rescue`.
747754

748-
1. Detach the disk from the rescue VM and perform a disk swap with the original VM.
749-
1. Start the original VM and check its connectivity.
755+
1. Detach the disk from the rescue VM, and then perform a disk swap with the original VM.
756+
1. Start the original VM, and check its connectivity.
750757

751758
## Next Steps
752759

753760
- [Troubleshoot ssh connection](troubleshoot-ssh-connection.md)
754761

755762
[!INCLUDE [Azure Help Support](../../../includes/azure-help-support.md)]
763+
a

0 commit comments

Comments
 (0)