NFS Support

Kernel, Main, Utilities & Applications, Miscellaneous Devices.
Bas
Top Contributor
Posts: 622
Joined: Fri Jan 22, 2021 4:36 pm
Has thanked: 80 times
Been thanked: 324 times

Re: NFS Support

Unread post 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!

User avatar
RealLarry
Top Contributor
Posts: 881
Joined: Mon May 25, 2020 4:04 am
Location: San Junipero/DE/Earth
Has thanked: 120 times
Been thanked: 385 times

Re: NFS Support

Unread post 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.

Contributor of tty2oled, author of tty2tft, tty2rpi and update_tty2xxx
User avatar
RealLarry
Top Contributor
Posts: 881
Joined: Mon May 25, 2020 4:04 am
Location: San Junipero/DE/Earth
Has thanked: 120 times
Been thanked: 385 times

Re: NFS Support

Unread post 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 ;)

Attachments
zImage_dtb.7z
(5.85 MiB) Downloaded 202 times
Contributor of tty2oled, author of tty2tft, tty2rpi and update_tty2xxx
Bas
Top Contributor
Posts: 622
Joined: Fri Jan 22, 2021 4:36 pm
Has thanked: 80 times
Been thanked: 324 times

Re: NFS Support

Unread post by Bas »

Can you post a PR to Sorgelig for this?

User avatar
RealLarry
Top Contributor
Posts: 881
Joined: Mon May 25, 2020 4:04 am
Location: San Junipero/DE/Earth
Has thanked: 120 times
Been thanked: 385 times

Re: NFS Support

Unread post 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)

Contributor of tty2oled, author of tty2tft, tty2rpi and update_tty2xxx
Bas
Top Contributor
Posts: 622
Joined: Fri Jan 22, 2021 4:36 pm
Has thanked: 80 times
Been thanked: 324 times

Re: NFS Support

Unread post by Bas »

Will test this morning and report back.

Bas
Top Contributor
Posts: 622
Joined: Fri Jan 22, 2021 4:36 pm
Has thanked: 80 times
Been thanked: 324 times

Re: NFS Support

Unread post by Bas »

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

User avatar
RealLarry
Top Contributor
Posts: 881
Joined: Mon May 25, 2020 4:04 am
Location: San Junipero/DE/Earth
Has thanked: 120 times
Been thanked: 385 times

Re: NFS Support

Unread post 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.

Contributor of tty2oled, author of tty2tft, tty2rpi and update_tty2xxx
User avatar
RealLarry
Top Contributor
Posts: 881
Joined: Mon May 25, 2020 4:04 am
Location: San Junipero/DE/Earth
Has thanked: 120 times
Been thanked: 385 times

Re: NFS Support

Unread post 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.

Attachments
zImage_dtb.7z
(5.81 MiB) Downloaded 198 times
Contributor of tty2oled, author of tty2tft, tty2rpi and update_tty2xxx
Bas
Top Contributor
Posts: 622
Joined: Fri Jan 22, 2021 4:36 pm
Has thanked: 80 times
Been thanked: 324 times

Re: NFS Support

Unread post 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.

User avatar
RealLarry
Top Contributor
Posts: 881
Joined: Mon May 25, 2020 4:04 am
Location: San Junipero/DE/Earth
Has thanked: 120 times
Been thanked: 385 times

Re: NFS Support

Unread post 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

Contributor of tty2oled, author of tty2tft, tty2rpi and update_tty2xxx
User avatar
RealLarry
Top Contributor
Posts: 881
Joined: Mon May 25, 2020 4:04 am
Location: San Junipero/DE/Earth
Has thanked: 120 times
Been thanked: 385 times

Re: NFS Support

Unread post 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!
🎉 ❤️ 🚀

Contributor of tty2oled, author of tty2tft, tty2rpi and update_tty2xxx
MrChatouille
Posts: 18
Joined: Thu Jan 06, 2022 9:38 am
Location: France
Has thanked: 1 time
Been thanked: 11 times
Contact:

Re: NFS Support

Unread post 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 :)

Bas
Top Contributor
Posts: 622
Joined: Fri Jan 22, 2021 4:36 pm
Has thanked: 80 times
Been thanked: 324 times

Re: NFS Support

Unread post 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.

User avatar
RealLarry
Top Contributor
Posts: 881
Joined: Mon May 25, 2020 4:04 am
Location: San Junipero/DE/Earth
Has thanked: 120 times
Been thanked: 385 times

Re: NFS Support

Unread post 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

Attachments
zImage_dtb.7z
(5.81 MiB) Downloaded 176 times
Contributor of tty2oled, author of tty2tft, tty2rpi and update_tty2xxx
Nikoh
Posts: 29
Joined: Mon Dec 13, 2021 3:37 pm
Has thanked: 3 times

Re: NFS Support

Unread post 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 8420 times

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


Image

Bas
Top Contributor
Posts: 622
Joined: Fri Jan 22, 2021 4:36 pm
Has thanked: 80 times
Been thanked: 324 times

Re: NFS Support

Unread post 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.

Nikoh
Posts: 29
Joined: Mon Dec 13, 2021 3:37 pm
Has thanked: 3 times

Re: NFS Support

Unread post 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....


Image

Bas
Top Contributor
Posts: 622
Joined: Fri Jan 22, 2021 4:36 pm
Has thanked: 80 times
Been thanked: 324 times

Re: NFS Support

Unread post by Bas »

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

Nikoh
Posts: 29
Joined: Mon Dec 13, 2021 3:37 pm
Has thanked: 3 times

Re: NFS Support

Unread post by Nikoh »

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


Image

Bas
Top Contributor
Posts: 622
Joined: Fri Jan 22, 2021 4:36 pm
Has thanked: 80 times
Been thanked: 324 times

Re: NFS Support

Unread post 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.

Nikoh
Posts: 29
Joined: Mon Dec 13, 2021 3:37 pm
Has thanked: 3 times

Re: NFS Support

Unread post 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 8854 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...


Image

Bas
Top Contributor
Posts: 622
Joined: Fri Jan 22, 2021 4:36 pm
Has thanked: 80 times
Been thanked: 324 times

Re: NFS Support

Unread post 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.

Bas
Top Contributor
Posts: 622
Joined: Fri Jan 22, 2021 4:36 pm
Has thanked: 80 times
Been thanked: 324 times

Re: NFS Support

Unread post 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 ;-)

Nikoh
Posts: 29
Joined: Mon Dec 13, 2021 3:37 pm
Has thanked: 3 times

Re: NFS Support

Unread post 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?


Image

User avatar
RealLarry
Top Contributor
Posts: 881
Joined: Mon May 25, 2020 4:04 am
Location: San Junipero/DE/Earth
Has thanked: 120 times
Been thanked: 385 times

Re: NFS Support

Unread post 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:

Contributor of tty2oled, author of tty2tft, tty2rpi and update_tty2xxx
Nikoh
Posts: 29
Joined: Mon Dec 13, 2021 3:37 pm
Has thanked: 3 times

Re: NFS Support

Unread post 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?


Image

Bas
Top Contributor
Posts: 622
Joined: Fri Jan 22, 2021 4:36 pm
Has thanked: 80 times
Been thanked: 324 times

Re: NFS Support

Unread post 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.

Nikoh
Posts: 29
Joined: Mon Dec 13, 2021 3:37 pm
Has thanked: 3 times

Re: NFS Support

Unread post by Nikoh »

Ok, all done, many thanks man ;)


Image

Nikoh
Posts: 29
Joined: Mon Dec 13, 2021 3:37 pm
Has thanked: 3 times

Re: NFS Support

Unread post 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?


Image

Post Reply