Mount a Windows share on Linux

January 14, 2008 - General Linux Stuff

Seems I get asked often how to mount a Windows share on a Linux machine. Here is a repost of some decent directions I found.

Keep in mind that SMB is dated at this point, you’ll want to be using CIFS.

To test and see if your Linux machine sees the shares on the Windows machine:
smbclient -L <windows-box> -U <username>

Make a directory for the mount point, you know in the mnt directory:

mkdir /mnt/<name-of-mount-point>

Note: Maybe make it something simple like /mnt/dreadfull_active_directory_server that way everyone knows what it is?? You know cause /mnt/my_horse is good and all but doesn’t tell me what kind of horse it is! YOU KNOW?

Mount the share, yes it’s time to actually mount the horse, put your foot in the stirrups:

mount -t smbfs -o username=<username>,password=<password> //<win-box>/<share> /mnt/<name-of-mountpoint>


mount -t cifs -o username=<username>,password=<password> //<win-box>/<share> /mnt/<name-of-mountpoint>

Note: This syntax saves the password.

Create a symbolic link to the mounted drive, i really hope you kow what a symbolic link is:

ln -s /mnt/<name-of-mount-point> /<path-of-symlink>

Note: A symbolic link serves pretty much the same purpose as short cut in Windows. For instance if you linked /mnt/my_stupid_active_directory_server to /msads then you could refer to it as such cd /msads instead of cd /mnt/my_stupid_active_directory_server. Get it?

Leave a Reply