This topic describes the cause of and the solutions to the issue that you cannot start a Linux Elastic Compute Service (ECS) instance and the Give root password for maintenance
(or press xxx to continue
) error message appears.
Problem description
You cannot start a Linux ECS instance, and the Give root password for maintenance
(or press xxx to continue
) error message appears.
Cause
In most cases, the preceding issue occurs due to errors in the /etc/fstab
configuration file.
In Linux, the /etc/fstab
configuration file is used to store the disk mount information of a server. If incorrect disk mount information is written to the /etc/fstab configuration file of a Linux ECS instance or the file encounters access errors, exceptions may occur on system startup and the instance cannot start. The /etc/fstab
configuration file may have the following issues:
Permissions are incorrectly configured.
Files are missing.
The file system types are incorrectly configured.
Multiple mount entries contain the same mount point.
A file system is mounted to multiple mount points.
Solutions
(Optional) Create a snapshot for the system disk of the Linux ECS instance.
To prevent data security issues caused by accidental operations, we recommend that you create a snapshot for the system disk of the Linux ECS instance. For information about how to create snapshots, see Create a snapshot of a disk.
Connect to the Linux ECS instance by using Virtual Network Computing (VNC).
For more information, see Connect to an instance by using VNC.
NoteIf the Linux ECS instance cannot start due to issues in the
/etc/fstab
configuration file, perform the operations that are described in the System startup exceptions caused by incorrect configuration of the /etc/fstab file of a Linux instance topic to resolve the issue.Check whether the disk mount information, including the universally unique identifiers (UUIDs), file system types, and mount parameters, in the
/etc/fstab
configuration file is the same as the disk mount information in the Linux operating system.If the disk mount information in the /etc/fstab configuration file is different from the disk mount information in the Linux operating system, make note of the
blkid
command output and proceed to Step 4.Run the following command to query the disk mount information in the
/etc/fstab
configuration file:cat /etc/fstab
Run the following command to query the disk mount information in the Linux operating system:
blkid
In the /etc/fstab configuration file, the disk mount information is in the following format:
/[$Disk partition] /[$Mount directory] [$File format] defaults 0 0
. Example:/dev/vdb1 /mnt ext4 defaults 0 0
. For more information about the /etc/fstab configuration file, see fstab.Note[$Disk partition]: specifies the disk partition. Example: /dev/vdb1.
[$Mount directory]: specifies the mount directory of the disk partition. Example: /mnt.
[$File format]: specifies the file format. Example: ext4.
Open the
/etc/fstab
configuration file.NoteBefore you open the
/etc/fstab
configuration file, we recommend that you run thecp /etc/fstab /etc/fstab.bak
command to back up the file.vim /etc/fstab
Press the A key, find the lines that contain incorrect values, and then correct the lines based on the information obtained in Step 3.
If permissions are incorrectly configured, correct the configuration errors. For example, change
defaults,ro
todefaults
for the file system whose UUID is55dd98eb-d919-****-9fcb-6ca5ee56ab8b
, as shown in the following figure.If a file specified in the /etc/fstab configuration file is missing, the Linux ECS instance may be unable to start. You can perform the operations that are described in the System startup exceptions caused by incorrect configuration of the /etc/fstab file of a Linux instance topic to resolve the issue.
If the file system types are incorrectly configured in the
/etc/fstab
configuration file, correct the configuration errors. For example, set the TYPE parameters of the file system whose UUID is99B3-3B48
and the file system whose UUID is42a97e74-90b8-49f1-****-5d7f0b07db7b
to the correct values, as shown in the following figure.If multiple mount entries that contain the same mount point exist in the /etc/fstab configuration file, delete the unnecessary mount entries.
If identical mount entries exist in the /etc/fstab configuration file to mount a file system to the same mount point, delete the duplicate mount entries. Retain only one mount entry for the file system based on your business requirements.
If multiple mount entries exist in the /etc/fstab configuration file to mount multiple file systems to the same mount point, delete the unnecessary mount entries. Retain only one mount entry that contains the mount point based on your business requirements. For example, the file system whose UUID is
B483-4E9C
and the file system whose UUID isB483-4E9Ctest
are mounted to the/boot/dfi
mount point, as shown in the following figure. Delete the mount entry of the file system whose UUID isB483-4E9Ctest
.
If a file system is mounted to multiple mount points, delete the unnecessary mount entries.
In most cases, you can mount a file system to only a single mount point. Delete the incorrect or unnecessary mount entries and retain only one mount entry for the file system based on your business requirements. For example, two mount entries exist in the /etc/fstab configuration file to mount the file system whose UUID is
B483-4E9C
to the/boot/dfi
and/boot/dfimntAdd
mount points, as shown in the following figure. Delete the mount entry that contains the/boot/dfimntAdd
mount point.
Press the
Esc
key to exist Insert mode, enter:wq
, and then press theEnter
key to save and close the configuration file.Run the following command to reload the
/etc/fstab
configuration file:mount -a