是什么导致了“mount: /etc/fstab: 第 16 行解析错误——忽略”错误?

是什么导致了“mount: /etc/fstab: 第 16 行解析错误——忽略”错误?

我试图在我的计算机上安装 5 个 Samba 共享,但一直收到相同的 5 个错误:

mount: /etc/fstab: parse error at line 16 -- ignored
mount: /etc/fstab: parse error at line 17 -- ignored
mount: /etc/fstab: parse error at line 18 -- ignored
mount: /etc/fstab: parse error at line 19 -- ignored
mount: /etc/fstab: parse error at line 20 -- ignored

以下是我的 /etc/fstab 文件中有问题的行:

//10.0.0.23/Documents "/home/alex/Network Shares/Documents" cifs credentials=/home/alex/.smbcredentials,uid=user,gid=group 0 0
"//10.0.0.23/Family Pictures" "/home/alex/Network Shares/Family Pictures" cifs credentials=/home/alex/.smbcredentials,uid=user,gid=group 0 0
//10.0.0.23/Scripts "/home/alex/Network Shares/Scripts" cifs credentials=/home/alex/.smbcredentials,uid=user,gid=group 0 0
//10.0.0.23/Shared "/home/alex/Network Shares/Shared" cifs credentials=/home/alex/.smbcredentials,uid=user,gid=group 0 0
//10.0.0.23/Torrents "/home/alex/Network Shares/Torrents" cifs credentials=/home/alex/.smbcredentials,uid=user,gid=group 0 0

任何帮助,将不胜感激。

答案1

您的空格应该被替换为,\040因此fstab它应该看起来像:

//10.0.0.23/Documents home/alex/Network\040Shares/Documents cifs credentials=/home/alex/.smbcredentials,uid=user,gid=group 0 0
//10.0.0.23/Family\040Pictures /home/alex/Network\040Shares/Family\040Pictures cifs credentials=/home/alex/.smbcredentials,uid=user,gid=group 0 0
//10.0.0.23/Scripts /home/alex/Network\040Shares/Scripts cifs credentials=/home/alex/.smbcredentials,uid=user,gid=group 0 0
//10.0.0.23/Shared /home/alex/Network\040Shares/Shared cifs credentials=/home/alex/.smbcredentials,uid=user,gid=group 0 0
//10.0.0.23/Torrents /home/alex/Network\040Shares/Torrents cifs credentials=/home/alex/.smbcredentials,uid=user,gid=group 0 0

看:

https://www.linuxquestions.org/questions/linux-newbie-8/fstab-space-in-mount-point-directory-names-846362/

相关内容