Page 3 of 5

Re: NFS Support

Posted: Thu Mar 16, 2023 2:08 pm
by Bas

Spent the past few days testing and doing generally "stupid" things with my MiSTer and NFS. Nothing out of the ordinary happened and I was unable to cause any real damage to anything. This and the lack of any issues submitted to GitHub led me to submit a PR to the upstream MiSTer Scripts repository. Once that gets merged and the Linux kernel gets a rebuild, the MiSter should have working NFS support built-in. Fingers crossed!


Re: NFS Support

Posted: Thu Mar 16, 2023 2:59 pm
by RealLarry

I never had any problems with my script either (aside from a few minor problems in the beginning because of upper and lower case).
Great to read that my script was useful at the end.


Re: NFS Support

Posted: Fri Mar 17, 2023 6:26 am
by RealLarry

Attached is my newest Kernel, build upon Sorgelig's Kernel and latest updates. While Sorgelig already enabled NFS (v3), I've also enabled NFSv4. The other updates in Kernel's repo are updates to the Realtek WiFi drivers and an addition for the RTL8812AU chipset.
Also included is my .config file for a reproducible build.
Just tested and still working which is not a surprise for me ;)


Re: NFS Support

Posted: Fri Mar 17, 2023 6:49 am
by Bas

Can you post a PR to Sorgelig for this?


Re: NFS Support

Posted: Fri Mar 17, 2023 7:02 am
by RealLarry
Bas wrote: Fri Mar 17, 2023 6:49 am

Can you post a PR to Sorgelig for this?

Have you tested my Kernel and consider it "working"? Then yes, for sure. But I'm unsure about some options I'm also using and whether it's a good idea to enable/use them - but I'm using them since 2021/12 and I'm absolutely happy with them. These options are in detail:

  • CONFIG_PNFS*

  • CONFIG_NFS_FSCACHE

  • CONFIG_NFS_USE_KERNEL_DNS

  • CONFIG_NFS_V4_2_SSC_HELPER=y

(almost taken from my ArchLinux)


Re: NFS Support

Posted: Fri Mar 17, 2023 7:05 am
by Bas

Will test this morning and report back.


Re: NFS Support

Posted: Fri Mar 17, 2023 8:26 am
by Bas

This one works fine. Looks like the NFSv4 bits do the trick.


Re: NFS Support

Posted: Fri Mar 17, 2023 8:32 am
by RealLarry
Bas wrote: Fri Mar 17, 2023 8:26 am

This one works fine. Looks like the NFSv4 bits do the trick.

Great to hear. Well, I'm preparing some things and comments and will do a PR then.


Re: NFS Support

Posted: Sun Apr 23, 2023 1:25 pm
by RealLarry

Sorgelig has released a new MiSTer Linux Kernel which is supporting NFS, but, alas, not NFS4 :evil:
I'll continue to bake and publish my own NFS4-aware Kernel here until next chance. See attachment for the fresh new Kernel, based upon today's changes.


Re: NFS Support

Posted: Mon Apr 24, 2023 8:48 am
by Bas

Can you post your kernel config differences to Sorgelig as a PR? That'd unblock the upstreaming of the NFS mount script and this whole thing can be mainlined properly.


Re: NFS Support

Posted: Mon Apr 24, 2023 8:51 am
by RealLarry
Bas wrote: Mon Apr 24, 2023 8:48 am

Can you post your kernel config differences to Sorgelig as a PR? That'd unblock the upstreaming of the NFS mount script and this whole thing can be mainlined properly.

Yes, for sure. I'll prepare things and the PR...
EDIT: diff'ed, patched and PR'd


Re: NFS Support

Posted: Mon Apr 24, 2023 12:57 pm
by RealLarry

Merged! Attached is the new Kernel, based upon the official source. Tested and is working.
Thanks to everyone who was helping and drove me to completeness!
🎉 ❤️ 🚀


Re: NFS Support

Posted: Mon Apr 24, 2023 6:16 pm
by MrChatouille

Hello,

I would like to add my little something to this beautiful adventure

I've been using a custom script to mount my NAS with CIFS for a few months and it worked for me, but NFS is too nice an addition to pass up.
So I added NFS to my script and posted the whole thing on github for those of you who might be interested.

https://github.com/willoucom/MisterFPGA_Network_Shares

reviews welcome :)


Re: NFS Support

Posted: Mon Apr 24, 2023 8:13 pm
by Bas

What's the stance on Python for MiSTer scripts? It's a lot neater in many ways than shell scripts so I personally like the idea, but Python also brings with it its own complexities.


Re: NFS Support

Posted: Wed Apr 26, 2023 8:29 am
by RealLarry

Attached is a new Kernel, based upon the official source from yesterday. Tested and is working.
Reason is (was) an incompatible driver for some Edimax WiFi dongles, which has been reset to older but working ones.

viewtopic.php?p=72523#p72523
https://github.com/MiSTer-devel/Main_MiSTer/issues/769

