[systemd-devel] fstab automount of a mdns samba share

Colin Guthrie gmane at colin.guthr.ie
Tue Sep 28 08:34:53 UTC 2021


Julian Sikorski wrote on 28/09/2021 07:37:
> W dniu 27.09.2021 o 16:38, François Cami pisze:
>> Hi,
>>
>> On Mon, Sep 27, 2021 at 4:05 PM Julian Sikorski <belegdol at gmail.com> 
>> wrote:
>>>
>>> Hi list,
>>>
>>> I am trying to set up an automount of my samba share. It works when I go
>>> by the IP address, i.e.
>>>
>>> //192.168.0.220/julian /mnt/openmediavault    cifs
>>> credentials=/home/julas/.credentials,uid=julas,gid=julas,vers=3.1.1,nobrl,auto 
>>>
>>> 0 0
>>
>> If this is in fstab, it's different from autofs/automount.
>> Try adding _netdev to mount options.
>>
>> François
> 
> Yes, this is in fstab. _netdev has helped, thanks! Would you mind 
> explaining why it was not required when the IP address was being used? 
> Network is needed either way.

I suspect it's just a race condition related to timeouts etc. Perhaps 
the retry/timeout logic of mounting via IP is better than name lookup 
timeouts etc.

_netdev is definitely the right fix here but depending on the 
portability of the machine (i.e. if it's a laptop) you may also want to 
look at x-systemd.automount option too to make it mount the path only 
when you try to access it rather than at boot. If not automount, then 
perhaps "x-systemd.mount-timeout=infinity,retry=9999" is also useful to 
make things more robust (although I'm not sure how these work with cifs).

See man systemd.mount for some more info.

HTHs

Col




-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
   Tribalogic Limited http://www.tribalogic.net/
Open Source:
   Mageia Contributor http://www.mageia.org/
   PulseAudio Hacker http://www.pulseaudio.org/
   Trac Hacker http://trac.edgewall.org/



More information about the systemd-devel mailing list