-a, --all
Mount all filesystems (of the given types) mentioned in fstab (except for those whose line contains the noauto keyword). The filesystems are
mounted following their order in fstab.
和
remount
Attempt to remount an already-mounted filesystem. This is commonly used to change the mount flags for a filesystem, especially to make a
readonly filesystem writable. It does not change device or mount point.
The remount functionality follows the standard way the mount command works with options from fstab. This means that the mount command only
doesn't read fstab (or mtab) when both the device and dir are specified.
mount -o remount,rw /dev/foo /dir
After this call all old mount options are replaced and arbitrary stuff from fstab (or mtab) is ignored, except the loop= option which is
internally generated and maintained by the mount command.
mount -o remount,rw /dir
After this call mount reads fstab and merges these options with the options from the command line (-o). If no mountpoint found in fstab than
remount with unspecified source is allowed.
man mount
说:和
所以,这就是区别。
现在修改后应该使用什么
/etc/fstab
?嗯,这取决于。如果您有许多未挂载的文件系统/etc/fstab
,mount -a
则将它们全部挂载。这可能不是您想要的,但也可能正是您想要的。如果
/dir
尚未挂载,您可以简单地mount /dir
,这将/etc/fstab
单独提及其余文件系统。取自 MAN 页面:
因此,根据 MAN 页面,它们之间的区别在于读取 fstab 文件,修改后,如果要全部挂载,则应使用mount -a否则,如果您只想挂载目录,则应使用其他选项。