Best way for live mapping a NAS shared folder

What you want to do can be done in numerous ways albeit not to the degree you likely are looking for.

You can use systemd units - which can be made to mount when accessing the mountpoint - and it will only mount if the server is available - if the server is not available the mountpoint is empty.

One important thing about mount units - when you go down the automount path - do not enable the mount unit as this will conflict with the automount and neither will work.

The concept of systemd units is described in this topic

Sample mount units can be found in this topic

Another option is to use GVFS to mount on the fly and you can find an utility script in this topic

2 Likes