I have SSHFS on my server and would like to have it automatically mounted and store all of the documents, desktop, downloads, etc. on a couple computers. I am able to get it to all work except for mounting on startup. The server is Debian 12 and both clients are Tumbleweed. Nothing in fstab seems to work. When I add x-systemd.automount, well, at best programs that try to use it crash and at worst I have to go through recovery mode to get the system to boot properly. I am using ed25519 keys with no passwords for authentication. Does anyone know how I could get this to work?

10 points

Using systemd is way better than fstab even though it requires way more work. Systemd can automatically mount it when the server is available.

Also why are you using sshfs? Wouldn’t it be simpler to go the Samba route?

permalink
report
reply
6 points

Autofs works with sshfs. I use it for mounting anything over a network. It automounts on demand and disconnects a mount after a period of inactivity.

https://wiki.archlinux.org/title/autofs

permalink
report
reply
2 points

Plus one for autofs, works so well that I often forget that certain files are actually remote resources

permalink
report
parent
reply
5 points

Write a systemd service, that’s how my computers mount my nas. you just need to have it run under your user instead of root or point it towards the right keys manually.

permalink
report
reply
4 points

And consider adding a timeout, or else all your devices will take and additional 2 minutes to boot if the server is offline and the mount fails.

permalink
report
parent
reply
1 point

I just have them check for my wifi. If that’s what they’re connected to, then the nas is available. If not, then there’s no point trying to mount it. However, one day every month my nas pulls updates and shuts down afterwards, so that I need to boot it again when I get home from work. But my laptop boots just as fast as it normally does, even though it fails to connect to the nas.

permalink
report
parent
reply
3 points

You can add it to your fstab, then it will be mounted on boot. I think Archwiki has some guidance on this, however the autofs solutions sounds better since, if you directly mount the sshfs via fstab, then if you boot the device without a connection to that sshfs, it will hang during boot for a while as it tries to connect.

permalink
report
reply
3 points

store all of the documents, desktop, downloads, etc. on a couple computers

Why use SSHFS for that? I recommend using Syncthing, it’s great for synchronizing stuff across multiple PCs (local and remote).

permalink
report
reply
13 points

Why use SSHFS for that?

So that you don’t have copies of files everywhere.

permalink
report
parent
reply
1 point

What do you mean “everywhere”?

permalink
report
parent
reply
4 points

everywhere you want to use the files.

permalink
report
parent
reply
10 points
*

I don’t really know what that is. I could try it though.

Edit: I don’t really like having the files on all computers, I would rather just have them all in a central place where everything can access them.

permalink
report
parent
reply

Selfhosted

!selfhosted@lemmy.world

Create post

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don’t control.

Rules:

  1. Be civil: we’re here to support and learn from one another. Insults won’t be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it’s not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don’t duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

Community stats

  • 4.7K

    Monthly active users

  • 3.5K

    Posts

  • 78K

    Comments