November 23, 2008

How to mount Windows share in Linux ?

Mounting Windows (XP/2003/200) share to Linux is simple. You can use "mount" command to mount windows share in a networked environment. Af first you must create a mount point, The mount point is the location in the operating system's directory structure where a mounted file system appears, it is just a directory. You also required a user name and password to access the share.

I assume that you are logged into Linux machine as root.

1. Create a mount point in your Linux machine.
* Just create a directory named "win-share" under root.

mkdir /win-share

2. Mounting the remote Windows share to your Linux machine

mount -t cifs // -o username=guest,password=guestpassword /win-share

Option "-t" is used for specify the file system type, here we are using "CIFS" (Common Internet File System), This is a protocol to request file and print services from server systems over a network.

Next is the "Host name or Ip address" part. You must start with two forward slash "//", for eg. //your-server-ip . and host part must end with "/" . The last part is for mentioning shared folder in the remote system or server, here we are showing "/document". You can also use host name instead of IP address .

After "-o" (options) you must enter user name and password details to access the share. The user must have at least read permission on that remote Windows share.

mount -t cifs // -o username=guest,password=guestpassword /win-share

At last enter the mount point, here it is "win-share" under root (/).

No comments: