Automount fstab question

I have a laptop that spends 90% of it's time on a single network, and a server with several shares where I store files, like pictures.

For example I have my fstab configured with this line:

//192.168.224.45/Pictures /home/jediwan/Pictures cifs credentials=/home/jediwan/.smbcredentials,uid=1000,gid=1000,x-systemd.automount 0 0

And it works great as long as I'm on the same network. But if I'm not on my main network the PC struggles to load GNOME and eventually crashes. What do?

EDIT: Adding nofail worked

sgibson5150 ,
@sgibson5150@slrpnk.net avatar

Same dog bit me recently. I'd swapped a drive out. It was like a week later when I needed to reboot into Debian. Then I had to do some research. 😆

Glad you got it sorted.

flork OP ,
@flork@lemy.lol avatar

I'm just happy I thought to test it before I left the network!

WhyAUsername_1 ,

I have had bad luck in the past where my drive would not spin up at boot for some reason. I end up modifying the fstab file with a live boot USB and then start the system with revised FSTAB.

Just my 2 cents that would help in case of a dead lock situation.

flork OP ,
@flork@lemy.lol avatar

Great idea in general to have a live USB laying around just in case. I should make one now.

TCB13 ,
@TCB13@lemmy.world avatar

Adding nofail will most likely fix this. However switching from fstab mounts to systemd mounts could be cleaner as you would be able to create a systemd target that gets activated whenever you're on your main network and then trigger a mount of the share / unmount when you leave.

Certainly_No_Brit ,

The OS will wait until the mount is successful with these settings, which is why GNOME doesn't load. Try adding nofail to your options. It should continue with the boot process if you are out of the network with that option set. (https://wiki.archlinux.org/title/Fstab#External_devices)

jaykay ,
@jaykay@lemmy.zip avatar

Archwiki to the rescue as usual

TGhost ,
@TGhost@lemmy.blahaj.zone avatar

running arch btw,

flork OP ,
@flork@lemy.lol avatar

This did it thank you

AbidanYre ,
starflower ,

Not sure if my client is borked of if you forgot to paste the fstab line

flork OP ,
@flork@lemy.lol avatar

You sir are the bork

starflower ,

guh!

  • All
  • Subscribed
  • Moderated
  • Favorites
  • linux@lemmy.ml
  • random
  • All magazines