Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
Lum
Aug 13, 2003

I'm running KDE Neon 5.14.3 on my laptop (so basicallu Ubuntu 18.04 LTS) and have a lovely buffalo NAS with a crap version of Samba that's several years old. To access the NAS from the internet I go via a Raspberry Pi which mounts the NAS over NFS. Only the SSH port to the Pi is accessible from the outside world.

So on the laptop I have NFS mounts in /etc/fstab and that works great, but I'm wondering if there's some sensible way I can make these mounts use SSHFS when I'm away from home as I really can't be hosed with VPNs for this purpose. I guess I can manually mount them into the same place but does there exist any tool that can automate this, so the /nfs/blah mounts on my laptop basically always work if there is internet.

Adbot
ADBOT LOVES YOU

crabcakes dogg
Aug 8, 2017

by Fluffdaddy
Do you have an iPhone? You can use Shortcuts to have your phone connect via SSH and run a script.

Or am I missing something? It sounds needlessly complicated.

Lum
Aug 13, 2003

crabcakes dogg posted:

Do you have an iPhone? You can use Shortcuts to have your phone connect via SSH and run a script.

Or am I missing something? It sounds needlessly complicated.

No, I have a laptop running Linux (KDE Neon). SSHFS runs really slow on the LAN, so I only really want to use it when traveling.

Poopernickel
Oct 28, 2005

electricity bad
Fun Shoe
Write a mount helper script and save it to /sbin/mount.(type).

The script could try an NFS mount first, and then fail over to SSHFS. Once you have it working, you should be able to use it as the filesystem type in /etc/fstab, or specify a #type argument.

Here's an example of the syntax for a mount-helper: https://github.com/ncw/rclone/wiki/rclone-fstab-mount-helper-script

oh, also - if you put it in your fstab, you probably want these options: "noauto,nofail,_netdev,x-systemd.automount" and also maybe "nobootwait"

Poopernickel fucked around with this message at 19:33 on Nov 29, 2018

  • Locked thread