Skip to content

Commit 29995e8

Browse files
authored
Edit review
1 parent d04cf29 commit 29995e8

1 file changed

Lines changed: 45 additions & 33 deletions

File tree

Lines changed: 45 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Troubleshoot Linux VM boot issues due to fstab errors | Microsoft Learn
2+
title: Troubleshoot Linux VM boot issues due to fstab errors
33
description: Explains why Linux VM can't start and how to solve the problem.
44
services: virtual-machines
55
documentationcenter: ''
@@ -16,26 +16,29 @@ ms.devlang: azurecli
1616
ms.date: 02/19/2025
1717
ms.author: saimsh
1818
---
19+
1920
# Troubleshoot Linux VM boot issues due to fstab errors
2021

2122
**Applies to:** :heavy_check_mark: Linux VMs
2223

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

25-
The Linux filesystem table, fstab is a configuration table which is designed to configure rules where specific file systems are detected and mounted in an orderly manner during the system boot process.
26-
This article discusses multiple conditions where a wrong fstab configuration can lead to boot issue and provides troubleshooting guidance.
26+
The Linux filesystem table, fstab, is a configuration table that is designed to configure rules where specific file systems are detected and mounted in an orderly manner during the system boot process.
27+
28+
This article discusses multiple conditions where a wrong fstab configuration can lead to boot issues and provides troubleshooting guidance.
29+
30+
Here are some common reasons that can lead to virtual machine (VM) boot issues due to fstab misconfiguration:
2731

28-
Few common reasons that can lead to Virtual Machine Boot issues due to fstab misconfiguration are listed below:
2932
* Traditional filesystem name is used instead of the Universally Unique Identifier (UUID) of the filesystem.
3033
* An incorrect UUID is used.
31-
* An entry exists for an unattached device without ```nofail``` option within fstab configuration.
32-
* Incorrect entry within fstab configuration.
34+
* An entry exists for an unattached device without the `nofail` option within the fstab configuration.
35+
* Incorrect entry within the fstab configuration.
3336

3437
## Identify fstab issues
3538

