Disclaimer: this article may be contributed by the community or involve third-party product information, we recommend that you visit the community or the official website of third-party products for help and support. Third-party products will not be provided by Alibaba Cloud after-sales support. This document is for reference only. Alibaba Cloud makes no guarantee by express or any other means.
Introduction
If other block devices are available on a Linux instance, the system may fail to after restarting the system. This article describes how to remove block devices that do not exist in the /etc/fstab
file of a Linux instance.
Background
Alibaba Cloud reminds you that:
- Before you perform operations that may cause risks, 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 but not limited to Elastic Compute Service (ECS) and Relational Database Service (RDS) instances. Before the modification, we recommend that you create snapshots or enable RDS log backup.
- If you have authorized or submitted sensitive information such as the logon account and password in the Alibaba Cloud Management Console, we recommend that you modify such information in a timely manner.
Perform the following steps:
- To avoid data security risks caused by misoperations, create a snapshot of the system disk of a Linux instance. For more information about how to create a snapshot, see create normal snapshots.
- Log on to a Linux instance through SSH or VNC. For more information, see connection methods overview introduction.
Note: if your ECS instance cannot be started because of an exception related to the
/etc/fstab
file, fix the exception caused by incorrect configuration of the /etc/fstab file on Linux instances. - Run the following command to view block information in the current Linux instance.
blkid
A similar output is displayed, indicating that the Linux instance has two block devices.
Note: this is only an example. Follow the actual situation on site when performing the operation.
- Run the following command to view the information about block devices configured in the current
/etc/fstab
file.cat /etc/fstab
Check whether the/etc/fstab
file and the block device information in theblkid
command result are inconsistent, that is, whether theUUID
information is completely consistent. The command output is as follows: - If there are inconsistencies, record the results of the
blkid
command. Then execute the following command to edit the/etc/fstab
file.vim /etc/fstab
Note: before modifying a file, back up the
Click A key to delete the block device information in the/etc/fstab
file./etc/fstab
file that is inconsistent with the result of theblkid
command. After the update is complete, click Esc to exit the edit mode. Enter: WQ
, typeEnter
, save and exit.Note:
A similar output is displayed, including a block device whose
- The colon (:) in
: WQ
needs to be output by clickingShift
plus the colon (:) key. - It is recommended to replace the delete operation with an annotation symbol (#).
UUID
isunique
. The site conditions are as follows. - The colon (:) in
- Check whether the block device information in the
/etc/fstab
file is consistent with the information displayed in theblkid
command.
Application scope
- Elastic Compute Service