v2jpg

/etc/fstab
fsck、mount、umount的等命令都利用该程序。
/etc/fstab 是启动时的配置文件,实际 filesystem 的挂载是记录到 /etc/mtab 与 /proc/mounts

limit:
根目录 / 是必须挂载的﹐而且一定要先于其它 mount point 被挂载进来。
其它 mount point 必须为已创建的目录﹐可任意指定﹐但一定要遵守必须的系统目录架构原则
所有 mount point 在同一时间之内﹐只能挂载一次。
所有 partition 在同一时间之内﹐只能挂载一次。
如若进行卸除﹐您必须先将工作目录移到 mount point(及其子目录) 之外。

# /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).

#

/ was on /dev/sdb3 during installation

UUID=383dba93-95a2-4b34-9ebd-71d42e00a2b7 / ext4 errors=remount-ro 0 1
/dev/sda1 /opt ntfs users,gid=users,fmask=133,dmask=022,locale=en_US.UTF-8 0 0
/dev/sda2 /data ntfs users,gid=users,fmask=133,dmask=022,locale=en_US.UTF-8 0 0
/dev/sdb1 /win ntfs users,gid=users,fmask=133,dmask=022,locale=en_US.UTF-8,noatime 0 0
/dev/sdb2 /programe ntfs users,gid=users,fmask=133,dmask=022,locale=en_US.UTF-8,noatime 0 0

挂载设备,不是文件系统
这才是文件系统

备份命令:dump utility用来决定是否做备份的. dump会检查entry并用数字来决定是否对这个文件系统进行备份。允许的数字是0和1。如果是0,dump就会忽略这个文件系统,如果是1,dump就会作一个备份。大部分的用户是没有安装dump的,所以对他们而言这个entry应该写为0。 是否以fsck检验扇区:启动的过程中,系统默认会以fsck检验我们的 filesystem 是否完整 (clean)。 不过,某些 filesystem 是不需要检验的,例如内存置换空间 (swap) ,或者是特殊文件系统例如 /proc 与 /sys 等等。fsck会检查这个头目下的数字来决定检查文件系统的顺序,允许的数字是0, 1, 和2。0 是不要检验, 1 表示最早检验(一般只有根目录会配置为 1), 2 也是要检验,不过1会比较早被检验啦!一般来说,根目录配置为1,其他的要检验的filesystem都配置为 2 就好了。

noatime 关闭atime特性,提高性能,这是一个很老的特性,放心关闭,还能减少loadcycle
defaults 使用默认设置。等于rw,suid,dev,exec,auto,nouser,async,具体含义看下面的解释。
自动与手动挂载:
auto 在启动或在终端中输入mount -a时自动挂载
noauto 设备(分区)只能手动挂载
读写权限:
ro 挂载为只读权限
rw 挂载为读写权限
可执行:
exec 是一个默认设置项,它使在那个分区中的可执行的二进制文件能够执行
noexec 二进制文件不允许执行。千万不要在你的root分区中用这个选项!!!
I/O同步:
sync 所有的I/O将以同步方式进行
async 所有的I/O将以非同步方式进行
户挂载权限:
user 允许任何用户挂载设备。 Implies noexec,nosuid,nodev unless overridden.
nouser 只允许root用户挂载。这是默认设置。
临时文件执行权限:
suid Permit the operation of suid, and sgid bits. They are mostly used to allow users on a computer system to execute binary executables with temporarily elevated privileges in order to perform a specific task.
nosuid Blocks the operation of suid, and sgid bits.

1 对 “/etc/fstab详解”的想法;

回复 蒂欧娜 取消回复

您的电子邮箱地址不会被公开。 必填项已用*标注

Captcha Code