我有一个CIFS安装在fstab中,它工作正常,除非网络或远程服务器出了问题,而且无法恢复。我想在失败的情况下自动重装这个份额,但是从我所读到的情况来看,这是不支持的。
我现在所做的是将它移到autofs挂载上,这是公平的,但我总是发现autofs挂载相对于fstab (只是我在命令行上的视觉感知)有点滞后。有谁有过其他解决方案的经验吗?
发布于 2018-07-14 04:41:19
至于重新挂载在您的/etc/fstab中,您可以使用此方法强制重装:
$ sudo mount -a -t cifs根据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然后,您可以在shell脚本中放置一个检查,该脚本将强制mount -a -t cifs命令根据计划的时间运行,或者使用inotify或其他将验证挂载状态的方法进行检查,如果检测到它们失败,请运行我前面提供的mount ..命令。
https://unix.stackexchange.com/questions/455094
复制相似问题