ericvlog / note

6 stars 1 forks source link

/etc/fstab mount not working on startup but no errors - Linux Mint Forums #37

Open ericvlog opened 1 year ago

ericvlog commented 1 year ago

Save From : /etc/fstab mount not working on startup but no errors - Linux Mint Forums

Content

Re: /etc/fstab mount not working on startup but no errors

Post by altair4 » Sat Feb 22, 2020 8:25 am

The entry you have in fstab is being executed during the boot process before the network stack is up and operational on Mint.

One way around this is a systemd automount which will make it so it mounts on demand ( when accessed ) rather than mounting it at boot. Easy enough to accomplish but first you need to change your mount point to something other than under /media or your home directory - For Example:

Code: Select all

sudo mkdir /mnt/BackupDrive

Then change your fstab expression to mount to the new mount point and add two more options: noauto and x-systemd.automount.

Code: Select all

//192.168.101.193/6tb /mnt/BackupDrive cifs defaults,rw,username=(redacted),password=(redacted),iocharset=utf8,vers=3.0,noauto,x-systemd.automount   0       0

[1] Unmount the share if you already mounted it:

Code: Select all

sudo umount /media/adriaan/BackupDrive

[2] The do the systemd 2-step:

Code: Select all

sudo systemctl daemon-reload
sudo systemctl restart remote-fs.target

Now check /mnt/BackupDrive to confirm everything is there.

Side note: There is an additional option you can use that will unmount the share automatically when the system detects no activity on the share: x-systemd.idle-timeout=30 If the share in inactive for 30 seconds ( you can change that to whatever you want ) the system will unmount the share.

Note