Fix automatic mounting of network share (Linux, systemd)

Last modified by henrikma@helsinki_fi on 2024/02/07 06:21

If your network share doesn't mount on startup even though you have added the respective line to /etc/fstab, it might be that your computer tries to mount the drive before the network is up. In this case, you can try adding (any or all of) the following tags to your fstab configuration: noauto, x-systemd.automount, _netdev. An example of a working fstab line can look like this:

//xx.xxx.xx.x/pc-data /data/pc_data cifs uid=phasecontrast,gid=phasecontrast,file_mode=0660,dir_mode=0770,vers=3,iocharset=utf8,username=xxx,password=xxx,noauto,x-systemd.automount

Relevant links:

https://askubuntu.com/a/1242516

https://askubuntu.com/questions/399643/cifs-mount-through-fstab-not-mounting-at-boot