This post will guide you how to configure your samba server to automount windows share folder at boot in Linux operating system. How to mount samba share permanently in Linux. How to use the /etc/fstab to mount an Samba share at system boot under CentOS/RHEL/Ubuntu Linux.
AutoMount Windows Samba Share
Normally, you can use the mount command to mount a windows share folder into your current Linux system. but if you reboot the system, you need to remount this samba share again. so if you want to mount the samba share permanently, you need to update the /etc/fstab configuration file. Just do the following steps:
#1 open /etc/fstab file via a text editor, such as: vi/vim, type:
# vim /etc/fstab
#2 add the following line into your fstab file.
//<IP>/<share-name-of-directory> /mount/point cifs username=share_username,password=share_password,sec=ntlmssp,multiuser,defaults 0 0
Note: you need to replace the values with those that match your environment.
- //<IP>/<share-name-of-directory> – windows samba share name
- /mount/point – mount point in your Linux system
- cifs – File system type
- Username, password – share username and password
#3 save and close the file.
#4 the Samba share will be mounted in the next time the system is rebooted. and you can also mount the smb share now, just execute the below mount command:
#mount -a