NFS Support

Kernel, Main, Utilities & Applications, Miscellaneous Devices.
Magu
Posts: 9
Joined: Tue Jun 16, 2020 4:05 pm
Been thanked: 2 times

NFS Support

Unread post by Magu »

Hello!

Please add the NFS client to the linux subsystem. I have a file server which is exposed to my LAN over NFS. I have tried mounting the retro game share on my Mister, but the NFS client seems to be missing.

Code: Select all

mount: /mnt/yamato: unknown filesystem type 'nfs'.
Since these files do not take up much space, can they please be added to the mister linux system. I don't need any support scripts or anything like that, but just the ability to add an NFS share to /etc/fstab and having it auto mount during startup.
pacoarcade
Posts: 72
Joined: Mon May 25, 2020 8:41 am
Has thanked: 75 times
Been thanked: 13 times
Contact:

Re: NFS Support

Unread post by pacoarcade »

If it's technically viable, NFS client would be great.
User avatar
Mellified
Posts: 145
Joined: Sat Aug 22, 2020 8:38 pm
Been thanked: 51 times

Re: NFS Support

Unread post by Mellified »

You can use CIFS AKA SAMBA today if you don't want to wait.
Bas
Top Contributor
Posts: 623
Joined: Fri Jan 22, 2021 4:36 pm
Has thanked: 80 times
Been thanked: 324 times

Re: NFS Support

Unread post by Bas »

CIFS is a whole different cookie that not everyone can or wants to deal with server-side. NFS being the native file sharing solution on Linux, it'd make sense to include at least the client bits.
Magu
Posts: 9
Joined: Tue Jun 16, 2020 4:05 pm
Been thanked: 2 times

Re: NFS Support

Unread post by Magu »

Mellified wrote: Wed Jun 23, 2021 7:09 pm You can use CIFS AKA SAMBA today if you don't want to wait.
I tried that a few months back, but something was missing preventing it from working. Some part of the CIFS client that used to be included aint anymore if i don't remember incorrectly.
Magu
Posts: 9
Joined: Tue Jun 16, 2020 4:05 pm
Been thanked: 2 times

Re: NFS Support

Unread post by Magu »

Found it. mount.cifs is missing. You get this when running cifs_mount.sh

Code: Select all

mount: /tmp/cifs_mount: bad option; for several filesystems (e.g. nfs, cifs) you might need a /sbin/mount.<type> helper program.
and if you check the contents of /sbin:

Code: Select all

# ls /sbin/mount*
/sbin/mount.lowntfs-3g	/sbin/mount.ntfs  /sbin/mount.ntfs-3g
Locutus73
Core Developer
Posts: 51
Joined: Mon May 25, 2020 9:55 am
Has thanked: 1 time
Been thanked: 8 times

Re: NFS Support

Unread post by Locutus73 »

Magu wrote: Wed Jun 23, 2021 7:45 pm Found it. mount.cifs is missing. You get this when running cifs_mount.sh

Code: Select all

mount: /tmp/cifs_mount: bad option; for several filesystems (e.g. nfs, cifs) you might need a /sbin/mount.<type> helper program.
and if you check the contents of /sbin:

Code: Select all

# ls /sbin/mount*
/sbin/mount.lowntfs-3g	/sbin/mount.ntfs  /sbin/mount.ntfs-3g
That’s a standard misleading error message.
Please run dmesg immediately after the cifs_mount.sh script and you’ll find the real root issue so you’ll be able to correct the problem.
Let me know.

Regards.

Locutus73
Magu
Posts: 9
Joined: Tue Jun 16, 2020 4:05 pm
Been thanked: 2 times

Re: NFS Support

Unread post by Magu »

Would you look at that. In dmesg it complained about unspecified username and SMB dialect. specified both (including "guest" as user), and now it works, dunno which was the show-stopper. Thank you!

Now I can reuse that 128GB micro-SD for something else ...

