You are not logged in.

#1 2016-01-28 10:39:14

roguewolf
Member
From: UK
Registered: 2012-05-28
Posts: 32

[SOLVED] CIFS share listed in fstab not mounting on boot/automatically

Hi,

I have the following line in /etc/fstab:

//192.168.16.21/home        /home/wolf/ds01_wolf        cifs    auto,nofail,x-systemd.automount,x-systemd.requires=network-online.target,x-systemd.device-timeout=10,workgroup=workgroup,credentials=/etc/smbcreds2,sec=ntlmv2 0 0

Which I can mount with

sudo mount ds01_wolf

but it doesn't mount at boot.

I believe the share should be mounting at boot based on the above, but am I missing something?

Also, automount should mount on access, but if I run

ls ds01_wolf

I see an empty directory which suggests that isn't working either?

I've done some research about fstab, systemd.mount/automount and am prepared to do more but would appreciate some pointers as to where to start, please.

Last edited by roguewolf (2016-01-28 15:48:20)

Offline

#2 2016-01-28 13:41:59

olive
Member
From: Belgium
Registered: 2008-06-22
Posts: 1,490

Re: [SOLVED] CIFS share listed in fstab not mounting on boot/automatically

I would guess that systemd is trying to mount it too early, although I see you have passed some options in this sense. You should examine the content of journalctl. Also, in order to diagnose the problem, remove the option nofail, so that it would be easier to see when/why it fails.

Offline

#3 2016-01-28 14:39:59

roguewolf
Member
From: UK
Registered: 2012-05-28
Posts: 32

Re: [SOLVED] CIFS share listed in fstab not mounting on boot/automatically

Thanks Olive.

I wondered about the too-early mount but assumed that the x-systemd.requires=network-online.target option would avoid that issue?

journalctl isn't showing any errors concerning mount/automount - or anything else that looks related - even after removing the nofail option.

All further suggestions gratefully received smile

Offline

#4 2016-01-28 15:47:46

roguewolf
Member
From: UK
Registered: 2012-05-28
Posts: 32

Re: [SOLVED] CIFS share listed in fstab not mounting on boot/automatically

I've managed to solve the issue by manually creating unit files for the mounts in /etc/systemd/system; e.g.:

[Unit]
Description = My share

[Mount]
What = //192.168.16.21/home
Where = /home/wolf/ds01_wolf
Type = cifs
Options = uid=wolf,gid=users,credentials=/etc/smbcreds2

[Install]
WantedBy = multi-user.target

Then enabling them with:

systemctl enable home-wolf-ds01_wolf.mount

Which causes them to mount successfully at boot.

The only 'downside', is that if I want/need to mount them manually I have to do so with:

systemctl start home-wolf-ds01_wolf.mount

instead of:

mount ds01_wolf

It just remains to try to determine what caused the fstab version to fail to mount at boot. I suspect it might be down to something in the fstab entry's options as the Options in the unit file's [Mount] section are reduced in comparison.

Offline

#5 2018-06-20 00:02:15

Noki
Member
Registered: 2018-06-08
Posts: 98

Re: [SOLVED] CIFS share listed in fstab not mounting on boot/automatically

Stripped to make a new thread, but this link is useful to have here.

https://unix.stackexchange.com/question … ame#345518

Last edited by Noki (2018-06-20 00:10:40)

Offline

#6 2018-06-20 00:08:15

circleface
Member
Registered: 2012-05-26
Posts: 639

Re: [SOLVED] CIFS share listed in fstab not mounting on boot/automatically

Please do not necrobump old threads, especially solved ones.  If you are still having the same problem, please open a new thread and describe the errors and what you have done in detail.

Offline

#7 2018-06-20 00:10:47

Noki
Member
Registered: 2018-06-08
Posts: 98

Re: [SOLVED] CIFS share listed in fstab not mounting on boot/automatically

OK sure thing.

Offline

#8 2018-06-20 00:25:30

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] CIFS share listed in fstab not mounting on boot/automatically

Closing


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

Board footer

Powered by FluxBB