“ls” shows no files in mounted NFS folder, but “cd” works
I presume that your NFS share is automounted, yes?
Before the share is actually mounted, /vol/mynfs
is just an empty directory, so ls
shows it as that. Moving to that directory forces the mount to actually happen, so the ls
after that shows the contents of the now-mounted directory.
The files will be listable as long as the share is actually mounted. If the share is subsequently unmounted (manually or automatically, after an inactivity timeout), the directory will appear to be empty again.
Something like (cd /vol/mynfs; ls)
will force the mount and do the ls
, if that's what you need to do for some reason.