You are not logged in.

#1 2020-01-20 16:50:17

yoghurt
Member
Registered: 2020-01-11
Posts: 4

[SOLVED] Interesting mount behavior with smb network drive

Hi, I'm currently working on making my arch installation mount my network drives with smb.
My goal is to be able to mount the network drive with fstab, so it's always visible in thunar.

I'm currently trying to get the following command to work:

 $ sudo mount -t cifs //yoghurt-NAS/photo ~/MAS -o credentials=/root/.cifs,vers=1.0
mount error: could not resolve address for yoghurt-NAS: Unknown error 

As you can see it can't resolve the name yoghurt-NAS.
However if i run:

 $ nmblookup yoghurt-NAS
10.10.72.127 yoghurt-NAS<00>

It returns the ip address just fine.
I can mount the drive if i use the ip instead of the hostname, but i can't rely on the ip not changing.

So i guess I'm having an issue with resolving the netbios name for my network drive.
After having a good look at the wiki article on Samba, i have added 'wins' to /etc/nsswitch.conf:

hosts: files wins mymachines myhostname resolve [!UNAVAIL=return] dns

and I've enabled the winbind.service with "systemctl enable winbind".

So when my system has just booted and i run:

$ systemctl status winbind
● winbind.service - Samba Winbind Daemon
     Loaded: loaded (/usr/lib/systemd/system/winbind.service; enabled; vendor preset: disabled)
     Active: active (running) since Mon 2020-01-20 17:12:44 CET; 23min ago
       Docs: man:winbindd(8)
             man:samba(7)
             man:smb.conf(5)
   Main PID: 542 (winbindd)
     Status: "winbindd: ready to serve connections..."
      Tasks: 2 (limit: 19054)
     Memory: 23.8M
     CGroup: /system.slice/winbind.service
             ├─542 /usr/bin/winbindd --foreground --no-process-group
             └─663 winbindd: domain child [ARCH]

Jan 20 17:12:42 arch winbindd[542]:   reopen_one_log: Unable to open new log file '/usr/local/samba/var/log.winbindd': No such file or directory
Jan 20 17:12:42 arch winbindd[542]: [2020/01/20 17:12:42.831058,  0] ../../lib/util/debug.c:1090(reopen_one_log)
Jan 20 17:12:42 arch winbindd[542]:   reopen_one_log: Unable to open new log file '/usr/local/samba/var/log.winbindd': No such file or directory
Jan 20 17:12:42 arch winbindd[542]: [2020/01/20 17:12:42.865096,  0] ../../source3/winbindd/winbindd_cache.c:3164(initialize_winbindd_cache)
Jan 20 17:12:42 arch winbindd[542]:   initialize_winbindd_cache: clearing cache and re-creating with version number 2
Jan 20 17:12:42 arch winbindd[542]: [2020/01/20 17:12:42.925181,  0] ../../lib/util/become_daemon.c:135(daemon_ready)
Jan 20 17:12:42 arch winbindd[542]:   daemon_ready: daemon 'winbindd' finished starting up and ready to serve connections
Jan 20 17:12:42 arch winbindd[663]: [2020/01/20 17:12:42.926423,  0] ../../lib/util/debug.c:1090(reopen_one_log)
Jan 20 17:12:42 arch winbindd[663]:   reopen_one_log: Unable to open new log file '/usr/local/samba/var/log.wb-ARCH': No such file or directory
Jan 20 17:12:44 arch systemd[1]: Started Samba Winbind Daemon.

It shows some messages about being unable to open some log file.
If i restart winbind:

 $ systemctl restart winbind 

The mount command suddenly works.
I can mount it as i would have wanted at first with:

$ sudo mount -t cifs //yoghurt-NAS/photo ~/MAS -o credentials=/root/.cifs,vers=1.0

The status from winbind is now:

]$ systemctl status winbind
● winbind.service - Samba Winbind Daemon
     Loaded: loaded (/usr/lib/systemd/system/winbind.service; enabled; vendor preset: disabled)
     Active: active (running) since Mon 2020-01-20 17:39:36 CET; 3min 23s ago
       Docs: man:winbindd(8)
             man:samba(7)
             man:smb.conf(5)
   Main PID: 2354 (winbindd)
     Status: "winbindd: ready to serve connections..."
      Tasks: 2 (limit: 19054)
     Memory: 25.2M
     CGroup: /system.slice/winbind.service
             ├─2354 /usr/bin/winbindd --foreground --no-process-group
             └─2356 winbindd: domain child [ARCH]

