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.
Procedure
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 a snapshot for a disk.
Log on to a Linux instance through VNC. For more information, see Connection method overview.
NoteIf your ECS instance cannot be started because of an exception related to the
/etc/fstab
file, fix the exception on System startup exceptions caused by incorrect configuration of the /etc/fstab file of a Linux instance.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.
NoteThis 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
NoteBefore modifying a file, back up the
/etc/fstab
file.Click A key to delete the block device information in the
/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.NoteThe 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 (#).
A similar output is displayed, including a block device whose
UUID
isunique
. The site conditions are as follows.Check whether the block device information in the
/etc/fstab
file is consistent with the information displayed in theblkid
command.