Append something like below into /etc/fstab
# /etc/fstab: static file system information.
#
# <fs> <mountpoint> <type> <opts> <dump/pass>
...
//192.168.0.10/path/to/source /path/to/target cifs user,uid=1000,_netdev,noauto,x-systemd.automount,credentials=/path/to/cred 0 0
- The value for
uid
can be obtained via
id -u <user-name>
_netdev,noauto,x-systemd.automount
are necessary for network mount. See fstab at ArchWiki.
If you want them to be mounted only upon access, you will need to use the
noauto,x-systemd.automount
parameters.
Also, the
_netdev
option ensures systemd understands that the mount is network dependent and order it after the network is online.
- Content of the
/path/to/cred
username=<user>
password=<password>
- Run the following to remount all the partitions
# mount -a