挂载无法与 systemd 配合使用(与 /etc/fstab 配合使用)

挂载无法与 systemd 配合使用(与 /etc/fstab 配合使用)

我在 /etc/fstab 中有一行用于挂载远程 samba 服务器

//192.168.1.11/wind  /media/fixe/wind         cifs noauto,user,username=XXX,password=YYY,rw  0 0 

我现在将使用 systemd 的自动挂载(我还有其他使用 systemd 安装到 NAS synology 的设备正在运行)。

所以我尝试了mnt-fixe-wind.mount

meloli@Asus-A17:/etc/systemd/system$ sudo nano mnt-fixe-wind.mount 


[Unit]
Description = My Share mount
Requires = dbus-org.freedesktop.nm-dispatcher.service
After = network-online.target
Wants = network-online.target

[Mount]
What = //192.168.1.11/wind
Where = /mnt/fixe/wind
Options = username=XXX,password=YYY,rw
Type = cifs
TimeoutSec = 30

[Install]
WantedBy = multi-user.target
                            

当尝试sudo systemctl start mnt-fixe-wind.mount输出时

    meloli@Asus-A17:/etc/systemd/system$ journalctl -xe                               
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- L'unité (unit) NetworkManager-dispatcher.service a commencé à démarrer.
janv. 28 08:59:39 Asus-A17 mount[15436]: mount error(22): Invalid argument
janv. 28 08:59:39 Asus-A17 mount[15436]: Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)
janv. 28 08:59:39 Asus-A17 systemd[1]: mnt-fixe.mount: Mount process exited, code=exited, status=32/n/a
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- An n/a= process belonging to unit mnt-fixe.mount has exited.
-- 
-- The process' exit code is 'exited' and its exit status is 32.
janv. 28 08:59:39 Asus-A17 systemd[1]: mnt-fixe.mount: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- The unit mnt-fixe.mount has entered the 'failed' state with result 'exit-code'.
janv. 28 08:59:39 Asus-A17 systemd[1]: Failed to mount My Share mount.
-- Subject: L'unité (unit) mnt-fixe.mount a échoué
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- L'unité (unit) mnt-fixe.mount a échoué, avec le résultat failed.
janv. 28 08:59:39 Asus-A17 systemd[1]: Dependency failed for My Share mount.
-- Subject: L'unité (unit) mnt-fixe-wind.mount a échoué
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- L'unité (unit) mnt-fixe-wind.mount a échoué, avec le résultat dependency.
janv. 28 08:59:39 Asus-A17 systemd[1]: mnt-fixe-wind.mount: Job mnt-fixe-wind.mount/start failed with result 'dependency'.
janv. 28 08:59:39 Asus-A17 kernel: CIFS: VFS: Malformed UNC in devname
janv. 28 08:59:39 Asus-A17 sudo[15431]: pam_unix(sudo:session): session closed for user root
janv. 28 08:59:39 Asus-A17 systemd[1]: Started Network Manager Script Dispatcher Service.
-- Subject: L'unité (unit) NetworkManager-dispatcher.service a terminé son démarrage
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- L'unité (unit) NetworkManager-dispatcher.service a terminé son démarrage, avec le résultat done.

挂载点已存在

meloli@Asus-A17:/etc/systemd/system$ cd /mnt/fixe/wind/
meloli@Asus-A17:/mnt/fixe/wind$ 

出了什么问题?有什么想法吗?

谢谢。

相关内容