(I still do think that one should include the NFS client just because it's a fairly simple operation.)
User avatar
Doozer
Posts: 15
Joined: Wed May 27, 2020 5:16 pm
Has thanked: 3 times
Been thanked: 11 times

Re: NFS Support

Unread post by Doozer »

I am using NFS since the beginning and it is working perfectly fine. I have already asked Sorgelig in the past (atari-forum) about putting it in the config. He answered that he will think about it. Now with more people interested, he might change his mind.

NFS is not compiled inside the kernel but this can be achieved by adding the following this line into the configuration file "arch/arm/configs/MiSTer_defconfig". You will have to replace the kernel image on your sdcard.

Code: Select all

CONFIG_NFS_FS=y
Depending on your cross-compiler location you can tune the following for the compilation.

Code: Select all

make ARCH=arm CROSS_COMPILE=/opt/gcc-linaro/bin/arm-linux-gnueabihf- O=build/ MiSTer_defconfig
make ARCH=arm CROSS_COMPILE=/opt/gcc-linaro/bin/arm-linux-gnueabihf- O=build/ -j9 -k zImage dtbs
cat build/arch/arm/boot/zImage build/arch/arm/boot/dts/socfpga_cyclone5_de10_nano.dtb > build/zImage_dtb
From the image itself, nothing has to be done. The busybox binary has the NFS support already built-in. I am using nolock option but it depends on your NFS config.

Code: Select all

/bin/busybox mount <your ip>:<your server path> <mister destination path> -o nolock
Hope it will help some of you to get NFS mounting.
Cheers.
numbski
Posts: 24
Joined: Fri Jan 22, 2021 3:59 pm
Been thanked: 2 times

Re: NFS Support

Unread post by numbski »

>cross-compiler

Could you kindly point me in the direction of the cross-compiler setup?
User avatar
RealLarry
Top Contributor
Posts: 883
Joined: Mon May 25, 2020 4:04 am
Location: San Junipero/DE/Earth
Has thanked: 120 times
Been thanked: 386 times

Re: NFS Support

Unread post by RealLarry »

numbski wrote: Fri Sep 03, 2021 3:18 pm >cross-compiler

Could you kindly point me in the direction of the cross-compiler setup?
Have a look at https://github.com/MiSTer-devel/Main_Mi ... for-MiSTer
Contributor of tty2oled, author of tty2tft, tty2rpi and update_tty2xxx
kahuna
Posts: 7
Joined: Sun Sep 26, 2021 5:24 am
Been thanked: 10 times

Re: NFS Support

Unread post by kahuna »

Another upvote for getting NFS built by default on the MiSTer image!
Pretty please? ;)
MrMartian
Posts: 21
Joined: Wed Nov 24, 2021 4:04 pm
Has thanked: 18 times
Been thanked: 36 times

Re: NFS Support

Unread post by MrMartian »

Another one from me too please.. NFS is faster and easier than SMB/CIFS
User avatar
RealLarry
Top Contributor
Posts: 883
Joined: Mon May 25, 2020 4:04 am
Location: San Junipero/DE/Earth
Has thanked: 120 times
Been thanked: 386 times

Re: NFS Support

Unread post by RealLarry »

Folks, Sorgelig seems to be not too interested in this - and that's totally okay - so we could do this by ourself. If there's enough interest I'll overcome into this and compile an approproate kernel for us. I did this multiple times for our tty2oled project to include the USB2RS232 kernel feature (superfluous as implemented by Sorgelig meanwhile).
viewtopic.php?t=1887
Contributor of tty2oled, author of tty2tft, tty2rpi and update_tty2xxx
User avatar
Doozer
Posts: 15
Joined: Wed May 27, 2020 5:16 pm
Has thanked: 3 times
Been thanked: 11 times

Re: NFS Support

Unread post by Doozer »

This is the link to my kernel with only NFS on top of the standard MiSTer configuration. Now with the modular approach Soregelig has taken, kernel must be following the system image version., currently 5.15.1. Enjoy!

Code: Select all

Linux MiSTer 5.15.1-MiSTer #1 SMP Fri Nov 12 17:31:23 CET 2021 armv7l GNU/Linux
Link MiSTer 5.15.1 with NFS kernel image

It is only one line to be put inside the default MiSTer configuration file. @sorgelig, please add it as it is requested by many others. This would be terrific and more than appreciated.
User avatar
RealLarry
Top Contributor
Posts: 883
Joined: Mon May 25, 2020 4:04 am
Location: San Junipero/DE/Earth
Has thanked: 120 times
Been thanked: 386 times

Re: NFS Support

Unread post by RealLarry »

