Permanently Mount Network Drive with Samba



Setting Up a Network Shared Folder
Most of this information is from [https://help.ubuntu.com/community/How%20to%20Create%20a%20Network%20Share%20Via%20Samba%20Via%20CLI%20(Command-line%20interface/Linux%20Terminal)%20-%20Uncomplicated,%20Simple%20and%20Brief%20Way! here]. First we need to install Samba Set a password for Samba where "user_name" should be replaced with your username (maybe pi?).

Let's assume that your the folder you'd like to share is at /home/user_name/shared_folder. We need to edit one file:

Add the following the end of the file:  [shared_folder] path = /home/user_name/shared_folder available = yes valid users = user_name read only = no browseable = yes public = yes writable = yes where again, "user_name" should be replaced with your username.

Now restart the Samba server.

To access your shared folder on another network computer, type This will then prompt for the Samba login credentials. If successful, you'll get a prompt that says  smb: \> Type dir to list the contents of the share drive. If this works, you've successfully accessed the shared folder, and your Samba server is working properly.

Mounting a Network Shared Folder
First you'll need to create a folder where you'll mount the network share. You'll also want to change the permissions on the new mount folder This combination (775) provides read, write, execute permissions to all the current user and group, and only read, execute permissions to the rest of the world. Here's a link showing various chmod configurations.

To mount the drive, type Here, of course, replace "XXX" with the Samba username, "YYY" with the Samba password, "host_IP" with the IP address (or host name) that's sharing the folder, "shared_folder" with the actual name of the shared folder in the Samba server's /etc/samba/smb.conf, and "/mnt/mydrivename" with the location of the folder where your want to mount the drive.

If you're successful, you should be able to browse the contents of the network drive.

Automount Network Shared Drive on Boot
To mount the shared folder automatically on boot, we simply need to modify one line of /etc/fstab. At the end of the list, add a line with the following information, separated by tabs: Where again, you should replace "XXX" with the Samba username, "YYY" with the Samba password, "host_IP" with the IP address (or host name) that's sharing the folder, "shared_folder" with the actual name of the shared folder in the Samba server's /etc/samba/smb.conf, and "/mnt/mydrivename" with the location of the folder where your want to mount the drive.

Here's an example of my /etc/fstab file:

When you reboot, you should be able to go directly to your newly-mounted drive.

Mounting Windows Share on Linux
To share a Windows folder to a Linux computer, I kindly refer you to this great tutorial:

http://www.howtogeek.com/176471/how-to-share-files-between-windows-and-linux/

