Solved Help with nfs ?

Hi Forum
Using FreeBSD 14.2 and KDE.
Happy to use Kate for editing some files which are stored remotely and connected by nfs.
Linux nfs server is v2/v3 and remote nfs share is mounted locally by /etc/fstab
Code:
192.168.x.x:/nfsshare          /mnt/nfsshare     nfs     rw,noinet6      0       0
Kate can easily read all files from the remote nfs share.
Kate can correctly save small files, up to about 32k to the nfs share. So it appears no problems with permissions.
When attempting to save any larger file, Kate borks with error message “Connection to host 192.168.x.x is broken”, and fails.
Worse, Kate saves just the first approx 32k of the file, and drops the rest, so data corruption is assured.
Please, is there any simple solution to this consistent failure ? Perhaps increasing some kde buffer size is needed ?
It appears exact same problem exists regardless of whether Kate connecting from FreeBSD to nfs share over LAN or WAN.
The clumsy workaround is to save the large file locally, then use cli to copy file to /mnt/nfsshare
Thanks for helping to fix this the-right-way.
(Note to self. Wonder whether Kate works correctly if the remote nfs server is running on FreeBSD ? Should be easy to check.)
 
Are there any messages in /var/log/messages or dmesg?
Are you using NFSv4 or v3? If NFSv4, what happens if you fall back to v3?
Have you tried NFSv3 with UDP?
Is autofs in use?

BTW, I use NFS here, on 15-CURRENT. I use the following sysctls on my clients.
Code:
vfs.nfsrv.async=1
vfs.nfsd.async=1
vfs.nfsd.tcphighwater=102400
vfs.nfsd.tcpcachetimeo=300

On my NFS server I set the following sysctl.
Code:
# workaround for panic when amd(8) on the client does an ls on large nfs dir.
vfs.nfsd.fha.enable=0
 
Thanks for reply.
Each time Kate disconnects due to failed attempt to save a large file, there's an error being logged on the linux nfs host :
Code:
centos7 systemd-logind: Removed session 29050
I'll try some sysctls and see wot 'appens.
 
Silly me, I assumed a homogeneous FreeBSD environment. Can you describe your environment?

BTW, I manage RHEL at $JOB. Linux has a lot of NFS warts.

Also, RHEL 7 / CentOS 7 have been desupported by RH, because they're EOL, and have not been updated with the latest NFS packages.

Also, Linux does not strictly adhere to the NFS protocol spec. FreeBSD attempts to work around these bugs without breaking strict adherence to the protocol spec. You may wish to try these sysctls.

Code:
vfs.nfsd.v4openaccess: Enable Linux style NFSv4 Open access check
vfs.nfsd.linux42server: Enable Linux style NFSv4.2 server (non-RFC compliant)
vfs.nfsd.flexlinuxhack: For Linux clients, hack around Flex File Layout bug

These are hacks to work around Linux bugs, not FreeBSD bugs. And again, I work with Linux at $JOB. Its support of NFS is um.... broken.
 
So many thanks for your further reply.
I'm acutely aware of CentOS7 being EOL'd, and am in process of changing all servers and desktops to FreeBSD. This will take time.
In the short term, I'm stuck using CentOS7 for a particular webserver. We'll be glad when we eventually become wholly linux-free.
When time permits, I'll checkout your sysctls and advise result.
[ IMHO CentOS was good for many years, until it was absorbed by RedHat. The platform model became broken almost immediately after RH was taken over by IBM. /end of rant ]
 
Silly me, I assumed a homogeneous FreeBSD environment. Can you describe your environment?
Ordinary CentOS7 server exporting nfs share.
2 x FreeBSD 14.2 desktops (daily drivers) with KDE, one on-site and another remotely.
On-site connection over usual LAN.
Worksite has WAN connection with pfSense (FreeBSD) doing the firewalling and routing.
Kate has same problem regardless of connection via LAN or WAN.
I suspect the nfs problem only exists when making file transfer using KDE/Kate.
Not yet detected any problem/s when transferring files by cli command.
 
Do any other editors behave the same?

Does cp to/from and cat with redirect to (>) behave the same? I suspect kate is issuing writes in a manner that makes it sensitive to the NFS protocol. There are many examples of this, i.e. DBMS.

Have you tried this using a FreeBSD NFS server?

Given that Linux NFS servers don't correctly implement the NFS protocol and the possibility that the kate editor may be writing to the file like a DBMS (i.e. Oracle, mysql, postgresql) you may need to alter the mount options with rsize=65536,wsize=65536. Or higher like 262144 or 1048576. It could be that the kate editor treats the file like a DBMS would. You will need to play around with the NFS read/write buffer sizes.

Have you tried NVSv3 with TCP or UDP?
 
So many thanks for your further reply.
I'm acutely aware of CentOS7 being EOL'd, and am in process of changing all servers and desktops to FreeBSD. This will take time.
In the short term, I'm stuck using CentOS7 for a particular webserver. We'll be glad when we eventually become wholly linux-free.
When time permits, I'll checkout your sysctls and advise result.
[ IMHO CentOS was good for many years, until it was absorbed by RedHat. The platform model became broken almost immediately after RH was taken over by IBM. /end of rant ]
I won't say the obvious but there's an elephant in the room.
 
Back
Top