EDIT: I'll provide all my upcomin' Kernel here to save space on this forum (I don't want to be responsible if the server is full ;))

EDIT: Link corrected


Re: NFS Support

Posted: Mon May 01, 2023 4:54 pm
by Nikoh

Hello guys, I need your help trying this new feature...
I am mounting my storage nfs share with mount -t nfs nasIP:/sharename/ localfolder but MiSTer give me this error:

Schermata-a-2023-05-01-18-53-02.png
Schermata-a-2023-05-01-18-53-02.png (14.28 KiB) Viewed 4850 times

Same error mounting with FSTAB :(
Please help me...


Re: NFS Support

Posted: Mon May 01, 2023 5:58 pm
by Bas

Don't do it this way. Check out the script. It shows how to do this through busybox. The script is merged into the main repo.


Re: NFS Support

Posted: Mon May 01, 2023 6:03 pm
by Nikoh

Now i have all the time "permission denied"... :evil:
If I try to moun same share on my linux pc with mount it do without problems....


Re: NFS Support

Posted: Mon May 01, 2023 6:05 pm
by Bas

Try using the script. It takes care of some housekeeping.


Re: NFS Support

Posted: Mon May 01, 2023 10:04 pm
by Nikoh

Tried, but same error...
Not any official script, not any official guide... NFS on MiSTer is like not existent.... for me.


Re: NFS Support

Posted: Tue May 02, 2023 4:27 am
by Bas

The script has been merged upstream making it as official as it gets in my book. That's not to say NFS isn't a finnicky protocol. You must be sure to export NFSv4 mountpoints on your server end. Older protocol versions don't work yet (are very untested). I'm away from my MiSTer until at least Friday so I can't test anything.

There's a readme for the mount_nfs script in my GitHub and the script itself contains comments to explain it's actions.

Permission denied usually points to something on the server's end, where it should get logged.


Re: NFS Support

Posted: Tue May 02, 2023 9:58 am
by Nikoh

I think I understand the problem....
I use OpenMediaVault as Nas and on it's wiki i read:

Schermata a 2023-05-02 11-53-17.png
Schermata a 2023-05-02 11-53-17.png (23.47 KiB) Viewed 5284 times

So my NAS export NFSv4 with

Code: Select all

ro,wdelay,root_squash,no_subtree_check,fsid=0

but MiSTer user is root (0:0) then i need to modify like:

Code: Select all

rw,no_root_squash,

This is the error on my OMV log:

Code: Select all

openmediavault rpc.mountd[159809]: refused mount request from 192.168.1.50 for /mister (/): not exported

Right?

I think it will be a very common problem since openmediavault is a very popular software...


Re: NFS Support

Posted: Tue May 02, 2023 11:56 am
by Bas

Root squash changes the uid of root on the server to something else, usually high up in the 65000's to make it less of a security risk. Your server docs should tell you what the uid is that root gets squashed to. Once you know that, you can change the ownership of the files and directories on your server to it and the MiSTer will work with it.

The issue is server-side and a property of NFS being an unforgiving piece of rusty razor wire from the distant past.


Re: NFS Support

Posted: Tue May 02, 2023 12:27 pm
by Bas

I'll see if I can write some docs for OMV specifically over next weekend. The error you're seeing may also be a mixup in your exports. Currently I'm running around a mouse-flavored theme park with a 5 year-old and only have my phone and crappy wifi in queues.. so bear with me please ;-)


Re: NFS Support

Posted: Tue May 02, 2023 12:38 pm
by Nikoh

Finally soved.... the problem was

Code: Select all

-t nfs4

Mounting manually I omitted this because on all standard distro, with nfs-common package I just call mount and all is done automagically with the newer protocol supported from the server.
With busybox we need to add nfs4 type, there is not a kind of automatic handshake to discover newer nfs version that server support...
Anyway, now my problem is what and where mount...
With CIFS I mounted all the folders, except some like linux, Scripts
How can I do the same with nfs? I don't want to mount every single folder....
Which approach do you think would be better?


Re: NFS Support

Posted: Tue May 02, 2023 12:39 pm
by RealLarry
Bas wrote: Tue May 02, 2023 12:27 pm

Currently I'm running around a mouse-flavored theme park with a 5 year-old [...]

Oh noooo! I feel very sorry for you! "It's a small, small world, lalala, it's a small, small world!"
Damn'! I can't get that sound of my head! I'll go crazy! I'll have to kill some mice NOW! :mrgreen:


Re: NFS Support

Posted: Tue May 02, 2023 6:12 pm
by Nikoh

With cifs_mount script I mounted all the folders, except some like linux, Scripts
How can I do the same with nfs and your script?
Which approach do you think would be better? to have some folders mounted and others not?


Re: NFS Support

Posted: Tue May 02, 2023 6:38 pm
by Bas

The mount_nfs works a little differently. It mounts a single mountpoints in /tmp and then checks which of the underlying subdirs you also have in /media/fat. The ones it finds that are empty get an NFS-hosted subdir overlaid on there using a bind mount. The readme with the script explains this and I tried to keep the code as readable as possible to show how it's done.


Re: NFS Support

Posted: Tue May 02, 2023 9:57 pm
by Nikoh

Ok, all done, many thanks man ;)


Re: NFS Support

Posted: Sun May 21, 2023 12:42 pm
by Nikoh

@Bas I noticed that your script doesn't mount the "saves" and "Filters" folders...
I think it's due to the fact that there are also "savestates" and "Filters_Audio" folders (which are mounted)
In /tmp/nfs_mount I can see all folders, saves, savestates, Filters, Filters_Audio and others.
is this maybe a bug?