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.
fstabconfiguration file of the CVM.
/etc/fstabfile to automatically mount cloud disks after a CVM restarts:
/etc/fstabconfiguration file. For detailed directions, see Fixing the
Run the following command to view the soft link of the elastic cloud disk.
plaintext ls -l /dev/disk/by-id
Automatic mounting configuration may fail due to changes in a file system’s UUID.
For example, reformatting a file system will change its UUID.
Run the following command to view the UUID of the file system.
Automatic mounting configuration may fail due to changes in device name.
For example, if an elastic cloud disk on the CVM is unmounted and then remounted, the device name may change when the operating system recognizes the file system again.
Run the following command to view the device name.
4. Run the following command to use VI editor to open the `/etc/fstab` file.
cp /etc/fstab /home
5. Press **i** to enter the edit mode, and append the following content to the next line of the last line of the file.
Refer to the following examples according to the configuration method selected in [step 2](#Step2). - (Recommended) Take the soft link of an elastic cloud disk as an example. Add the following content:
<Device information> <Mount point> <File system format> <File system installation option> <File system dump frequency> <File system check sequence at launch>
- Take the UUID of the file system as an example. Add the following content:
/dev/disk/by-id/virtio-disk-drkhklpe-part1 /data/newpart ext4 defaults 0 2
- (Not recommended) Take the device name as an example. Add the following content:
UUID=d489ca1c-5057-4536-81cb-ceb2847f9954 /data/newpart ext4 defaults 0 2
6. Press **ESC**, enter **:wq**, and press **Enter** to save the configuration and exit the editor. 7. Run the following command to check whether the `/etc/fstab` file has been written successfully.
/dev/vdb1 /data/newpart ext4 defaults 0 2
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. !(https://main.qcloudimg.com/raw/4289f335d3373074d7fc799863fba498.png)
/etc/fstabfile to the
/homedirectory, for example:
cp /etc/fstab /home
#to comment out this configuration, as shown below.
This line configures data disk automount. However, due to misconfiguration, the cloud disk could not be mounted when CVM restarts.
exitto exit the single user mode.