I’ve 2 network drives on one subnet (nfs and samba). I would like to access them only if computer is connected to particular ssid (subnet).

I’m using gnome primarily. And files stops responding if mount points can’t be accessed. There is no real way to recover from this apart from connecting to network, unmount and then change network.

I would like those drives to be accessed by system only if they are reachable.

[EDIT][UPDATE]: Following suggestions from comments. I’ve tried systemd and autofs methods both of them don’t work the way I’ve setup access to mounts. If mount point is in home OR bookmarks in files app, it would hang up as soon as network is disconnected. It works well when mount points are not visible by default (for e.g. /smb/share1). Currently using autofs <- easy and short to setup with mount points under /smb and /nfs

  • rando@lemmy.mlOP
    link
    fedilink
    arrow-up
    1
    ·
    8 天前

    Not really tied to gnome, it’s just something I’m using. Would KDE work better ?

      • rando@lemmy.mlOP
        link
        fedilink
        arrow-up
        1
        ·
        7 天前

        just tried Dolphin (KDE file manager) - same experience. Going to experiment with autofs next

        • stupid_asshole69 [none/use name]@hexbear.net
          link
          fedilink
          English
          arrow-up
          2
          ·
          7 天前

          Man that makes me feel old, apparently konqueror was the kde web browser!

          So if I access a smb network share in pcmanfm-qt then switch networks my cursor turns into the watch when I try to click stuff in the share but nothing is hung or stuck and I can just click off it and even unmount using the eject icon beside the share name.

          This is using Debian 13 with lxqt.

      • rando@lemmy.mlOP
        link
        fedilink
        arrow-up
        1
        ·
        8 天前

        It was through fstab until recently. About 2 weeks back I moved to mount them on demand (systemd, will confirm exact method when I’m in front of computer) however this still doesn’t address unmount part when I switch network.