Linux Mint & NAS Share Freezing

I mount an SMB share on a Linux mint laptop using /etc/fstab and CIFS. This works, but I have issues when resuming from standby after closing the lid.

If I have files open when I entered standby, it will freeze when it resumes from standby. Is there a way to reestablish a connection to the TrueNAS share automatically?

Are you using systemd’s automounter in the fstab entry?

Hello thank you for the response.

Yes, below is the entry:

//nas_IP/folder /mnt/nas cifs credentials=/etc/smb-credentials,uid=myuser,gid=myuser,vers=3.0,hard,retrans=5,actimeo=10,iocharset=utf8,vers=2.0,file_mode=0775,dir_mode=0775,x-systemd.automount,x-systemd.requires=network-online.target,x-systemd.after=network-online.target 0 0

Why are you specifying vers twice, and why two different versions, and why even specify it at all? Why not let it auto negotiate?

Is this a wired or wireless connection?

What is freezing? The entire system or just the application that is using the file?

Have you tried with soft instead of hard?

EDIT: If you’re using a wireless connection, you can increase the retrans value and add a more patient timeout with timeo or x-systemd.device-timeout.

Take a look at autofs.

I overlooked how the version was being negotiated. Thank you.

I am still testing it, but I think changing from hard to soft might have fixed the issue.

Thanks for the input from both of you. I’ll report back if there are still issues.

You should also increase these values if you’re going to use soft, to minimize potential corruption:

Thanks. What values would you recommend for retrans and x-systemd.device-timout? I set both to 20 seconds. My endpoint is using wireless.

That sounds good. Enough time for your wifi to reestablish and connect to your share, but not so long that it makes no sense if the server is down.

Review the parameters, since I believe it might be measured in 1/10th seconds.