This topic describes the cause of and solution to the issue that the Linux operating system of an Elastic Compute Service (ECS) instance cannot start when a disk is not properly mounted on the instance.
Problem description
A disk is not properly mounted on an instance that runs a Linux operating system. As a result, the Linux operating system of the instance cannot start.
Cause
You ran commands to mount disks on the Linux ECS instance, but you did not configure the disks to automatically mount in the /etc/fstab
file or the automatic mounting configurations of the disks contain an error. As a result, an exception may occur when the operating system starts, which causes a startup failure.
Solution
To prevent accidental operations from causing data security issues, create snapshots for disks attached to the Linux ECS instance.
For more information, see Create a snapshot for a disk.
Connect to the Linux ECS instance.
For more information, see Connection method overview.
Run the following command to mount disks:
mount /dev/vdb1 /mnt
NoteIn the preceding command, the
dev/vdb1
partition is used. Replace dev/vdb1 with the actual device name.Run the following command to open the
/etc/fstab
configuration file.NoteBefore you modify the configuration file, run the
cp /etc/fstab /etc/fstab.bak
command to back up the file.vim /etc/fstab
Press the
I
key to enter Insert mode and add the following configuration to the end of the file:/<Disk partition> /<Mount directory> <File format> defaults 0 0
Sample command:
/dev/vdb1 /mnt ext4 defaults 0 0
. Modify the configuration based on your actual environment.NoteReplace the <Disk partition> variable with the actual disk partition. In this example, the
/dev/vdb1
partition is used.Replace the <Mount directory> variable with the actual mount directory. In this example, the
/mnt
directory is used.Replace the <File format> variable with the actual file format. In this example, the
ext4
format is used.
A command output similar to the following one is displayed.
Press the
Esc
key to exit Insert mode, enter:wq
, and then press theEnter
key to save and close the file.
References
For information about the configurations in the
/etc/fstab
file, see Configure UUIDs in the fstab file to automatically mount data disks.For information about how to resolve the issue that the operating system of an ECS instance cannot start due to excess block storage devices, see How do I remove a block device that does not exist in the /etc/fstab file of a Linux instance?
For information about how to resolve the issue that the operating system of an ECS instance cannot start due to configuration errors in the
/etc/fstab
file, see System startup exceptions caused by incorrect configuration of the /etc/fstab file of a Linux instance.For information about how to resolve the issue that a Linux ECS instance cannot start and the
Give root password for maintenance
orPress xxx to continue
message appears, see What do I do if the "Give root password for maintenance" or "Press xxx to continue" message appears when I start a Linux ECS instance?