You are not logged in.

#1 2013-11-08 11:00:50

Llama
Banned
From: St.-Petersburg, Russia
Registered: 2008-03-03
Posts: 1,379

[SOLVED] Samba shares in fstab: race condition?

Hi,

I put the following samba shares in /etc/fstab:

//192.168.0.125/Obmen /home/alexey/smb4k/WSERVER/Obmen cifs uid=1000,username=uname,password=passwd 0 0

//192.168.0.125/БОС /home/alexey/smb4k/WSERVER/БОС cifs uid=1000,username=uname,password=passwd 0 0

This configuration always passes

$ sudo mount -a

but on boot one of the shares may be mounted unsuccessfully. The probability of total success is about 0.5, that is.

KDE, NetworkManager, everything by default, so far as I know. What would be the correct approach?

There's a lot of options in ArchWiki, but it is not obvious which ways are obsolete or too special. I'd be grateful for any KISS suggestion.

Last edited by Llama (2013-11-08 12:35:47)

Offline

#2 2013-11-08 11:57:37

Awebb
Member
Registered: 2010-05-06
Posts: 6,662

Re: [SOLVED] Samba shares in fstab: race condition?

Your network connection needs to be established before fstab parses the samba entry. The "problem" here is, that systemd tries to start as many services parallel as possible, so there is a chance, that the network connection has not been established by the time fstab is parsed and the share is mounted.

Offline

#3 2013-11-08 12:33:47

Llama
Banned
From: St.-Petersburg, Russia
Registered: 2008-03-03
Posts: 1,379

Re: [SOLVED] Samba shares in fstab: race condition?

Awebb wrote:

Your network connection needs to be established before fstab parses the samba entry. The "problem" here is, that systemd tries to start as many services parallel as possible, so there is a chance, that the network connection has not been established by the time fstab is parsed and the share is mounted.

That's probably it. Looks like this one will do, /etc/fstab:

//192.168.0.125/Obmen /home/alexey/smb4k/WSERVER/Obmen cifs noauto,uid=1000,credentials=/home/alexey/.smbcredentials,x-systemd.automount 0 0

//192.168.0.125/БОС /home/alexey/smb4k/WSERVER/БОС cifs noauto,uid=1000,credentials=/home/alexey/.smbcredentials,x-systemd.automount 0 0

More or less straight dope on the subject. The killer of the race condition is noauto,x-systemd.automount.

Offline

#4 2013-11-09 00:38:14

Awebb
Member
Registered: 2010-05-06
Posts: 6,662

Re: [SOLVED] Samba shares in fstab: race condition?

That's even better than my initial thought, well done. I would probably have written my own mount unit or something along the lines.

Offline

Board footer

Powered by FluxBB