linux /etc/fstab 文件解析
fstab表格描述了文件挂盘的顺序,以及挂盘的参数等。fstab文件包含6列
- Device 设备名,使用给定的名字或者mount的UUID
- Mount Point 挂载点,决定设备被挂载的路径
- File System Type 文件系统类型,如ext4、xfs等
- Options 挂载选项,使用逗号分割
- Backup Operation 备份相关选项,已被废弃
- File System Check Order 0 代表 fsck 不会检查文件系统。大于0的数字代表着检查的顺序。根文件系统应该设备为1,其他分区应设置为2
show case
cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' 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/nvme0n1p3 during installation
UUID=68c85c1a-8b84-4dcb-aba5-e84425c4bee0 / ext4 errors=remount-ro 0 1
# /boot/efi was on /dev/nvme1n1p2 during installation
UUID=9C25-7E07 /boot/efi vfat umask=0077 0 1
/swapfile none swap sw 0 0
部分挂载选项说明
- auto/noauto 分区是否在开机的时候自动挂载
- exec/noexec 该分区是否能执行二进制文件
- ro/rw 读写权限设置
- nouser/user 用户是否拥有mount特权
网友评论