๐Ÿ”ฅ Introductory Offer: Become a member and get Ad-free browsing + more (50% Off with code LAUNCH; first 25 uses).

Automount Samba share

Automount Samba share during boot. This is very easy to accomplish in Ubuntu or any other Linux distribution.

First backup your original /etc/fstab file.

sudo cp /etc/fstab /etc/fstab.backup

Then, install the smbfs package if you dont already have it:

sudo apt-get install smbfs

Next, edit /etc/fstab in your favorite editor.

sudo nano -w /etc/fstab

Add the following line as a new single line into fstab file:

\\SAMBASERVERShareName /mountlocation smbfs user=username,passwd=password 0 0

Automount Samba share Notes

SAMBASERVER is the domain name, hostname or ip address of the Samba server.
ShareName is the name of the samba share (can be found in /etc/samba/smb.conf file on the server).
/mountlocation is the location on the computer where you would like to mount the Samba share. username and password are the username and password to access the Samba share.

Recommended Guides on Linux Commands:

Here is an example:

\\192.168.1.100movies /media/movies smbfs user=ryan,passwd=xXxXxXxXxXx 0 0

Note that everything is in a single line. "192.168.1.100" can also be mysambaserver.com if you have domain name setup.

I hope it works for you. Good luck!.

Be the ONE IN 100,000 that read this, and support us...
  • Feeling generous? Become a member and get ad-free browsing, exclusive content, Discord benefits, and more.
  • Just want to thank us? Buy us a Coffee or a Ko-Fi.
  • May be another day? Shop on Amazon using our links. Your prices won't change but we get a small commission.
  • Don't feel like spending? You can still show your support by sharing this post, linking to it in forums, or even commenting below.

Anand

Anand is a self-learned computer enthusiast, hopeless tinkerer (if it ain't broke, fix it), a part-time blogger, and a Scientist during the day. He has been blogging since 2010 on Linux, Ubuntu, Home/Media/File Servers, Smart Home Automation, and related HOW-TOs.

SUBSCRIBE