Doozer wrote: Fri Nov 26, 2021 4:13 pm This is the link to my kernel with only NFS on top of the standard MiSTer configuration. Now with the modular approach Soregelig has taken, kernel must be following the system image version., currently 5.15.1. Enjoy!

Code: Select all

Linux MiSTer 5.15.1-MiSTer #1 SMP Fri Nov 12 17:31:23 CET 2021 armv7l GNU/Linux
Link MiSTer 5.15.1 with NFS kernel image

It is only one line to be put inside the default MiSTer configuration file. @sorgelig, please add it as it is requested by many others. This would be terrific and more than appreciated.
Great effort! But I'm sure that a better place to open a ticket about this is his repo
Contributor of tty2oled, author of tty2tft, tty2rpi and update_tty2xxx
User avatar
RealLarry
Top Contributor
Posts: 883
Joined: Mon May 25, 2020 4:04 am
Location: San Junipero/DE/Earth
Has thanked: 120 times
Been thanked: 386 times

Re: NFS Support

Unread post by RealLarry »

I'm working on a script similar to cifs_mount.sh to mount NFS shares. While it is working so far (but not finished) I can confirm that NFS's throughout is WAY faster than CIFS, especially with WiFi. Not comparable.
Contributor of tty2oled, author of tty2tft, tty2rpi and update_tty2xxx
Bas
Top Contributor
Posts: 623
Joined: Fri Jan 22, 2021 4:36 pm
Has thanked: 80 times
Been thanked: 324 times

Re: NFS Support

Unread post by Bas »

That's a strange finding. Both protocols shouldn't really differ all that much in throughput for a simple device like this. Usually you only really start to see the hairy details with "real" network deployments with multiple nodes and a decent workload. What kind of differences do you see?
User avatar
RealLarry
Top Contributor
Posts: 883
Joined: Mon May 25, 2020 4:04 am
Location: San Junipero/DE/Earth
Has thanked: 120 times
Been thanked: 386 times

Re: NFS Support

Unread post by RealLarry »

Yeah, there isn't really a difference in speed but in responsiness and I don't see the point to use an other network protocol when doing my work between two nix boxes ;)
Contributor of tty2oled, author of tty2tft, tty2rpi and update_tty2xxx
User avatar
RealLarry
Top Contributor
Posts: 883
Joined: Mon May 25, 2020 4:04 am
Location: San Junipero/DE/Earth
Has thanked: 120 times
Been thanked: 386 times

Re: NFS Support

Unread post by RealLarry »

Attached is my NFS mount script. Place it into /media/fat/Scripts and run it once.
Based on cifs_mount.sh but totally revamped. Feel free to use and comment.
Attachments
nfs_mount.zip
(1.99 KiB) Downloaded 422 times
Contributor of tty2oled, author of tty2tft, tty2rpi and update_tty2xxx
pac
Posts: 77
Joined: Mon May 25, 2020 6:11 am
Has thanked: 70 times
Been thanked: 26 times

Re: NFS Support

Unread post by pac »

Thx @RealLarry - I assume that the script obviously needs the modified Mister-build, correct?
User avatar
RealLarry
Top Contributor
Posts: 883
Joined: Mon May 25, 2020 4:04 am
Location: San Junipero/DE/Earth
Has thanked: 120 times
Been thanked: 386 times

Re: NFS Support

Unread post by RealLarry »

pac wrote: Wed Dec 29, 2021 12:08 pm Thx @RealLarry - I assume that the script obviously needs the modified Mister-build, correct?
If you mean a modified MiSTer Kernel by modified Mister-build, then yes. But if you are unable to build your own Kernel I can offer my one for sure.
EDIT: modified Kernel attached. Before use rename your /media/fat/linux/zImage_dtb to be safe in case of failure...then extract the ZIP to the same place and reboot. Done :)
Attachments
zImage_dtb.zip
(6.07 MiB) Downloaded 324 times
Contributor of tty2oled, author of tty2tft, tty2rpi and update_tty2xxx
nedrysoft
Posts: 3
Joined: Mon Aug 08, 2022 12:35 am

Re: NFS Support

Unread post by nedrysoft »

