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
+55-47Lines changed: 55 additions & 47 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
-
## Ubuntu 16.x && Ubuntu 18.x && Ubuntu 20.04
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
@@ -54,15 +54,21 @@ This article describes how to troubleshoot the chroot environment in the rescue
54
54
```bash
55
55
mkdir /rescue
56
56
mount /dev/sdc1 /rescue
57
+
mount /dev/sdc16 /rescue/boot
57
58
mount /dev/sdc15 /rescue/boot/efi
58
59
60
+
59
61
mount -t proc /proc /rescue/proc
60
62
mount -t sysfs /sys /rescue/sys
61
63
mount -o bind /dev /rescue/dev
62
64
mount -o bind /dev/pts /rescue/dev/pts
63
65
mount -o bind /run /rescue/run
64
66
chroot /rescue
65
67
```
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.
66
72
67
73
1. Troubleshoot the chroot environment.
68
74
@@ -78,28 +84,29 @@ This article describes how to troubleshoot the chroot environment in the rescue
78
84
umount /rescue/run
79
85
cd /
80
86
umount /rescue/boot/efi
87
+
umount /rescue/boot
81
88
umount /rescue
82
89
```
83
90
84
91
> [!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`.
86
93
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.
89
96
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
91
98
92
99
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.
97
104
98
105
1. Access your VM as the root user by using the following command:
99
106
100
107
`sudo su -`
101
108
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:
103
110
104
111
`dmesg | grep SCSI`
105
112
@@ -146,12 +153,12 @@ This article describes how to troubleshoot the chroot environment in the rescue
146
153
```
147
154
148
155
> [!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`.
150
157
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.
153
160
154
-
## RHEL/Centos 7.x & 8.X with LVM
161
+
## RHEL/Centos 7._x_ and 8._x_ with LVM
155
162
156
163
> [!NOTE]
157
164
> 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
166
173
167
174
`sudo su -`
168
175
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:
170
177
171
178
`dmesg | grep SCSI`
172
179
@@ -228,7 +235,7 @@ This article describes how to troubleshoot the chroot environment in the rescue
228
235
mount /dev/sdc1 /rescue/boot/efi
229
236
```
230
237
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.
232
239
233
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.
234
241
@@ -267,19 +274,19 @@ This article describes how to troubleshoot the chroot environment in the rescue
267
274
```
268
275
269
276
> [!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`.
271
278
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.
274
281
275
282
### Using the same LVM image
276
283
277
284
> [!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.
279
286
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.
281
288
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:
283
290
284
291
```bash
285
292
sudo lsblk -f
@@ -302,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.
306
313
3. Check the disks again by using the following command:
307
314
308
315
```bash
@@ -470,7 +477,7 @@ The following commands are to be executed on the recovery/rescue VM that's tempo
470
477
sudo mount -o bind /run /rescue/run
471
478
```
472
479
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.
474
481
475
482
10. Verify the mounts by using the following command:
476
483
@@ -512,7 +519,7 @@ The following commands are to be executed on the recovery/rescue VM that's tempo
512
519
sudo chroot /rescue/
513
520
```
514
521
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:
516
523
517
524
```bash
518
525
sudo lsblk -f
@@ -547,7 +554,7 @@ The following commands are to be executed on the recovery/rescue VM that's tempo
547
554
```
548
555
Now, *rescuemevg-rootlv* is the one mounted on */*.
549
556
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.
551
558
552
559
```bash
553
560
sudo vgrename rescuemevg rootvg
@@ -591,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.
595
602
16. Exit the chroot environment by using the following command:
596
603
597
604
```bash
598
605
sudo exit
599
606
```
600
607
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, andthen perform a disk swap with the original VM by using the following commands:
602
609
603
610
```bash
604
611
umount /rescue/run/
@@ -616,21 +623,21 @@ The following commands are to be executed on the recovery/rescue VM that's tempo
616
623
umount /rescue
617
624
```
618
625
619
-
18. Start the original VM and verify its functionality.
626
+
18. Start the original VM, and verify its functionality.
620
627
621
-
## Oracle 7.x
628
+
## Oracle 7._x_
622
629
623
630
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.
626
633
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.
628
635
629
636
1. Access your VM as the root user by using the following command:
630
637
631
638
`sudo su -`
632
639
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:
634
641
635
642
`dmesg | grep SCSI`
636
643
@@ -678,15 +685,15 @@ The following commands are to be executed on the recovery/rescue VM that's tempo
678
685
```
679
686
680
687
> [!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`.
682
689
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.
685
692
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
687
694
688
695
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.
690
697
1. Use the Azure portal to take a snapshot of the affected virtual machine's OS disk.
691
698
1. Create a disk out of the snapshot of the OS disk, and attach it to the rescue VM.
692
699
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
695
702
696
703
`sudo su -`
697
704
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:
699
706
700
707
`dmesg | grep SCSI`
701
708
@@ -745,11 +752,12 @@ The following commands are to be executed on the recovery/rescue VM that's tempo
745
752
> [!NOTE]
746
753
> If you receive the error message "unable to unmount /rescue," add the `-l` option to the `umount` command, for example, `umount -l /rescue`.
747
754
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, andthen perform a disk swap with the original VM.
756
+
1. Start the original VM, and check its connectivity.
0 commit comments