You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: support/azure/virtual-machines/linux/chroot-environment-linux.md
+47-46Lines changed: 47 additions & 46 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,21 +21,21 @@ ms.author: genli
21
21
22
22
[!INCLUDE [CentOS End Of Life](../../../includes/centos-end-of-life-note.md)]
23
23
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.
25
25
26
26
## Ubuntu
27
27
28
28
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.
31
31
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.
33
33
34
34
1. Access your VM as the root user by using the following command:
35
35
36
36
`sudo su -`
37
37
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:
39
39
40
40
`dmesg | grep SCSI`
41
41
@@ -66,9 +66,9 @@ This article describes how to troubleshoot the chroot environment in the rescue
66
66
chroot /rescue
67
67
```
68
68
> [!NOTE]
69
-
> On newer Ubuntu images, there is only one partition for `/boot`. If you are recovering an older Ubuntu image, you can ignore errors when mounting `/dev/sdc16` to `/rescue/boot`, as long as there are files in `/rescue/boot` after completing these steps.
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
70
>
71
-
> If an error occurs during mounting, it will be safe to ignore the error that may occur when you unmount `/rescue/boot` in the step v.
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.
72
72
73
73
1. Troubleshoot the chroot environment.
74
74
@@ -89,24 +89,24 @@ This article describes how to troubleshoot the chroot environment in the rescue
89
89
```
90
90
91
91
> [!NOTE]
92
-
> 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`.
93
93
94
-
1. Detach the disk from the rescue VM and perform a disk swap with the original VM.
95
-
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.
96
96
97
-
## RHEL/Centos/Oracle 6.x && Oracle 8.x && RHEL/Centos 7.x with RAW Partitions
97
+
## RHEL/Centos/Oracle 6.x && Oracle 8.x && RHEL/Centos 7.x with RAW partitions
98
98
99
99
1. Stop or deallocate the affected VM.
100
-
1. Create a rescue VM image of the same OS version in the same resource group (RSG) and location using a managed disk.
101
-
1. Use the Azure portal to take a snapshot of the affected virtual machine's OS disk.
102
-
1. Create a disk out of the snapshot of the OS disk, and attach it to the rescue VM.
103
-
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.
104
104
105
105
1. Access your VM as the root user by using the following command:
106
106
107
107
`sudo su -`
108
108
109
-
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:
110
110
111
111
`dmesg | grep SCSI`
112
112
@@ -153,10 +153,10 @@ This article describes how to troubleshoot the chroot environment in the rescue
153
153
```
154
154
155
155
> [!NOTE]
156
-
> 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`.
157
157
158
-
1. Detach the disk from the rescue VM and perform a disk swap with the original VM.
159
-
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.
160
160
161
161
## RHEL/Centos 7.x & 8.X with LVM
162
162
@@ -173,7 +173,7 @@ This article describes how to troubleshoot the chroot environment in the rescue
173
173
174
174
`sudo su -`
175
175
176
-
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:
177
177
178
178
`dmesg | grep SCSI`
179
179
@@ -235,7 +235,7 @@ This article describes how to troubleshoot the chroot environment in the rescue
235
235
mount /dev/sdc1 /rescue/boot/efi
236
236
```
237
237
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 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.
239
239
240
240
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.
241
241
@@ -274,19 +274,19 @@ This article describes how to troubleshoot the chroot environment in the rescue
274
274
```
275
275
276
276
> [!NOTE]
277
-
> 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`.
278
278
279
-
1. Detach the disk from the rescue VM and perform a disk swap with the original VM.
280
-
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.
281
281
282
282
### Using the same LVM image
283
283
284
284
> [!NOTE]
285
-
> 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.
286
286
287
-
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.
288
288
289
-
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:
290
290
291
291
```bash
292
292
sudo lsblk -f
@@ -309,7 +309,7 @@ The following commands are to be executed on the recovery/rescue VM that's tempo
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.
313
313
3. Check the disks again by using the following command:
314
314
315
315
```bash
@@ -477,7 +477,7 @@ The following commands are to be executed on the recovery/rescue VM that's tempo
477
477
sudo mount -o bind /run /rescue/run
478
478
```
479
479
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 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.
481
481
482
482
10. Verify the mounts by using the following command:
483
483
@@ -519,7 +519,7 @@ The following commands are to be executed on the recovery/rescue VM that's tempo
519
519
sudo chroot /rescue/
520
520
```
521
521
522
-
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:
523
523
524
524
```bash
525
525
sudo lsblk -f
@@ -554,7 +554,7 @@ The following commands are to be executed on the recovery/rescue VM that's tempo
554
554
```
555
555
Now, *rescuemevg-rootlv* is the one mounted on */*.
556
556
557
-
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.
558
558
559
559
```bash
560
560
sudo vgrename rescuemevg rootvg
@@ -598,14 +598,14 @@ The following commands are to be executed on the recovery/rescue VM that's tempo
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.
602
602
16. Exit the chroot environment by using the following command:
603
603
604
604
```bash
605
605
sudo exit
606
606
```
607
607
608
-
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, andthen perform a disk swap with the original VM by using the following commands:
609
609
610
610
```bash
611
611
umount /rescue/run/
@@ -623,21 +623,21 @@ The following commands are to be executed on the recovery/rescue VM that's tempo
623
623
umount /rescue
624
624
```
625
625
626
-
18. Start the original VM and verify its functionality.
626
+
18. Start the original VM, and verify its functionality.
627
627
628
-
## Oracle 7.x
628
+
## Oracle 7._x_
629
629
630
630
1. Stop or deallocate the affected VM.
631
-
1. Create a rescue VM image of the same OS version,in the same resource group (RSG) and location using a managed disk.
632
-
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.
633
633
1. Create a disk out of the snapshot of the OS disk, and attach it to the rescue VM.
634
-
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.
635
635
636
636
1. Access your VM as the root user by using the following command:
637
637
638
638
`sudo su -`
639
639
640
-
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:
641
641
642
642
`dmesg | grep SCSI`
643
643
@@ -685,15 +685,15 @@ The following commands are to be executed on the recovery/rescue VM that's tempo
685
685
```
686
686
687
687
> [!NOTE]
688
-
> 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`.
689
689
690
-
1. Detach the disk from the rescue VM and perform a disk swap with the original VM.
691
-
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.
692
692
693
693
## SUSE-SLES 12 SP4, SUSE-SLES 12 SP4 For SAP && ## SUSE-SLES 15 SP1, SUSE-SLES 15 SP1 For SAP
694
694
695
695
1. Stop or deallocate the affected VM.
696
-
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.
697
697
1. Use the Azure portal to take a snapshot of the affected virtual machine's OS disk.
698
698
1. Create a disk out of the snapshot of the OS disk, and attach it to the rescue VM.
699
699
1. Once the disk has been created, troubleshoot the chroot environment in the rescue VM.
@@ -702,7 +702,7 @@ The following commands are to be executed on the recovery/rescue VM that's tempo
702
702
703
703
`sudo su -`
704
704
705
-
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:
706
706
707
707
`dmesg | grep SCSI`
708
708
@@ -752,11 +752,12 @@ The following commands are to be executed on the recovery/rescue VM that's tempo
752
752
> [!NOTE]
753
753
> If you receive the error message "unable to unmount /rescue," add the `-l` option to the `umount` command, for example, `umount -l /rescue`.
754
754
755
-
1. Detach the disk from the rescue VM and perform a disk swap with the original VM.
756
-
1. Start the original VM and check its connectivity.
755
+
1. Detach the disk from the rescue VM, andthen perform a disk swap with the original VM.
756
+
1. Start the original VM, and check its connectivity.
0 commit comments