NFS Support

Kernel, Main, Utilities & Applications, Miscellaneous Devices.
User avatar
RealLarry
Top Contributor
Posts: 768
Joined: Mon May 25, 2020 4:04 am
Location: San Junipero/DE/Earth
Has thanked: 86 times
Been thanked: 329 times

Re: NFS Support

Unread post by RealLarry »

Nikoh wrote: Sun May 21, 2023 12:42 pm

@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?

Hmm, haven't (re-) checked this yet, but it should if you are having these folders at your NFS destination.
I'm the original author of this script and I'm using NFS/MiSTer since 2 yrs. now for my three MiSTer devices. "saves" is shared, "Filters" not (not existent at NFS).

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 »

I have these folders on my nas...
have you tried to do mount -l to see if saves is mounted?


Image

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

Re: NFS Support

Unread post by RealLarry »

Nikoh wrote: Sun May 21, 2023 3:02 pm

I have these folders on my nas...
have you tried to do mount -l to see if saves is mounted?

Yes, "saves" is present on NFS and is getting mounted. The folder on MiSTer's SD is empty (before getting mounted).

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 »

mmmm very very strange, I tried and retried bun nothing...
Folder are identical, on both same owner, same rights and same group but saves and Filters are not mounted, no way... i think that ios better loooking on the code


Image

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

Re: NFS Support

Unread post by RealLarry »

Nikoh wrote: Sun May 21, 2023 3:17 pm

mmmm very very strange, I tried and retried bun nothing...
Folder are identical, on both same owner, same rights and same group but saves and Filters are not mounted, no way... i think that ios better loooking on the code

Strange... Keep in mind that file and folder names are case sensitive on NFS. Can you ensure that you named the folder "saves" and not "Saves", for example?

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 »

Bug confirmed I think...; I renamed saves on saves2 on both nas and sd, and has been mounted.
Reverted/renamed in saves still don't mount it, I don't think it's a problem of my environment.


Image

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

Re: NFS Support

Unread post by Nikoh »

The problem evidently lies in the second/last part of the script because on /tmp/nfs_mount I see both folders (it could not be otherwise) saves and savestates...


Image

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

Re: NFS Support

Unread post by RealLarry »

I see that I'm still using my own old original script (see attached). Will have a look at this tomorrow with the official script.

Attachments
nfs_mount.zip
(2.07 KiB) Downloaded 115 times
Contributor of tty2oled, author of tty2tft, tty2rpi and update_tty2xxx
User avatar
RealLarry
Top Contributor
Posts: 768
Joined: Mon May 25, 2020 4:04 am
Location: San Junipero/DE/Earth
Has thanked: 86 times
Been thanked: 329 times

Re: NFS Support

Unread post by RealLarry »

Nikoh wrote: Sun May 21, 2023 4:02 pm

The problem evidently lies in the second/last part of the script because on /tmp/nfs_mount I see both folders (it could not be otherwise) saves and savestates...

Confirming the issue. The problem here is the "find" command in line 242 (of the actual nfs_mount.sh) which seems to ignore the 2nd find with "similar names" like "savestates" and "saves". @Bas If I replace that line with

Code: Select all

for LDIR in $(ls /tmp/${SCRIPT_NAME}); do

from my original script it is working again as normal.

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

Re: NFS Support

Unread post by Bas »

That'll work as long as there are only directories in /tmp/${SCRIPTNAME}. The find is there to pick up only real directories, not things like symlinks or files. My first hunch: there are symlinks at play either on the SD card or on the server.

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

Re: NFS Support

Unread post by RealLarry »

Bas wrote: Mon May 22, 2023 12:01 pm

That'll work as long as there are only directories in /tmp/${SCRIPTNAME}. The find is there to pick up only real directories, not things like symlinks or files. My first hunch: there are symlinks at play either on the SD card or on the server.

No, they aren't (at least on my SD and NAS). "savestates" and "saves" are real but empty folders on SD.