Jan 20 17:39:36 arch winbindd[2354]:   reopen_one_log: Unable to open new log file '/usr/local/samba/var/log.winbindd': No such file or directory
Jan 20 17:39:36 arch winbindd[2354]: [2020/01/20 17:39:36.270216,  0] ../../lib/util/debug.c:1090(reopen_one_log)
Jan 20 17:39:36 arch winbindd[2354]:   reopen_one_log: Unable to open new log file '/usr/local/samba/var/log.winbindd': No such file or directory
Jan 20 17:39:36 arch winbindd[2354]: [2020/01/20 17:39:36.276542,  0] ../../source3/winbindd/winbindd_cache.c:3164(initialize_winbindd_cache)
Jan 20 17:39:36 arch winbindd[2354]:   initialize_winbindd_cache: clearing cache and re-creating with version number 2
Jan 20 17:39:36 arch winbindd[2354]: [2020/01/20 17:39:36.277896,  0] ../../lib/util/become_daemon.c:135(daemon_ready)
Jan 20 17:39:36 arch winbindd[2354]:   daemon_ready: daemon 'winbindd' finished starting up and ready to serve connections
Jan 20 17:39:36 arch systemd[1]: Started Samba Winbind Daemon.
Jan 20 17:39:36 arch winbindd[2356]: [2020/01/20 17:39:36.278656,  0] ../../lib/util/debug.c:1090(reopen_one_log)
Jan 20 17:39:36 arch winbindd[2356]:   reopen_one_log: Unable to open new log file '/usr/local/samba/var/log.wb-ARCH': No such file or directory

Not much of a difference!
So I'm wondering why wouldn't winbindd work before i restart windbind.service manually. It would be nice if it just worked reliably immediately after boot.

Further debug info:

The command:

$ getent -s wins ahosts yoghurt-NAS

doesn't output anything before restarting winbindd, but outputs the correct ip after restarting winbindd.

Last edited by yoghurt (2020-01-20 18:07:06)

Offline

#2 2020-01-20 17:19:42

yoghurt
Member
Registered: 2020-01-11
Posts: 4

Re: [SOLVED] Interesting mount behavior with smb network drive

Additionally:

I created the director /usr/local/samba/var/ to get rid of the log warnings.
status now looks like:

$ systemctl status winbind
● winbind.service - Samba Winbind Daemon
     Loaded: loaded (/usr/lib/systemd/system/winbind.service; enabled; vendor preset: disabled)
     Active: active (running) since Mon 2020-01-20 18:18:13 CET; 24s ago
       Docs: man:winbindd(8)
             man:samba(7)
             man:smb.conf(5)
   Main PID: 1662 (winbindd)
     Status: "winbindd: ready to serve connections..."
      Tasks: 2 (limit: 19054)
     Memory: 4.5M
     CGroup: /system.slice/winbind.service
             ├─1662 /usr/bin/winbindd --foreground --no-process-group
             └─1664 winbindd: domain child [ARCH]

Jan 20 18:18:13 arch systemd[1]: Starting Samba Winbind Daemon...
Jan 20 18:18:13 arch winbindd[1662]: [2020/01/20 18:18:13.874244,  0] ../../source3/winbindd/winbindd_cache.c:3164(initialize_winbindd_cache)
Jan 20 18:18:13 arch winbindd[1662]:   initialize_winbindd_cache: clearing cache and re-creating with version number 2
Jan 20 18:18:13 arch winbindd[1662]: [2020/01/20 18:18:13.875355,  0] ../../lib/util/become_daemon.c:135(daemon_ready)
Jan 20 18:18:13 arch winbindd[1662]:   daemon_ready: daemon 'winbindd' finished starting up and ready to serve connections
Jan 20 18:18:13 arch systemd[1]: Started Samba Winbind Daemon.

Offline

#3 2020-01-20 18:06:44

yoghurt
Member
Registered: 2020-01-11
Posts: 4

Re: [SOLVED] Interesting mount behavior with smb network drive

woop!
found a solution here:
https://bugs.launchpad.net/ubuntu/+source/samba/+bug/1789097]

Marking as solved smile

Offline

Board footer

Powered by FluxBB