/etc/fstab file supports the use of device names (such as /dev/vda1) to identify file systems. However, device names may change due to the change in the actual operating environment after an image is imported, so there may be some problems using device names to identify file systems. To avoid these problems, you can change the file system identification method in the /etc/fstab file to UUID. The UUID is a unique characteristic string that identifies a disk partition and won't be affected by the change in device names. Using a UUID as the fstab file disk identification can ensure that the system can still correctly mount the file system when the device name changes.sudo cat /etc/fstab
UUID=c0b9ecd8-f922-4e5d-bccb-83fbc94ad23b / ext4 defaults 1 1
/dev/vda1), it indicates that the current fstab is using a device name. You can refer to the subsequent operation to switch to the UUID method. /dev/vda1 / ext4 defaults 1 1
blkid command can be used. Running the blkid command will display the detailed information of all the available partitions including the UUIDs. Run the following command in the terminal: sudo blkid
/dev/vda1 is c0b9ecd8-f922-4e5d-bccb-83fbc94ad23b. /dev/vda1: UUID="c0b9ecd8-f922-4e5d-bccb-83fbc94ad23b" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="bcfcb5cb-01"
/etc/fstab file to the /home directory.sudo cp /etc/fstab /home
/etc/fstab file.sudo vi /etc/fstab
UUID=xxx format. The content after UUID= is the UUID value corresponding to the device returned by running the blkid command. # Before modification/dev/vda1 / ext4 defaults 1 1# After modificationUUID=c0b9ecd8-f922-4e5d-bccb-83fbc94ad23b / ext4 defaults 1 1
sudo cat /etc/fstab
UUID=c0b9ecd8-f922-4e5d-bccb-83fbc94ad23b / ext4 defaults 1 1
sudo mount -a
/home directory.sudo mv /home/fstab /etc/fstab
Feedback