36-
Check the current boot state of the VM in the serial log within the [Boot diagnostics] (/azure/virtual-machines/boot-diagnostics#boot-diagnostics-view) blade in the Azure portal. The VM will be in an Emergency Mode. You see log entries that resemble the following example leading to the Emergency Mode state:
39+
Check the current boot state of the VM in the serial log within the [Boot diagnostics](/azure/virtual-machines/boot-diagnostics#boot-diagnostics-view) blade in the Azure portal. The VM will be in an Emergency Mode. You see log entries that resemble the following example leading to the Emergency Mode state:
3740

38-
```
41+
```output
3942
[K[[1;31m TIME [0m] Timed out waiting for device dev-incorrect.device.
4043
[[1;33mDEPEND[0m] Dependency failed for /data.
4144
[[1;33mDEPEND[0m] Dependency failed for Local File Systems.
@@ -44,58 +47,67 @@ Welcome to emergency mode! After logging in, type "journalctl -xb" to viewsystem
4447
Give root password for maintenance
4548
(or type Control-D to continue)
4649
```
50+
4751
>[!Note]
48-
> "/data" is an example of mount point used. Dependency failure for filesystem mount point will differ based on the names used.
52+
> `/data` is an example of mount point used. Dependency failure for filesystem mount point will differ based on the names used.
4953
5054
## Resolution
51-
There are 2 ways to resolve the issue:
55+
56+
There are two ways to resolve the issue:
57+
5258
* Repair the VM online
53-
* [Use the Serial Console](#use-the-serial-console)
54-
* Repair the vm offline
59+
* [Use the serial console](#use-the-serial-console)
60+
* Repair the VM offline
5561
* [Use Azure Linux Auto Repair (ALAR)](#use-azure-linux-auto-repair-alar)
56-
* [Use Manual Method](#use-manual-method)
62+
* [Use the manual method](#use-the-manual-method)
63+
64+
### Repair the VM online
5765

58-
### Repair the VM Online
5966
#### Use the serial console
60-
1. Connect to [the serial console](./serial-console-linux.md) of the VM from Azure portal.
61-
2. Manual access to single user mode is required to reconfigure fstab. The steps can vary based on the type of Linux OS in use and access to the root account. Follow [single user mode](serial-console-grub-single-user-mode.md) documentation to access single user mode for each supported Linux partner image.
67+
68+
1. Connect to [the serial console](./serial-console-linux.md) of the VM from the Azure portal.
69+
2. Manual access to single-user mode is required to reconfigure fstab. The steps can vary based on the type of Linux OS used and access to the root account. Follow the [single-user mode](serial-console-grub-single-user-mode.md) documentation to access single-user mode for each supported Linux partner image.
6270

6371
##### Fstab troubleshooting steps
64-
1. Once the vm has booted into single user mode. Use your favorite text editor to open the fstab file.
6572

66-
```
73+
1. Once the VM has booted into single-user mode. Use your favorite text editor to open the fstab file.
74+
75+
```bash
6776
vi /etc/fstab
6877
```
69-
2. Review the listed filesystems in `/etc/fstab`. Each line in the fstab file indicates a filesystem 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 boot failure, review the entry for the filesystem that failed to mount. It's a good practice to review each line to ensure that it's correct in both structure and content. Few points to consider to correctly administer a fstab file are as follows:
78+
79+
2. Review the listed filesystems in `/etc/fstab`. Each line in the fstab file indicates a filesystem 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 boot failure, review the entry for the filesystem that failed to mount. It's a good practice to review each line to ensure that it's correct in both structure and content. A few points to consider to correctly administer a fstab file are as follows:
7080

7181
* 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.
72-
* Mount the data disks on Azure VMs by using the UUID of the file system partition. To determine the UUID of the file system, run the `blkid` command. For more information about the syntax, run the `man blkid` command. Example of UUID entry in fstab file:
82+
* Mount the data disks on Azure VMs by using the UUID of the file system partition. To determine the UUID of the file system, run the `blkid` command. For more information about the syntax, run the `man blkid` command. Example of the UUID entry in the fstab file:
7383

7484
```bash
7585
UUID=<UUID number here> /data xfs defaults,nofail 0 0
7686
```
87+
7788
* Use the `nofail` option in the filesystem entries (data disks) to enable startup to continue even after errors occur in partitions for the corresponding entries. The `nofail` option helps make sure that the VM starts even if the file system is corrupted or if it doesn't exist at startup.
7889
7990
5. Save the changes to the fstab file.
8091
8192
6. Use `mount -a` as a best practice after making changes to the fstab entries. This will rerun the fstab configuration and notify the users of any existing syntax or entry errors.
8293
83-
6. Once, the syntax and entries are verified, reboot the vm using the below command.
94+
6. Once the syntax and entries are verified, reboot the VM using the following command:
8495
85-
```
96+
```bash
8697
reboot -f
8798
```
8899
7. 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.
89-
> [!Note]
90-
> You can also use "ctrl+x" command which would also reboot the vm.
100+
101+
> [!Note]
102+
> You can also use the `ctrl+x` command that will also reboot the VM.
91103
92104
### Repair the VM offline
93105
94-
If the VM serial console access isn't available, an alternative solution is to repair the vm offline. There are two ways to take an offline approach:
106+
If the VM serial console access isn't available, an alternative solution is to repair the VM offline. There are two ways to take an offline approach:
95107

96108
#### Use Azure Linux Auto Repair (ALAR)
97109

98-
Azure Linux Auto Repair (ALAR) scripts are a part of VM repair extension described in [Use Azure Linux Auto Repair (ALAR) to fix a Linux VM](./repair-linux-vm-using-alar.md). ALAR covers automation of multiple repair scenarios including `/etc/fstab` issues.
110+
Azure Linux Auto Repair (ALAR) scripts are part of the VM repair extension described in [Use Azure Linux Auto Repair (ALAR) to fix a Linux VM](./repair-linux-vm-using-alar.md). ALAR covers the automation of multiple repair scenarios, including `/etc/fstab` issues.
99111

100112
The ALAR scripts use the repair extension `repair-button` to fix fstab issues by specifying `--button-command fstab`. This parameter triggers the automated recovery. Implement the following steps to automate fstab errors via the offline ALAR approach:
101113

@@ -105,16 +117,16 @@ az vm repair repair-button --button-command fstab --verbose rgtest --name vmtest
105117

106118
> [!NOTE]
107119
> - Replace the resource group name `rgtest` and VM name `vmtest` accordingly.
108-
> - The Repair VM script, in conjunction with the ALAR script, will temporarily create a resource group, a repair VM, and a copy of the affected VM's OS disk. It backs up the original */etc/fstab* file and modifies it by removing or commenting out data file system entries that aren't required for booting the system.
109-
> - After the OS starts successfully, review and edit the */etc/fstab* file to fix any errors that might have prevented a proper reboot. Finally, The `repair-button` script will automatically delete the resource group containing the repair VM.
120+
> - The repair VM script, in conjunction with the ALAR script, will temporarily create a resource group, a repair VM, and a copy of the affected VM's OS disk. It backs up the original **/etc/fstab** file and modifies it by removing or commenting out data file system entries that aren't required to boot the system.
121+
> - After the OS starts successfully, review and edit the **/etc/fstab** file to fix any errors that might have prevented a proper reboot. Finally, the `repair-button` script will automatically delete the resource group containing the repair VM.
110122

111-
#### Use Manual Method
123+
#### Use the manual method
112124

113-
If both serial console and ALAR approach isn't possible or fails, the repair has to be performed manually. Follow the steps here to manually attach the OS disk to a recovery VM and swap the OS disk back to the original VM:
114-
* [Attach the OS disk to a recovery VM using the Azure portal](./troubleshoot-recovery-disks-portal-linux.md)
115-
* [Attach the OS disk to a recovery VM using Azure CLI](./troubleshoot-recovery-disks-linux.md)
125+
If both the serial console and ALAR approaches aren't possible or fail, the repair has to be performed manually. Follow the steps here to manually attach the OS disk to a recovery VM and swap the OS disk back to the original VM:
116126
117-
Once the OS disk is successfully attached to the recovery VM, follow the detailed [chroot instructions](./chroot-environment-linux.md) to mount and chroot to the filesystems of the attached OS disk. Then, implement [fstab troubleshooting steps](#fstab-troubleshooting-steps) to make appropriate changes to the fstab file of the problematic OS disk.
127+
* [Attach the OS disk to a recovery VM using the Azure portal](./troubleshoot-recovery-disks-portal-linux.md)
128+
* [Attach the OS disk to a recovery VM using the Azure CLI](./troubleshoot-recovery-disks-linux.md)
118129
130+
Once the OS disk is successfully attached to the recovery VM, follow the detailed [chroot instructions](./chroot-environment-linux.md) to mount and chroot to the filesystems of the attached OS disk. Then, implement the [fstab troubleshooting steps](#fstab-troubleshooting-steps) to make appropriate changes to the fstab file of the problematic OS disk.
119131
120132
[!INCLUDE [Azure Help Support](../../../includes/azure-help-support.md)]

0 commit comments

Comments
 (0)