RealLarry wrote: Wed Dec 29, 2021 7:05 am Attached is my NFS mount script. Place it into /media/fat/Scripts and run it once.
Based on cifs_mount.sh but totally revamped. Feel free to use and comment.
Hi, I've just got my MiSTer and I'm in the process of setting it up and the first thing I wanted to do after getting it installed and updated was to point it at my NFS server...which is how I've ended up here.

Many thanks for providing a pre-built kernel image with NFS enabled as it's saved me having to so it.

I was just looking at your mount script, and due to some broadband issues over the weekend (my service has been going up and down) I just spotted something that I'm curious about in your mount script.

When wait for server is enabled, why is it checking for IP connectivity by pinging google rather than the NFS server?

Was this done for a specific reason? It would make more sense (at least it would to me!) to ping the NFS server, I can't image there are many people who have their NFS server in this situation external to their LAN (or subnet).

If it's purely connectivity that is desired, then then pinging 1.1.1.1 with a TTL of 1 would at least limit the check so that DNS resolution is not required, but it would at least check that connectivity/routing as far as the gateway is at the very least working.

I really appreciate you providing both the kernel and the script as they'll be a big time saver, but it was just something I noticed, mainly because at that exact moment, my broadband went down and I was a little confused as to why it thought there was no IP.
User avatar
RealLarry
Top Contributor
Posts: 883
Joined: Mon May 25, 2020 4:04 am
Location: San Junipero/DE/Earth
Has thanked: 120 times
Been thanked: 386 times

Re: NFS Support

Unread post by RealLarry »

nedrysoft wrote: Mon Aug 08, 2022 12:49 am I was just looking at your mount script, and due to some broadband issues over the weekend (my service has been going up and down) I just spotted something that I'm curious about in your mount script.

When wait for server is enabled, why is it checking for IP connectivity by pinging google rather than the NFS server?

Was this done for a specific reason? It would make more sense (at least it would to me!) to ping the NFS server, I can't image there are many people who have their NFS server in this situation external to their LAN (or subnet).
No, you are absolutely right. Even if this script still works, it's more or less a draft to give users some ideas to work with. Feel free to adopt and mod it for your personal needs.
Contributor of tty2oled, author of tty2tft, tty2rpi and update_tty2xxx
User avatar
RealLarry
Top Contributor
Posts: 883
Joined: Mon May 25, 2020 4:04 am
Location: San Junipero/DE/Earth
Has thanked: 120 times
Been thanked: 386 times

Re: NFS Support

Unread post by RealLarry »

New NFS aware Kernel, this time with the DE10 Nano Overclock Patch, which was already merged into Main.
Attachments
zImage_dtb.7z
(5.83 MiB) Downloaded 271 times
Contributor of tty2oled, author of tty2tft, tty2rpi and update_tty2xxx
User avatar
RealLarry
Top Contributor
Posts: 883
Joined: Mon May 25, 2020 4:04 am
Location: San Junipero/DE/Earth
Has thanked: 120 times
Been thanked: 386 times

Re: NFS Support

Unread post by RealLarry »

Updated Linux Kernel, but NFS aware. That's the point :)

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

Re: NFS Support

Unread post by Bas »

I reported the request in a Github issue.

fooness

Re: NFS Support

Unread post by fooness »

Hello everyone.

Thank you all for your efforts in these regards! And thank you, Bas, for creating the GitHub issue. I basically only came here to let you know that adding kernel support for NFS was greenlit by Sorgelig, which is pretty amazing. https://github.com/MiSTer-devel/Linux-K ... 1450281378

I’m rather sure there will be ongoing efforts from your side, that’s why I wanted to say “Thank you” in advance for maybe making NFS mounts the same comfortable and easy experience, as CIFS mounts. I will keep an eye on this forum thread, and on the GitHub issue, in case I could help with any testing of possible scripts or whatnot.

In the meantime, I’m very looking forward to setting up my first MiSTer FPGA, once all components are finally being delivered to my door. 😊

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

Re: NFS Support

Unread post by Bas »

Oh nice! I'll get on it.

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

Re: NFS Support

Unread post by RealLarry »

Attached is the latest version of my script to mount NFS (v4) shares. There are only minor changes to the last version.
Maybe @Sorgelig will take it into his account, which wpuld be very welcome.

Attachments
nfs_mount.zip
(1.98 KiB) Downloaded 265 times
Contributor of tty2oled, author of tty2tft, tty2rpi and update_tty2xxx
Post Reply