Disclaimer: This topic may be contributed by a community or contain information about third-party products. We recommend that you visit the official website of the community or the third-party products for help and support. The third-party products are not supported by Alibaba Cloud after-sales service. This topic is for reference only. Alibaba Cloud does not make guarantees or warranties, express or implied.
Problem description
If the disk is not properly mounted in a Linux instance, the system may fail to start after the system is restarted. This topic describes the correct mounting process. You can refer to this process to perform operations.
Causes
Related commands have been set for mounting, but automatic mounting has not been configured in the /etc/fstab
file or a configuration error has occurred. An exception may occur during system startup, resulting in startup failure.
Solutions
Take note of the following items:
- Before you perform high-risk operations such as modifying instance configurations or data, we recommend that you check the disaster recovery and fault tolerance capabilities of the instances to ensure data security.
- You can modify the configurations and data of instances including Elastic Compute Service (ECS) and ApsaraDB RDS instances. We recommend that you create snapshots or enable RDS log backup before you modify instance configurations or data.
- If you have authorized or submitted sensitive information such as the logon account and password in Alibaba Cloud Management console, we recommend that you modify the information in a timely manner.
- Create a snapshot for the system disk of the Linux instance to avoid data security risks caused by accidental operations. For more information about how to create a snapshot, see Create a normal snapshot.
- Log on to the Linux instance by using SSH or Virtual Network Computing (VNC). For more information, see Connection overview.
Note: If your ECS instance fails to start because the disk is not properly mounted, see Linux instance /etc/fstab file configuration error caused by system startup exception.
- Run the following command to manually mount the disk:
mount /dev/vdb1 /mnt
Note: This topic uses the
/dev/vdb1
as an example, and the actual environment shall prevail. - Run the following command to edit the
/etc/fstab
file:Note: Back up data in the instance before you modify the configuration file.
vim /etc/fstab
- Press the A key to add the following configuration at the bottom of the file. After the modification is completed. Press Esc to exit edit mode. Enter
:wq
, pressEnter
, save and exit./[$Partion of the data disk] /[$Mount directory] [$Type of the file system] defaults 0 0
Note:
The system display types are as follows.- The colon (:) in the
:wq
needs to press theShift
plus colon (:) key to output. - Mount Information This topic uses
/dev/vdb1 /mnt ext4 defaults 0 0
as an example. The specific configuration information is subject to the actual environment on site. - [$Partition of the data disk] indicates the disk partition to be mounted. Example:
/dev/vdb1
. - [$Mount directory] indicates the directory to which the partition is mounted. Example:
/mnt
. - [$file format] indicates the format of the file. This topic uses
ext4
as an example.
- The colon (:) in the
References
- How do I remove a block device that does not exist in the /etc/fstab file of a Linux instance?
- Linux instance's "/etc/fstab" file is malformed
Applicable scope
- ECS instance