EDIT1: For demonstration purposes I've just created two additional dummy folders in /media/fat, named "testme" and "testmeifyoucan". Both are havin' a nonsense file. "testmeifyoucan" is getting mounted, "testme" not.

EDIT2: Looks like I have found the culprit: It is grep in line 244! The clause of grep -q "/media/fat/${LDIR}" is finding "saves", which fits on top to "savestates" and therefore the if isn't executed. I've tested this with a grep -qx (line-regexp) and all is good then.

grep --line-regexp: Select only those matches that exactly match the whole line.

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 »

Ok guys, thanks, I am happy to help MiSter project... ;-)
Please let me know when I can download the new script.


Image

Bas
Top Contributor
Posts: 518
Joined: Fri Jan 22, 2021 4:36 pm
Has thanked: 60 times
Been thanked: 225 times

Re: NFS Support

Unread post by Bas »

Good find! ;-)

I'll prep a PR for it and will drop a note here when the script is updated in my own GitHub so you can start playing with it before it gets approved upstream.

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

Re: NFS Support

Unread post by RealLarry »

Thanks go to @Nikoh, who discovered it. I only take care of my "children" and tighten the screws :ugeek:

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

Re: NFS Support

Unread post by Bas »

The main branch of my repo has the change now:

https://github.com/basvandewiel/misternfs

..assuming @RealLarry knows what he's doing I just blindly patched it, can't test it myself right now but seems quite legit. Please test. If things look good now I'll get it upstreamed when I get home today.

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

Re: NFS Support

Unread post by RealLarry »

Bas wrote: Mon May 22, 2023 1:45 pm

The main branch of my repo has the change now:

https://github.com/basvandewiel/misternfs

..assuming @RealLarry knows what he's doing I just blindly patched it

Great! And yes, normally I know what I'm doing. But no warranty and w/o batteries included :)

can't test it myself right now but seems quite legit. Please test. If things look good now I'll get it upstreamed when I get home today.

It's working for me and if @Nikoh confirms that later, we'd be glad to get this also pushed to upstream. Yeah!

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 »

Oh yeah, now all work fine.
Weel done!


Image

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

Re: NFS Support

Unread post by RealLarry »

Nikoh wrote: Mon May 22, 2023 2:12 pm

Oh yeah, now all work fine.
Weel done!

You are welcome! Thanks for finding, reporting and testing this issue. We all deserve a nice drink afterwards :)

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

Re: NFS Support

Unread post by Bas »

...and it's been upstreamed. Cheers!

losth1ghway
Posts: 6
Joined: Wed Oct 18, 2023 8:33 pm

Re: NFS Support

Unread post by losth1ghway »

hey there,

i'm having some problems getting nfs mounts to work on mister.
i have edited the nfs_mount script directly, the relevant part is here: https://pastebin.com/stz0xeZD

this is pointing to a share on a zfs pool. the pool is shared correctly and accessed by other devices over nfs on my home network.

under /tank/mister/games is one dir "Saturn" which i am just using to test if the share is working.
when using the mount script from the mister menu i get no error, just "press any key" after awhile. however, if i load the saturn core there will be no game to load there and the bios doesn't load. it seems as if the mount didn't infact work.
the script does seem to be seeing my server correctly though, as if i remove the games dir and call the script again it will give an error that there is no such directory at /tank/mister/games.

any help on this would be really appreciated!

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

Re: NFS Support

Unread post by RealLarry »

If /tank/mister/games is your NFS export (share) on the server, then this path should contain all (sub-) folders to mount into MiSTer's root (/media/fat). To keep your example of "Saturn" your share should have a /tank/mister/games/games/Saturn to get mounted correctly.

