I've edited my fstab file to provide all the details of my network drive. It works fine, however, after my laptop (re)start, I still need to run manually sudo mount -a.

Here is fstab line: /// /home/my_user/net_drive cifs credentials=/home/my_user/.smbcredentials,vers=3.0,iocharset=utf8,gid=1000,uid=1000,file_mode=0777,dir_mode=0777 0 0

How can I automate it (kind of autoexec.bat from Windows), so I don't have to run mount manually each time?

Thanks, Paul

  • You haven't provided any details of what you changed in your file-system table, my own auto-mounts using that alone with ",auto" option if required (specifics help). It slows boot down though if a network drive isn't powered (as it'll wait for timeout, so I don't do it for all my network shares).
    – guiverc
    Dec 27, 2020 at 4:43
  • added fstab line.
    – Paul
    Dec 27, 2020 at 5:22

1 Answer 1


It's likely that your network isn't up yet when your system tries to automount the share. Try adding: x-systemd.automount,x-systemd.requires=network-online.target to the fstab entry.

If that doesn't work you could try adding mount -a to your /etc/rc.local file as that gets executed rather late during bootup.

  • Thanks Bene, it worked!
    – Paul
    Dec 27, 2020 at 7:41
  • Glad I could help!
    – Béné
    Dec 27, 2020 at 7:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .