/etc/fstab文件描述了系统可以挂载的文件系统的信息,应用程序读取这个文件,然后根据其内容进行自动挂载的工作。比如我们执行mount -a命令就会按序挂载/etc/fstab中指定的每条文件系统(除非添加了noauto选项)。
fstab文件中记录的排序十分重要。因为 fsck,mount或umount等程序在做它们的工作时会按此顺序进行。
以一个fstab内容作为模板进行讲解。
以#开头为注释,非#开头的每一行描述了一个文件系统挂载信息。
# /etc/fstab: static file system information.## Use lkid to print the universally unique identifier for a# device; this may be used with UUID= as a more robust way to name devices# that works even if disks are added and removed. See fstab(5).## <file system> <mount point> <type> <options> <dump> <pass># / was on /dev/sda5 during installationUUID=02c5e115-082c-4ec4-bd13-8cccf82a04be /ext4 errors=remount-ro 0 1# /boot/efi was on /dev/sda1 during installationUUID=8EFB-96A4