CIFS moutn in /etc/fstab behave randomly

This forum is for Marvell Kirkwood devices such as the GoFlex Home/Net, PogoPlug v1/v2, SheevaPlug, and ZyXEL devices.

CIFS moutn in /etc/fstab behave randomly

Postby jerry0000 » Fri Dec 21, 2012 6:00 am

Hi,

I have 3 samba shares setup in /etc/fstab, which looks like:

//server/share1 /local/dir1 cifs ro,iocharset=utf8,username=user,password=pass 0 0
//server/share2 /local/dir2 cifs ro,iocharset=utf8,username=user,password=pass 0 0
//server/share3 /local/dir3 cifs ro,iocharset=utf8,username=user,password=pass 0 0

However, I found mount on boot is random. Sometimes, I get one share mounted, sometimes 2 (randomly). Have not get all 3 mounted at the same time yet.

The setting should be all correct, as I can manually mount using "mount -t cifs" to mount all the shares.

After some reading, it seems to be may be /etc/fstab is processed before network is fully up, so I installed "networkmanager" and enabled service delay:

systemctl enable NetworkManager-wait-online.service

However, that did not help, as after I reboot, I still get only 2 (different from last time) of the 3 shares mounted.

Any solution to make sure all 3 shares are consistently mounted at boot?

Thanks,
Jerry
jerry0000
 
Posts: 57
Joined: Tue Dec 11, 2012 5:38 am

Re: CIFS moutn in /etc/fstab behave randomly

Postby jerry0000 » Fri Dec 21, 2012 6:12 am

I rebooted, run:

systemctl enable NetworkManager-wait-online.service

one more time, and rebooted again. I got all 3 shares mounted the first time. Hope it stay that way.

edit to add:

did not work consistently.
Last edited by jerry0000 on Fri Dec 21, 2012 5:13 pm, edited 1 time in total.
jerry0000
 
Posts: 57
Joined: Tue Dec 11, 2012 5:38 am

Re: CIFS moutn in /etc/fstab behave randomly

Postby karog » Fri Dec 21, 2012 2:38 pm

Add _netdev to your options (and yes the underscore is part of the option name). This insures the network is up before it tries the mount.
karog
 
Posts: 305
Joined: Thu Jan 05, 2012 7:55 pm

Re: CIFS moutn in /etc/fstab behave randomly

Postby jerry0000 » Fri Dec 21, 2012 4:54 pm

I tried _netdev. Still did not work consistently.

Any help to get CIFS mounted consistently? I am using both networkmanager wait-on-line and _netdev in /etc/fstab, and it is still not working.
jerry0000
 
Posts: 57
Joined: Tue Dec 11, 2012 5:38 am

Re: CIFS moutn in /etc/fstab behave randomly

Postby jerry0000 » Fri Dec 21, 2012 5:21 pm

Is there any service need to be enabled at boot up for cifs mount?

I only installed cifs utils. Did not install sambaclient.
jerry0000
 
Posts: 57
Joined: Tue Dec 11, 2012 5:38 am

Re: CIFS moutn in /etc/fstab behave randomly

Postby jerry0000 » Fri Dec 21, 2012 7:21 pm

Additionally, this Pogoplug is being setup mainly as a DLNA server, to serve media from a Promise NAS (the CIFS shares). The Promise NAS (4300N) is a bit (old and) underpowered. I tested the DLNA plugin on the NAS itself, and the performance is poor. It is not even as good as the DLNA server on my ASUS router, thus I am trying to setup the DLNA server on a Pogoplug.

So besides trying to get CIFS shares mounted reliably, I also have to make sure the minidlna server starts after the shares are mounted. Any settings to ensure this?

Thanks,
Jerry
jerry0000
 
Posts: 57
Joined: Tue Dec 11, 2012 5:38 am

Re: CIFS moutn in /etc/fstab behave randomly

Postby moonman » Fri Dec 21, 2012 10:47 pm

_netdev is ignored by cifs so it has no effect. I suppose what you could do is use netcfg POST_UP= and put your mount commands there. Also use IP instead of computer network name as it takes time to resolve the names unless you are running wins server on the network.
Pogoplug V4 | GoFlex Home | Raspberry Pi 4 4GB | CuBox-i4 Pro | ClearFog | BeagleBone Black | Odroid U2 | Odroid C1 | Odroid XU4
-----------------------------------------------------------------------------------------------------------------------
[armv5] Updated U-Boot | [armv5] NAND Rescue System
moonman
Developer
 
Posts: 3388
Joined: Sat Jan 15, 2011 3:36 am

Re: CIFS moutn in /etc/fstab behave randomly

Postby jerry0000 » Fri Dec 21, 2012 11:49 pm

user IP is good idea.

Can you detail on netcfg? I am not a linux newbie, however newbie to arch.

Also, can I start minidlna in netcfg as well after mount, to ensure DLNA server have access to the files? Of course, that will require to disable minidlna from systemd.

Also, why
systemctl enable NetworkManager-wait-online.service

would not work either?
jerry0000
 
Posts: 57
Joined: Tue Dec 11, 2012 5:38 am

Re: CIFS moutn in /etc/fstab behave randomly

Postby jerry0000 » Sat Dec 22, 2012 12:05 am

using IP did not seem to help. I only get 1 share mounted instead of the usual 2 out of 3.

Add:
seems that
systemctl enable NetworkManager-wait-online.service

did harm rather than good. I disabled and removed network manger, and rebooted, got all 3 shares mounted

I will have to test if this is reliable though
jerry0000
 
Posts: 57
Joined: Tue Dec 11, 2012 5:38 am

Re: CIFS moutn in /etc/fstab behave randomly

Postby karog » Sat Dec 22, 2012 12:41 am

If that is not reliable, take a look at Cannot automount Samba share from fstab and a solution near the end using noauto,x-systemd.automount options to mount on first use. But also see that there are some hang issues unmounting and links to that.

It appears lots of people have run into this problem for years now and it is surprising it hasn't been dealt with more cleanly.
karog
 
Posts: 305
Joined: Thu Jan 05, 2012 7:55 pm

Next

Return to Marvell Kirkwood

Who is online

Users browsing this forum: No registered users and 13 guests