Page 4 of 5

Re: NFS Support

Posted: Sun May 21, 2023 2:58 pm
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).


Re: NFS Support

Posted: Sun May 21, 2023 3:02 pm
by Nikoh

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


Re: NFS Support

Posted: Sun May 21, 2023 3:05 pm
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).


Re: NFS Support

Posted: Sun May 21, 2023 3:17 pm
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


Re: NFS Support

Posted: Sun May 21, 2023 3:32 pm
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?


Re: NFS Support

Posted: Sun May 21, 2023 4:00 pm
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.


Re: NFS Support

Posted: Sun May 21, 2023 4:02 pm
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...


Re: NFS Support

Posted: Sun May 21, 2023 5:36 pm
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.


Re: NFS Support

Posted: Mon May 22, 2023 10:40 am
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.


Re: NFS Support

Posted: Mon May 22, 2023 12:01 pm
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.


Re: NFS Support

Posted: Mon May 22, 2023 12:04 pm
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.


Re: NFS Support

Posted: Mon May 22, 2023 12:52 pm
by Nikoh

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


Re: NFS Support

Posted: Mon May 22, 2023 1:24 pm
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.


Re: NFS Support

Posted: Mon May 22, 2023 1:31 pm
by RealLarry

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


Re: NFS Support

Posted: Mon May 22, 2023 1:45 pm
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.


Re: NFS Support

Posted: Mon May 22, 2023 2:03 pm
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!


Re: NFS Support

Posted: Mon May 22, 2023 2:12 pm
by Nikoh

Oh yeah, now all work fine.
Weel done!


Re: NFS Support

Posted: Mon May 22, 2023 2:16 pm
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 :)


Re: NFS Support

Posted: Thu Jun 01, 2023 4:50 pm
by Bas

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


Re: NFS Support

Posted: Wed Oct 18, 2023 8:42 pm
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!


Re: NFS Support

Posted: Thu Oct 19, 2023 4:54 am
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?


Re: NFS Support

Posted: Thu Oct 19, 2023 8:11 pm
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 :)


Re: NFS Support

Posted: Fri Oct 20, 2023 5:41 am
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 :)


Re: NFS Support

Posted: Fri Oct 20, 2023 7:06 am
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.


Re: NFS Support

Posted: Fri Oct 20, 2023 4:40 pm
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.


Re: NFS Support

Posted: Fri Oct 20, 2023 7:56 pm
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


Re: NFS Support

Posted: Sat Oct 21, 2023 3:01 am
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.


Re: NFS Support

Posted: Sat Oct 21, 2023 7:37 am
by Bas

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


Re: NFS Support

Posted: Sat Oct 21, 2023 6:30 pm
by losth1ghway

ah yeah, good point.


Re: NFS Support

Posted: Sun Oct 29, 2023 10:23 am
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