/tank/mister/games is your export, but your goal is to mount "games" (and it's subfolder "Saturn") mounted into /media/fat/games... Get it?

Contributor of tty2oled, author of tty2tft, tty2rpi and update_tty2xxx
losth1ghway
Posts: 6
Joined: Wed Oct 18, 2023 8:33 pm

Re: NFS Support

Unread post by losth1ghway »

RealLarry wrote: Thu Oct 19, 2023 4:54 am

If /tank/mister/games is your NFS export (share) on the server, then this path should contain all (sub-) folders to mount into MiSTer's root (/media/fat). To keep your example of "Saturn" your share should have a /tank/mister/games/games/Saturn to get mounted correctly.

/tank/mister/games is your export, but your goal is to mount "games" (and it's subfolder "Saturn") mounted into /media/fat/games... Get it?

aha! thanks for that. working perfectly now :)

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

Re: NFS Support

Unread post by RealLarry »

losth1ghway wrote: Thu Oct 19, 2023 8:11 pm
RealLarry wrote: Thu Oct 19, 2023 4:54 am

If /tank/mister/games is your NFS export (share) on the server, then this path should contain all (sub-) folders to mount into MiSTer's root (/media/fat). To keep your example of "Saturn" your share should have a /tank/mister/games/games/Saturn to get mounted correctly.

/tank/mister/games is your export, but your goal is to mount "games" (and it's subfolder "Saturn") mounted into /media/fat/games... Get it?

aha! thanks for that. working perfectly now :)

You are welcome! Thanks for the feedback. Your question was clearly written so the answer was obvious :)

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

Re: NFS Support

Unread post by Bas »

@losth1ghway Did you find the docs that go with the script? And if so, were they unclear? I'd like to improve the docs if they're fuzzy.

losth1ghway
Posts: 6
Joined: Wed Oct 18, 2023 8:33 pm

Re: NFS Support

Unread post by losth1ghway »

I didn't find nfs docs, no -- I was just going off the comments in the script.
I had a look at the docs here: https://mister-devel.github.io/MkDocs_M ... d/network/ but nfs seems to be missing.

Bas
Top Contributor
Posts: 518
Joined: Fri Jan 22, 2021 4:36 pm
Has thanked: 60 times
Been thanked: 225 times

Re: NFS Support

Unread post by Bas »

I guess those weren't properly upstreamed then. I'll check in with Sorg for that. In the mean time (I canceled my GitHub):

https://code.area536.com/Public/misternfs

losth1ghway
Posts: 6
Joined: Wed Oct 18, 2023 8:33 pm

Re: NFS Support

Unread post by losth1ghway »

well-written docs!
next question: mounting only dirs is mentioned, but is there any downside to keeping your mister.ini configs server-side also?
seems handy to be able to be able to edit some things without turning on the mister.

Bas
Top Contributor
Posts: 518
Joined: Fri Jan 22, 2021 4:36 pm
Has thanked: 60 times
Been thanked: 225 times

Re: NFS Support

Unread post by Bas »

I'm quite sure MiSTer will finish it's boot sequence before the remote mount is available.

losth1ghway
Posts: 6
Joined: Wed Oct 18, 2023 8:33 pm

Re: NFS Support

Unread post by losth1ghway »

ah yeah, good point.

losth1ghway
Posts: 6
Joined: Wed Oct 18, 2023 8:33 pm

Re: NFS Support

Unread post by losth1ghway »

today i noticed, after mounting all folders under games/, the update_all script is failing due to a permissions error on /media/fat/games/Apple-I.
it update runs fine if i unmount the shares (via nfs_unmount.sh).

it seems like permissions for Apple-I is set the same as everything else under games as far as I can tell.

Code: Select all

drwxr-xr-x  4 dbus dbus   7 Mar  7  2022  AO486
drwxr-xr-x  2 dbus dbus   2 Mar  7  2022  APOGEE
drwxr-xr-x  2 dbus dbus   2 Feb 20  2020  Apple-I
drwxr-xr-x  3 dbus dbus   4 Mar  7  2022  Apple-II
drwxr-xr-x  2 dbus dbus   2 Mar  7  2022  AQUARIUS
Post Reply