May 23








This step-by-step tutorial will show you how to mount a Windows Share on most versions of Linux. We will be using the following information below for the examples in this tutorial:
IP Address of Windows/Samba Server: 10.16.10.10
Windows/Samba Share Name: swap
Linux Directory where Windows/Samba Share will be mounted: /mnt/swap
Local Linux Username: crazyedy
Windows/Samba Domain User: Administrator
Windows/Samba Domain User’s Password: t@rg3t
Windwos/Samba Domain: crazyedy.com

Just follow the steps below:

RHEL 5 & 6/Ubuntu 7.04, 7.10, 8.04, 8.10, 9.04, 9.10, 10.04, 10.10, 11.04/Fedora Core 10, 11, 12, 13, 14:

1.) Type the following commands into “Terminal“:
su -
mkdir /mnt/swap
vi /etc/fstab

2.) Once you have opened the file in a terminal using vi, type the following:
shift + g #NOTE: This vi command takes you to the last line of the /etc/fstab file.
o #NOTE: This vi command adds a new line after the last line in the /etc/fstab file.
//10.10.16.10/swap /mnt/swap cifs uid=crazyedy,username=Administrator,password=t@rg3t,domain=crazyedy.com 0 0
Press [esc] #NOTE: This vi command takes you out of insert mode.
:wq! #NOTE: This vi command saves the file for you with your changes.


 

3.) Reboot your Linux box and log back in.

4.) You should now be able to browse to your windows share from your linux box.

###VERY IMPORTANT### When you are using this method to mount a Windows/Samba Share to a Linux box, you can only mount the Official Windows Share Name. For example, if you have a windows share named //10.10.16.10/swap but you have directories underneath that share name that you would like to mount, you can only mount //10.10.16.10/swap, otherwise it won’t mount up for you and it will give an error in the logs. ex.) In the example used in this tutorial, if I had tried to mount //10.10.16.10/swap/stupid_directory, it would have given me an error because the share name is //10.10.16.10/swap. One more important thing to note is that a share in Windows would be in the following format \\10.10.16.10\swap, but if you are connecting to a Windows share from Linux or Mac, it would be in the following format: //10.10.16.10/swap.###VERY IMPORTANT###

###DISCLAIMER: I have tested this procedure with the OS’s listed above only. I have done this several times and I have never run into any problems. However, if you use this tutorial, you are using it at your own risk. ###DISCLAIMER###

Comments are closed.

preload preload preload