The file system is created and configured to automatically mount to the cloud disk on a Linux CVM, but automount fails upon the CVM restart.
fstab
configuration file of the CVM.fstab
configuration file./etc/fstab
file to automatically mount cloud disks after a CVM restarts:/etc/fstab
file./etc/fstab
configuration file. For detailed directions, see Fixing the /etc/fstab
fie./etc/fstab
fileRun the following command to view the soft link of the elastic cloud disk.
plaintext
ls -l /dev/disk/by-id
cp /etc/fstab /home
Run the following command to use VI editor to open the /etc/fstab
file.
vi /etc/fstab
Press i to enter the edit mode, and append the following content to the next line of the last line of the file.
<Device information> <Mount point> <File system format> <File system installation option> <File system dump frequency> <File system check sequence at launch>
Refer to the following examples according to the configuration method selected in step 2.
(Recommended) Take the soft link of an elastic cloud disk as an example. Add the following content:
/dev/disk/by-id/virtio-disk-drkhklpe-part1 /data/newpart ext4 defaults 0 2
Take the UUID of the file system as an example. Add the following content:
UUID=d489ca1c-5057-4536-81cb-ceb2847f9954 /data/newpart ext4 defaults 0 2
(Not recommended) Take the device name as an example. Add the following content:
/dev/vdb1 /data/newpart ext4 defaults 0 2
/etc/fstab
file has been written successfully.mount -a
If information similar to what is shown below is returned, the file has been written. The file system will automatically mount when the operating system is started. You can restart CVM to verify the result.
/etc/fstab
fileEnter single user mode. For detailed directions, see Configuring Linux CVM to Boot into Single User Mode.
Run the following command to back up the /etc/fstab
file to the /home
directory, for example:
cp /etc/fstab /home
Run the following command to use VI editor to open the /etc/fstab
file.
vi /etc/fstab
Press i to enter the edit mode. Move the cursor to the beginning of the error line and enter #
to comment out this configuration, as shown below.
Note:This line configures data disk automount. However, due to misconfiguration, the cloud disk could not be mounted when CVM restarts.
Press ESC, enter :wq, and press Enter to save the configuration and exit the editor.
Enter exit
to exit the single user mode.
Wait until restarting is completed. Log in to the CVM.
Reconfigure the file as instructed in Configuring the /etc/fstab
file.
Was this page helpful?