Writting on a NFS Share from Linux makes the client hang

Hi,

I have setup NFS shares on a TrueNAS CE 25.10.1. My laptop is running Debian 13 with the KDE Plasma 6.3.6. When I copy files from the NAS to the laptop, I don’t have any problem. When I write files to the NAS, the laptop will hang but still run since if I’m playing a video on YouTube let’s say, the sound continues to play even if the video is frozen. I’ve automounted the shares by adding them in FSTab like this: nm-nas-01:/mnt/ZFS1/ZFS1 /home/nicolas/NFS_Shares/zfs1 nfs x-systemd.after=network-online.target,x-systemd.automount,_netdev 0 0 Am I missing an option somewhere that could fix this issue?

Thank you so much in advance!

post output of: mount | grep nfs

You could try adding “async” as an option in your FSTAB entry. I think you may need to enable it on your TrueNAS share as well.

Sounds like you’re hitting an uninterruptible I/O wait (D-state) caused by synchronous NFS writes combined with a blocking mount. KDE freezes because file manager / I/O threads are waiting on the kernel, not because the system crashed.

A few solutions to try would be to set the mount to NFSV4 and make sure async is on.

Here’s what I’ve got.

nm-nas-01:/mnt/ZFS1/ZFS1 on /home/nicolas/NFS_Shares/zfs1 type nfs4 (rw,relatime,vers=4.2,rsize=1048576,wsize=1048576,namlen=255,soft,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=172.16.11.104,local_lock=none,addr=172.16.11.11,_netdev,x-systemd.after=network-online.target,x-systemd.automount) Even though I’ve added the async option in my FSTab, it still does it. Do I have to do that in TrueNAS as well? I thought Synchronous was always better for data integrity? Thank you.

Synchronous write

“Don’t tell me the write succeeded until the data is safely on stable storage.”

Asynchronous write

“You can tell me it succeeded once it’s in memory; write it to disk later.”

The difference is when the server sends the ACK.

Synchronous NFS ON means TrueNAS only says ‘write complete’ when the data is safely stored, OFF means it lies for speed and your risk is whatever happens before the next flush which happens every few seconds. So there is a risk of losing data in flight if there was a failure of the TrueNAS system before that flush happens.

OK so, sorry for the delay. I’ve had to reinstall Debian 13 KDE on my laptop using the net install this time. Had too many bugs with my previous install I had done using the live USB installer. A word of advice, ALWAYS make sure you install Debian using the net install! For reference, I have a Lenovo ThinkPad T14 Gen 5 AMD (AMD Ryzen 7 Pro 8840U, 64GB of RAM and 2TB WD SN850X with 4K sectors connected to a CalDigit Thunderbolt 4 dock which has the Intel 2.5Gb NIC) I‘ve made sure my Datasets were set up not using the Sync option. Is it normal when I use the mount | grep nfs command, I don’t see async anywhere even though I’ve made the change in my FSTab? My TrueNAS system is a Lenovo ThinkSystem ST550 7X10 (Intel Xeon Silver 4116, 32GB of RAM with Seagate Exos S20 20TB 4K sectors disks) Note that for now I have 3 ZFS pools with each 1 disk since that’s all I could afford at the time so I know it’s really not the best setup as far as data safety goes. On the other hand, can it really affect the performance that much though? I’ve never had these issues on Windows using SMB… I’ve got to say that even Samba on Linux in my environment has never been good either. One thing I don’t understand, is you say the cache gets flushed every once a couple of seconds, why don’t i see it in TrueNAS in the memory section of the Dashboard? It always stay full unless I manually restart the system… Are all these options valid/necessary in my FSTab? soft,async,tcp,x-systemd.after=network-online.target,x-systemd.automount,_netdev 0 0 Thank you once again. Sorry for the wall of text.

It’s not the whole ARC that get’s flushed, it’s part of the atomic write process of ZFS. I have a deeper video on that topic about how ZFS works here

If you want to solve this without spending as much time with NFS tuning you can us SMB in Linux as that is how I handle it. It works well in modern distros.

I have to ask. Why bother with ZFS on a laptop? Seems like it would not be the best use case for ZFS, given how much of a memory hog ZFS can be.

Hi,

I’m using BTRFS actually. Sometimes, I use EXT4.

Thanks