1. make sure SAMBA is running (SMB=Server Message Block) in a shell as the root user run:
# chkconfig smb on
This ensures that samba is being started on reboot. If you would like to learn more about SAMBA click here.
# /etc/init.d/smb start
2. Create the mountpoint:
# mkdir /<MOUNTPOINT>
For example you want to create a mountpoint called images in /mnt:
# mkdir /mnt/images
3. Add the following line to /etc/fstab to ensure the shared directory is mounted on each reboot.
The entries bg and soft ensure that the Linux machine can boot up even if the shared directory isn’t available.
The option rw stands for read-write access.
//<SERVER_NAME>/<SHARED_DIRECTORY> /<MOUNTPOINT> smbfs username=<WINDOWS_USER_NAME>,passwd=<WINDOWS_PASSWORD>,rw,bg,soft 0 0
For example:
Servername: server5
Shared directory: images
Mountpoint (on the Linux side): /mnt/images
Windows username: bert
Windows password: ernie
The line would look like this:
//server5/images /mnt/images smbfs username=bert,passwd=ernie,rw,bg,soft 0 0
If the servername can’t be resolved you can also use the IP-address.
For example if server5’s IP-address is 192.168.2.23 the line would look like this:
//192.168.2.23/images /mnt/images smbfs username=bert,passwd=ernie,rw,bg,soft 0 0
4. Once this entry is there mount the shared directory by running:
# mount –a
This command reads the content of /etc/fstab and will attempt to mount every filesystem entered in there.
5. To verify your share is mounted run:
# df –h
And look for /<MOUNTPOINT> (in our example /mnt/images).
If the value in GB or MB is greater 0 you successfully mounted your share.
|