This article describes how to mount (map) a remote samba (or Windows) share on a server, to a directory on the local FreeBSD Unix client. See Related Links at the end for mounting network shares from other types of client.
This uses the Unix mount_smbfs command. It is not necessary to have Samba installed on the client which will be mounting to the remote share.
However the user may wish to be familiar with Samba on Unix and with the general concept of mounting network shares, such as using UNC paths.
Mounting the drives
The following example uses a file server - Server1 with a share (shared directory) called Files. The workstation (client) is running Unix and will mount the networked share to a local diretory.
Note that the server can be Unix or Windows as the principle of mounting these shares is the same for both. The action all happens at the client end and really consists of only a couple of steps.
Firstly create a directory on the client where the share will be mounted to - in Unix this is commonly known as a mount point. This directory can be anywhere in the file system, but traditionally is created in the local /mnt directory..
The user must have a username and password account on the file server, which is required to access the share.
Run the following command from the Unix workstation..
mount_smbfs -I 10.0.0.2 //andym@server1/files /mnt/music
- -I 10.0.0.2 is the IP Address of the file server
- //andym@server1/files is the username@servername/sharename
- /mnt/music is the local mount point on the workstation
After being prompted for a password, the contents of the /files share should be available in /mnt/music/files
To unmount the share, type the following command..
If the workstation is mounting to the server through a firewall, port 139 may need to be opened / forwarded.
Although the principles are the same for other client operating systems, the commands may differ slightly..
Mounting shares from a Red Hat Linux client
Mounting shares from a Fedora client
Mounting shares from a Ubuntu client