NFS server fails on copy

Hi there,
I’m on a Raspberry Pi 3, with Linux osmc 4.14.78-4-osmc using an USB hard drive.
I installed the nfs server and mounted it on a client through fstab with 192.168.1.30:/series /mnt/series nfs4 nolock,rsize=16384,wsize=16384,intr,timeo=800,x-systemd.automount 0 0.
When I try to copy a file from the Raspberry to the client, I can see a normal speed during 4-5 seconds. After that, it stops failing completely.

On the Raspberry, I can see the load average increasing a lot (up to 3-4 and counting).

Everything is working as expected if I try to copy a file from the USB Drive to the Raspberry SD.

Any clue is appreciated?

Hi,

What is the USB Hard drive formated to? NTFS, Ext4 or fat? If possible I would choose Ext4, the others are know to cause bottle necks.

I would also try simplifying the fstab entry and let the server negation the best settings for example rsize or wsize, as your static options maybe causing an issue. So on the client please try:

192.168.1.30:/series /mnt/seriess nfs4 noauto,x-systemd.automount 0 0

Thanks Toms.

It’s an ext4 volume. Your setting was the first I tried. I just tried again but same issue.

Hi,

Does the usb drive have its own supply or attached to a mains powered usb hub?

Tom.

It has its own power supply. In fact, it was previously on the client and worked as expected. I just switched the client and the server.

Hi,

Could you please provide some logs, so we can investigate further. Details can be found here:

Thanks Tom.

Just to be sure, you want me to launch the grab-logs -A command?

Check points under “Providing diagnostic logs” in the link Tom provided

1 Like

Yes.

A few other things:

  1. What’s the client?
  2. Have you tried using NFSv3?
  3. It’s good that you tested a file copy from USB drive to the Pi’s SD card. Have you also tried the performance of an NFS mount on the SD card?

I’m not sure how to get the client version but it’s an Ubuntu with nfs-common v1.2.8.

I tried with 192.168.1.30:/series /mnt/series nfs vers=3,noauto,x-systemd.automount 0 0 and 192.168.1.30:/series /mnt/series nfs vers=3.0,noauto,x-systemd.automount 0 0 but it fails: mount.nfs: access denied by server while mounting 192.168.1.30:/series.

It was a very good idea and it is working pretty well through the SD card (10Mo/s). It’s slow only through the USB hard drive (~110Ko/s).

You’ve probably kept the export as NFSv4. Can we see /etc/exports?

And don’t forget the logs! :wink:

# /etc/exports: the access control list for filesystems which may be exported
#               to NFS clients.  See exports(5).
#
# Example for NFSv2 and NFSv3:
# /srv/homes       hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check)
#
# Example for NFSv4:
# /srv/nfs4        gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check)
# /srv/nfs4/homes  gss/krb5i(rw,sync,no_subtree_check)
#
/export        192.168.1.0/24(rw,fsid=0,insecure,no_subtree_check,async)
/export/series 192.168.1.0/24(rw,nohide,insecure,no_subtree_check,async)
/export/films 192.168.1.0/24(rw,nohide,insecure,no_subtree_check,async)

And the logs: https://paste.osmc.tv/efewocehav
Thank you for your help.

Sorry for the delay in replying. You should be able to mount on the client using NFSv3 with the command:

sudo mount -t nfs -o vers=3 192.168.1.30:/export/series /mnt/series

See if it makes a difference to the file copy from the USB drive.

No worries. Sadly, it didn’t change anything.

Does the problem occur after the file reaches a certain size? When you tested from the SD card, did you use the same file as you used when testing from the USB drive?

I’d suggest you simplify the /etc/exports for now:

/media/alexandrie/films   192.168.1.0/24(rw,no_subtree_check)

comment out the other lines and remove the bind mounts in /etc/fstab. Get back to the simplest configuration you can manage. If that works, start adding things until it breaks. On the client side, keep the fstab as simple as possible. The one suggested by @Tom_Doyle would be a reasonable starting point.

Hi there,
I tried with a smaller file but same issue.
I test your recommendations but I always have the problem.

  1. Please repeat the problem using the configuration I described above, then post full logs.

  2. Please see if the problem also occurs with a USB pendrive. If possible, format it as ext4 or ext3.

Ok then. I have some fresh news. When I do the same thing with a pendrive, it’s working as expected. When I tried to copy my files from my USB drive to the pendrive, it took a while.
I tried with another dock station and it worked! I changed the cable but didn’t change the issue. I don’t understand why this dock is working without any hiccups on another computer anyway. Do you have an idea or should I let it go?