Disappearing nfs mount

The place to post if you need help or advice

Moderators: ChrisThornett, LXF moderators

Disappearing nfs mount

Postby mengoshmink » Sat Jan 18, 2014 6:55 pm

Hi all,

I'm having an annoyance with NFS. For the most part it works great to my Linux clients and WDTV Lives but I have a couple of shares for just me that are not working as hoped. The archive share works fine but the tmp share is an example of the share that (seems to) randomly disappear. If I change the tmp line in /etc/exports so that it is available to the whole network, ie the same as archive, the problem goes away.

All the information below I believe to be relevant but to keep things simple I have only listed two shares.

On the server:
server ~]$ ls -lh /mnt/store/
drwxrwxr-x. 12 mengoshmink users 4.0K Dec 27 2012 tmp

server ~]$ ls -lh /mnt/store/tmp/
drwxrwxr-x. 7 mengoshmink users 4.0K Sep 21 2012 Archive


server ~]$ cat /etc/fstab
Code: Select all
/dev/vg_server/lv_store   /mnt/store   ext4   defaults   1 2

/mnt/store/tmp                  /mnt/nfs/tmp            none  bind  0 0
/mnt/store/tmp/Archive          /mnt/nfs/archive        none  bind  0 0


server ~]$ ls -lh /mnt/nfs/
drwxrwxr-x. 7 mengoshmink users 4.0K Sep 21 2012 archive
drwxrwxr-x. 12 mengoshmink users 4.0K Dec 27 2012 tmp


server ~]$ cat /etc/exports
Code: Select all
/mnt/nfs                192.168.1.0/24(ro,sync,root_squash,fsid=0)
/mnt/nfs/tmp            client(ro,sync,root_squash)
/mnt/nfs/archive        192.168.1.0/24(ro,sync,root_squash)


I know the /etc/sysconfig/nfs needs tidying up but I do not believe the problem is from its current configuration.
server ~]# nano /etc/sysconfig/nfs
Code: Select all
# Port rquotad should listen on.
RQUOTAD_PORT=875
# TCP port rpc.lockd should listen on.
LOCKD_TCPPORT=32803
# UDP port rpc.lockd should listen on.
LOCKD_UDPPORT=32769
# Port rpc.mountd should listen on.
MOUNTD_PORT=892
# Port rpc.statd should listen on.
STATD_PORT=662
# Outgoing port statd should used. The default is port
# is random
STATD_OUTGOING_PORT=2020


server ~]# service nfs status
rpc.svcgssd is stopped
rpc.mountd (pid 2672) is running...
nfsd (pid 2735 2734 2733 2732 2731 2730 2729 2728) is running...
rpc.rquotad (pid 2668) is running...


Firewall:
Source: Range (192.168.1.64 - 192.168.1.252)
Destination: Server eth0 (192.168.1.67)
Interface: Server eth0 (192.168.1.67)
Direction: Incoming
Ports: tcp/892, tcp/2049, udp/2049, tcp/111, udp/111

On the client:
client:~> cat /etc/fstab
Code: Select all
server:/tmp      /mnt/server/tmp      nfs4   defaults 0 0
server:/archive      /mnt/server/archive   nfs4   defaults 0 0


Any thoughts? Thank you.
Sharing knowledge is the best way to learn.
User avatar
mengoshmink
 
Posts: 9
Joined: Sun Oct 20, 2013 3:17 pm

Postby Dutch_Master » Sat Jan 18, 2014 9:27 pm

I'm not sure nesting NFS shares is a good idea, perhaps move the Archive directory to somewhere else in the tree (say tmp-archive or similar). Also, I use a different set of options for my NFS shares (one internal and 2 on different machines, although all in the same network) in fstab. Change the defaults option to
Code: Select all
rw,user,noauto
Also, I use NFS instead of NFS4 as the FS type in fstab and list/mount these shares under /media, not /mnt.

It means none of these shares are mounted at boot (which makes sense as not all machines are on 24/7) and it doesn't clutter up the desktop. But that's personal ;)
Dutch_Master
LXF regular
 
Posts: 2445
Joined: Tue Mar 27, 2007 1:49 am

Postby mengoshmink » Tue Jan 21, 2014 8:36 pm

Thanks for the reply Dutch_Master! I have tried a few things but unfortunately still no success.

I think you are right, nested shares is not a good idea. I have mount bind the folders to a new location so I didn't think it is causing the problem.

Do you think changing the mount options will help? I am used to seeing my mounted filesystems in /mnt which is why I used that folder and not /media. Also, I am using nfsv4 which is why I have used nfs4 in fstab but it shouldn't make a difference.

I tried creating a new NFS root today but that didn't help.

I have different options for exporting to my WDTV Live, they seem to work fine. Well, I have one problem but I think that is with the WDTV Live, not NFS.

FYI My server is on 24/7 because it is also my MythTV backend.

I will keep trying random things until it works ... :?
Sharing knowledge is the best way to learn.
User avatar
mengoshmink
 
Posts: 9
Joined: Sun Oct 20, 2013 3:17 pm

Postby Dutch_Master » Tue Jan 21, 2014 8:54 pm

As the server is running 24/7 I assume it's headless. Can I suggest putting Webmin on it and use that to create your NFS shares.

There's no reason that the NFS shares must be mounted at boot on your desktop. If, for some reason, the server is down, the boot sequence of your desktop will stall for a significant time (until mount times out) before proceeding. It will happen ;)
Dutch_Master
LXF regular
 
Posts: 2445
Joined: Tue Mar 27, 2007 1:49 am

Postby mengoshmink » Tue Jan 21, 2014 9:37 pm

I like your thinking! I was either going to install system-config-nfs or Webmin. Last weekend I added the Webmin repo but I haven't installed it, yet. I will and let you know what happens.

I agree. I used to have a shutdown delay with caused by my NFS mounts but recently not had any problems which is why I allowed them to be automount. When I re-create my NFS shares through Webmin / system-config-nfs I will change my mounting to noauto. Lets see what we find.
Sharing knowledge is the best way to learn.
User avatar
mengoshmink
 
Posts: 9
Joined: Sun Oct 20, 2013 3:17 pm


Return to Help!

Who is online

Users browsing this forum: No registered users and 1 guest