You are not logged in.

#1 2020-07-17 19:17:56

nanoak
Member
Registered: 2018-09-30
Posts: 6

Mount SMB share at startup problems

Hi,

I'm trying to mount a SMB share, and I can mount it from the terminal with this command:

mount -t cifs //192.168.1.160/cigala /mnt/NAS -o username=nanoak,password='xxxxxxxx'

this is the line I have in my /etc/fstab

//192.168.1.160/cigala  /mnt/NAS    cifs    users,uid=1000,gid=users,credentials=/home/nanoak/.config/smb/nan 0 0

Problem is, it doesn't mount from startup. This is the message I'm getting in /var/log/boot.log

[  OK  ] Reached target Network is Online.
Mounting /mnt/NAS...
[  OK  ] Mounted /mnt/Almacen.
[FAILED] Failed to mount /mnt/NAS.
See 'systemctl status mnt-NAS.mount' for details.
[DEPEND] Dependency failed for Remote File Systems.

So I take a look at systemctl

systemctl status mnt-NAS.mount

And this is what I get

● mnt-NAS.mount - /mnt/NAS
     Loaded: loaded (/etc/fstab; generated)
     Active: failed (Result: exit-code) since Fri 2020-07-17 20:16:22 CEST; 34min ago
      Where: /mnt/NAS
       What: //192.168.1.160/cigala
       Docs: man:fstab(5)
             man:systemd-fstab-generator(8)

jul 17 20:16:22 archlinux systemd[1]: Mounting /mnt/NAS...
jul 17 20:16:22 archlinux mount[569]: mount error(2): No such file or directory
jul 17 20:16:22 archlinux mount[569]: Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)
jul 17 20:16:22 archlinux systemd[1]: mnt-NAS.mount: Mount process exited, code=exited, status=32/n/a
jul 17 20:16:22 archlinux systemd[1]: mnt-NAS.mount: Failed with result 'exit-code'.
jul 17 20:16:22 archlinux systemd[1]: Failed to mount /mnt/NAS.

What I'm missing?

EDIT* I'm using dhcpcd.service

Last edited by nanoak (2020-07-17 19:27:35)

Offline

#2 2020-07-17 21:09:25

Buddlespit
Member
From: Chesapeake, Va.
Registered: 2014-02-07
Posts: 501

Re: Mount SMB share at startup problems

My options for my shares contain a little more than yours does (and mine is mounted via systemd, so I don't have an fstab line)

username=uid=1000,gid=1000,credentials=/blah/blah/.blah,auto,x-systemd.automount,iocharset=utf8

Both of my samba shares are mounted when I boot in. Both shares require=network-online.target, after=NetworkManager.service

Offline

#3 2020-07-17 21:40:49

nanoak
Member
Registered: 2018-09-30
Posts: 6

Re: Mount SMB share at startup problems

Can you show me your unit file please?

Offline

#4 2020-07-19 12:10:42

Buddlespit
Member
From: Chesapeake, Va.
Registered: 2014-02-07
Posts: 501

Re: Mount SMB share at startup problems

Homes is a protected share and Shares is unprotected, all-access
mnt-Home.mount:

[Unit]
  Description=Home cifs mount script
  Requires=network-online.target
  After=NetworkManager.service

[Mount]
  What=//192.168.1.13/Homes
  Where=/mnt/Home
  Options=username=uid=1000,gid=1000,credentials=/blah/blah/.blah,auto,x-systemd.automount,iocharset=utf8
  Type=cifs

[Install]
  WantedBy=multi-user.target

mnt-Shares.mount:

[Unit]
  Description= Shares cifs mount script
  Requires=network-online.target
  After=NetworkManager.service

[Mount]
  What=//192.168.1.13/Shares
  Where=/mnt/Shares
  Options=username=guest,noperm,x-systemd.automount,iocharset=utf8
  Type=cifs

[Install]
  WantedBy=multi-user.target

My samba server smb.conf (just in case):

#======================= Global Settings =====================================
[global]

   workgroup = DEBRIELLA
   server string = Samba Server
   log file = /var/log/samba/%m.log
   max log size = 50
   map to guest = Bad User
   preferred master = yes
   socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=65536 SO_SNDBUF=65536
   domain Master = yes

#============================ Share Definitions ==============================

[Homes]
   comment = Home Directories
   browseable = no
   read only = no
   create mask = 0700
   directory mask = 0700
   valid users = %S
   inherit acls = Yes

[Shares]
   comment = Media Shares
   path = /share
   browseable = yes
   read only = no
   guest ok = yes
   create mask = 0777
   directory mask = 0777
   force user = nobody
   force group = nobody

Last edited by Buddlespit (2020-07-19 12:17:28)

Offline

#5 2020-07-19 20:58:31

nanoak
Member
Registered: 2018-09-30
Posts: 6

Re: Mount SMB share at startup problems

Thanks!

Offline

Board footer

Powered by FluxBB