CIFS or NFS

Questions about Wi-Fi and other network devices, file sharing, firewalls, connection sharing etc
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
buteman
Level 4
Level 4
Posts: 331
Joined: Tue Nov 29, 2011 5:36 pm
Location: North Lincolnshire

CIFS or NFS

Post by buteman »

I have a raspberry pi with a 2TB drive connected to it. I set up samba and it works after a fashion.
We have 3 laptops, one with Mint Cinnamon 19.3 and the other two with Mint 20.1.
We only use Linux but on the Pi I had tried cifs.
There are what to me are annoying problems. If the laptop lids are closed then on opening them I have to

Code: Select all

sudo umount -a
sudo mount -a 
and then change the permissions for the share on the laptops back to what I want before the Pi can be accessed again.
Also the fstab syntax on the 20.1 has to be different to that on the 19.3
As we only use Linux it seems nfs would be better but I know little about it and am guessing that linux permissions would apply.
Any thoughts that might help me please.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Moonstone Man
Level 16
Level 16
Posts: 6054
Joined: Mon Aug 27, 2012 10:17 pm

Re: CIFS or NFS

Post by Moonstone Man »

buteman wrote: Wed Mar 03, 2021 5:33 pm Any thoughts that might help me please.
The problem isn't Linux Mint per se. It's the network management software down in the innards of the OS.

You have a similar situation on desktop machines, which usually never suspend or hibernate. What happens is that the mount point is left active when the connection goes dead, and that slows the machine to a crawl because the OS thinks the network is still there due to the network manager being stupid in not informing the OS to unmount the dead share. To make matters worse, the network manager's lack of smarts will always cause the OS to lock up applications that have files open on the network, especially the file manager.

There are only two solutions to this, 1) Don't do it, i.e. don't close the lid on your laptops, and 2) Work around it.

I don't do it. You may want to work around it, and to do that you are going to have to write some scripts and set up some systemd units to unmount the network shares before you allow the lid close event to put the machine to sleep, and to remount them after it is woken. That can be done, but it is an arduous process and not recommended because you still must remember to close down any application that has a file open on the network. Soooo... that leaves you with option 1) Don't do it.
Last edited by Moonstone Man on Wed Mar 03, 2021 6:40 pm, edited 1 time in total.
buteman
Level 4
Level 4
Posts: 331
Joined: Tue Nov 29, 2011 5:36 pm
Location: North Lincolnshire

Re: CIFS or NFS

Post by buteman »

There are only two solutions to this, 1) Don't do it, i.e. don't close the lid on your laptops, and 2) Work around it.
Okay but would it still be better to use NFS?
Moonstone Man
Level 16
Level 16
Posts: 6054
Joined: Mon Aug 27, 2012 10:17 pm

Re: CIFS or NFS

Post by Moonstone Man »

buteman wrote: Wed Mar 03, 2021 6:40 pm
There are only two solutions to this, 1) Don't do it, i.e. don't close the lid on your laptops, and 2) Work around it.
Okay but would it still be better to use NFS?
I run both. Samba for the very rare occasions I need to use Windows, and the share is highly restricted to a single directory where I copy files to. This is because Windows is insecure, and a trojan or virus that can scramble and encrypt your Windows data can do it to all of your linux files if they are exposed to Windows over a samba share. I use NFS for all my Linux machines because, well, it's native, and it's somewhat faster than samba but not noticeably so. Either way, it's your choice. There is no reason beyond what I've already pointed out to use one over the other, just the same as it being a choice to use Linux or Windows. It all comes down to preference and your personal assessment of the better tool for the job.
buteman
Level 4
Level 4
Posts: 331
Joined: Tue Nov 29, 2011 5:36 pm
Location: North Lincolnshire

Re: CIFS or NFS

Post by buteman »

Kadaitcha Man I am well aware that your experience with Linux is much greater than mine but I felt that Linux is too good for us to have to jump through so many hoops over something like this so decided to dig deeper into this so this is what I have done.
Originally on the pi I had the share mounted on /media/pi/share but created /home/pi/share and changed fstab and smb.conf to point to that.
Now when I boot the laptops up they ask for the password on the pi when fstab is being read. When I login i can see the share and can load and save files without a problem. I had shut the lid on this laptop 1/2 hour before I started typing this and when I opened it I could still access the files.
Just one thing at present, if I try to open a file from Libreoffice it wants me to fill in a few details first. I haven't tried to sort that out yet. It looks like it is wanting to cause the share to mount so it can load it. Just using nemo to click on the unmounted share mounts it without asking for the password.
This sounds like a better solution for me.
Locked

Return to “Networking”