Alternative to NFS or better configuration - instable network, simple to set up

We are currently using NFSv4 for file sharing in a small office.

Unfortunately the network is not very stable and it seems to have huge impact on the Ubuntu clients if the network is gone: The whole system freezes - I think this is due to the nfs mount.

So what would be the alternatives to make files available on the network?

I am used to Samba, but this does not seem to be right, as only Linux is involved.

Security is not an issue in the network.


Solution 1:

You are probably getting freezes because you are exporting NFS shares with the "hard" option (which is the default). You can change that by using explicitly the "soft" option. The NFS man page has more.

mount -o soft <nfs server ip>:/mountpoint /local_mountpoint

Then in the clients you should no longer have a problem with freezes.

As for a convenient way to implement file sharing, among Linux boxes, NFS is the way. I confess, I too, didn't think the NFS was as versatile as Samba, but if you follow a couple of guidelines NFS can work completely transparently.

  • create the folder /nfs and make links in it for all the folders you want to share.
  • update your /etc/exports file with paths to this /nfs folder.
  • using automount utilities in the clients in order to automate the process of mounting transparently.
  • last but not least, verify that each username on the server and on the clients has the same UID. This way users can access their files (without permission problems) from every client. (if LDAP or NIS is used, then this option is inferred).

Hope this helps.

Solution 2:

I agree with the comment from Frank Thomas, using Linux does not preclude you from using Samba. I would prefer NFS shares in an all Linux environment as do a lot of other people but Samba is perfectly fine as well. It is not the only solution to your problem though. Try looking at your NFS mount options. Specifically, look into the intr, soft, tcp, timeo= and retry= options to see if any apply to your environment.

More info can be found here: RHEL 6 Common NFS Mount Options

You can also just man nfs and/or man mount which I use all the time to remind myself of what is available.