Score:0

reconnect automatically a network shared foler who was disconnected

ps flag

I followed this tutorial : https://www.chrisrmiller.com/mount-samba-share-in-ubuntu/ I modified the fstab file as it says. to mount a network shared folder in my Ubuntu 22.04. All is ok, but sometimes the distant computer (a windows system) must be off. When I reboot the windows computer AFTER my ubuntu, my shared folder doesn't connect anymore in my Linux computer.. How can I do to have the (re)mount automatically ? Thx !!

Score:1
es flag

One method is to use an automount directive in fstab.

Let's take the linked HowTo's example:

/// /mnt/myFolder/ cifs username=YOURUSERNAME,password=YOURPASSWORD,iocharset=utf8,file_mode=0777,dir_mode=0777

Add 3 more options: noauto,x-systemd.automount,x-systemd.idle-timeout=30

  • noauto = the share will not automount at boot
  • x-systemd.automount = the share will mount when the mount point is accessed by you, a process, an application, a script, pretty much anything. It's fairly seamless in operation.
  • x-systemd.idle-timeout=30 = the share will unmount if access is idle for 30 seconds - you can change this to whatever you want.

The resulting fstab declarations would look like this:

//<your-ip-address>/<mount-name> /mnt/myFolder/ cifs username=YOURUSERNAME,password=YOURPASSWORD,iocharset=utf8,file_mode=0777,dir_mode=0777,noauto,x-systemd.automount,x-systemd.idle-timeout=30
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.