18.8
the
Linux
learning is not difficult. File System Management (
8
): Set boot auto Mount
Linux
File System
You can only use a partition or a device after it is mounted, but when the computer restarts, it needs to be mounted again, and this time it is possible to automatically mount the Linux file system by modifying the/etc/fstab file for boot. To automatically mount the file system on boot, you need to add information about the disk partition in the/etc/fstab file, which can be implemented by providing the device name and UUID.
1 . Use device name
Edit the/etc/fstab file to add the following to the end of the file.
/dev/sda5/mnt/www XFS Defaults 1 2
2 . Using UUID
First use the following command to first view the UUID information for the disk partition/dev/sda5.
[Email protected] ~]# ls-l/dev/disk/by-uuid
Total dosage 0
lrwxrwxrwx. 1 root root month 14:56 500f998a-a4c9-43d8-b468-109a42787ec8. /.. /sda2
lrwxrwxrwx. 1 root root month 14:56 b6d87c93-6c54-48f3-9295-ec0f7b92c9f3. /.. /SDA1
lrwxrwxrwx. 1 root root Month 14:56 D8636446-9878-4437-b43c-50d71af8beba. /.. /sda3
lrwxrwxrwx. 1 root root Month 15:02 F084B8A6-C9AB-425B-99DA-B64CB35E4FC2. /.. /sda5
// Disk Partitioning /dev/sda5 of the UUID is a F084B8A6-C9AB-425B-99DA-B64CB35E4FC2
then edit /etc/fstab file , Add the following at the end of the file.
uuid= f084b8a6-c9ab-425b-99da-b64cb35e4fc2/mnt/www XFS Defaults 1 2
This article extracts from "Linux Learning is not difficult" textbook, which is one of the most practical, theoretical and practical Linux Introductory materials. To read the entire book, visit the Linux ops (www.linuxywz.com) website .
"Linux learning is not difficult" file system Management (8): Set boot automatically mount Linux file system