在 Gentoo 中,我记得有一个单独的/etc/init.d条目用于挂载网络驱动器(即与本地驱动器分开)。在 Ubuntu 中,有umountnfs.sh, 在关机期间使用(以确保在网络仍然可用时干净卸载),并且可以使用它卸载所有(当前安装的)网络驱动器。
但是,我缺少一种快速的方法
/etc/fstab尚未启动的所有网络驱动器,和/或与单行 shell hack 相比,我更喜欢维护的 3rd 方解决方案。
ter*_*don 16
您正在寻找 的-t标志mount。来自man mount:
-t, --types vfstype
[...]
More than one type may be specified in a comma separated list.
The list of filesystem types can be prefixed with no to specify
the filesystem types on which no action should be taken. (This
can be meaningful with the -a option.) For example, the command:
mount -a -t nomsdos,ext
Run Code Online (Sandbox Code Playgroud)
因此,此命令将挂载所有cifs文件系统:
sudo mount -a -t cifs
Run Code Online (Sandbox Code Playgroud)
我刚刚发现该-t选项mount可以与 结合使用-a,这样
sudo mount -a -t cifs
Run Code Online (Sandbox Code Playgroud)
做我需要的。(sudo mount -a -t cifs -o remount也可以在权限/密码更改后重新安装。)