Skip to content

Commit 5b3c225

Browse files
authored
Merge pull request #109143 from kailashmsft/kaib-update
updated the document with steps for single user mode
2 parents eedfca2 + b0167c5 commit 5b3c225

File tree

1 file changed

+42
-6
lines changed

1 file changed

+42
-6
lines changed

articles/virtual-machines/troubleshooting/linux-virtual-machine-cannot-start-fstab-errors.md

Lines changed: 42 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ The following are examples of possible errors.
3333
[[1;33mDEPEND[0m] Dependency failed for /data.
3434
[[1;33mDEPEND[0m] Dependency failed for Local File Systems.
3535
36-
Welcome to emergency mode! After logging in, type journalctl -xb to viewsystem logs, systemctl reboot to reboot, systemctl default to try again to boot into default mode.
36+
Welcome to emergency mode! After logging in, type "journalctl -xb" to viewsystem logs, "systemctl reboot" to reboot, "systemctl default" to try again to boot into default mode.
3737
Give root password for maintenance
3838
(or type Control-D to continue)
3939
```
@@ -44,9 +44,9 @@ Give root password for maintenance
4444
Checking file systems…
4545
fsck from util-linux 2.19.1
4646
Checking all file systems.
47-
/dev/sdc1: nonexistent device (nofail fstab option may be used to skip this device)
48-
/dev/sdd1: nonexistent device (nofail fstab option may be used to skip this device)
49-
/dev/sde1: nonexistent device (nofail fstab option may be used to skip this device)
47+
/dev/sdc1: nonexistent device ("nofail" fstab option may be used to skip this device)
48+
/dev/sdd1: nonexistent device ("nofail" fstab option may be used to skip this device)
49+
/dev/sde1: nonexistent device ("nofail" fstab option may be used to skip this device)
5050
5151
[/sbin/fsck.ext3 (1) — /CODE] sck.ext3 -a /dev/sdc1
5252
fsck.ext3: No such file or directory while trying to open /dev/sdc1
@@ -87,7 +87,7 @@ fsck.ext4: Unable to resolve UUID="<UUID>"
8787
*** when you leave the shell.
8888
*** Warning — SELinux is active
8989
*** Disabling security enforcement for system recovery.
90-
*** Run setenforce 1 to reenable.
90+
*** Run 'setenforce 1' to reenable.
9191
type=1404 audit(1428047455.949:4): enforcing=0 old_enforcing=1 auid=<AUID> ses=4294967295
9292
Give root password for maintenance
9393
(or type Control-D to continue)
@@ -101,6 +101,42 @@ To resolve this problem, start the VM in emergency mode by using the serial cons
101101

102102
## Use the serial console
103103

104+
### Using Single User Mode
105+
106+
1. Connect to [the serial console](https://docs.microsoft.com/azure/virtual-machines/troubleshooting/serial-console-linux).
107+
2. Use serial console to take single user mode [single user mode](https://docs.microsoft.com/archive/blogs/linuxonazure/why-proactively-ensuring-you-have-access-to-grub-and-sysrq-in-your-linux-vm-could-save-you-lots-of-down-time#RH6x)
108+
3. Once the vm has booted into single user mode. Use your favorite text editor to open the fstab file.
109+
110+
```
111+
# nano /etc/fstab
112+
```
113+
114+
4. Review the listed file systems. Each line in the fstab file indicates a file system that is mounted when the VM starts. For more information about the syntax of the fstab file, run the man fstab command. To troubleshoot a start failure, review each line to make sure that it's correct in both structure and content.
115+
116+
> [!Note]
117+
> * Fields on each line are separated by tabs or spaces. Blank lines are ignored. Lines that have a number sign (#) as the first character are comments. Commented lines can remain in the fstab file, but they won't be processed. We recommend that you comment fstab lines that you're unsure about instead of removing the lines.
118+
> * For the VM to recover and start, the file system partitions should be the only required partitions. The VM may experience application errors about additional commented partitions. However, the VM should start without the additional partitions. You can later uncomment any commented lines.
119+
> * We recommend that you mount data disks on Azure VMs by using the UUID of the file system partition. For example, run the following command: ``/dev/sdc1: LABEL="cloudimg-rootfs" UUID="<UUID>" TYPE="ext4" PARTUUID="<PartUUID>"``
120+
> * To determine the UUID of the file system, run the blkid command. For more information about the syntax, run the man blkid command.
121+
> * The nofail option helps make sure that the VM starts even if the file system is corrupted or the file system doesn't exist at startup. We recommend that you use the nofail option in the fstab file to enable startup to continue after errors occur in partitions that are not required for the VM to start.
122+
123+
5. Change or comment out any incorrect or unnecessary lines in the fstab file to enable the VM to start correctly.
124+
125+
6. Save the changes to the fstab file.
126+
127+
7. Reboot the vm using the below command.
128+
129+
```
130+
# reboot -f
131+
```
132+
> [!Note]
133+
> You can also use "ctrl+x" command which would also reboot the vm.
134+
135+
136+
8. If the entries comment or fix was successful, the system should reach a bash prompt in the portal. Check whether you can connect to the VM.
137+
138+
### Using Root Password
139+
104140
1. Connect to [the serial console](https://docs.microsoft.com/azure/virtual-machines/troubleshooting/serial-console-linux).
105141
2. Sign-in to the system by using a local user and password.
106142

@@ -153,7 +189,7 @@ To resolve this problem, start the VM in emergency mode by using the serial cons
153189

154190
2. After you mount the system disk as a data disk on the recovery VM, back up the fstab file before you make changes, and then follow the next steps to correct the fstab file.
155191

156-
3. Look for the error that indicates the disk wasn't mounted. In the following example, the system was trying to attach a disk that was no longer present:
192+
3. Look for the error that indicates the disk wasn't mounted. In the following example, the system was trying to attach a disk that was no longer present:
157193

158194
```
159195
[DEPEND] Dependency failed for /datadisk1.

0 commit comments

Comments
 (0)