Mounting Windows Shares

A very brief introduction on mounting Windows shares:

(Before you read this, make sure you’re familiar with basic Unix Mounting. — EtherMage 02 Feb 2003)

The first step it is to make, to create, the mount point on your Linux system. That is, to create the directory that will serve to “hold” the remote Windows share. For the purpose of this example, I will mount all the Windows shares on a directory called “mounts” on my $HOME, this way things will not get nasty and youd will still have a pretty decently $HOME lined up.

mkdir ~/mounts

I like this beacuse it keeps things in one place, and since this are shares that only mu user access them, there is really no need in placing them on another directory such as “/mnt”; or at least, that is the way I like to keep them. Usually, inside the “mounts” directory, I create a directory for each of the share that I plan to mount:

mkdir ~/mounts/pitagoras

So, now that the mount point exists, I will mount a Windows share available on my LAN; for this example, I will mount to my Linux system, a Windows share called “pitagoras”, that resides on the server called “Nuno”. Ok, until now we were working “being” a regular user, but, in order to mount a Windows share, we have to become root; so, type:

su –

And, after being prompted for root’s password, do become. The program used to mount Windows shares it is called “smbmount”, and you should execute like this:

smbmount //server/share /local/mount_point/

So, translating this to the example given above:

smbmount //nuno/pitagoras /home/your_user_name/mounts/pitagoras/

If the share it is password protected, you’ll be prompted by one, and after that… Thats it! you can now access the remote share just like you would access any other regular directory on your Linux system. Sometimes, using the server name would not work, on those cases, you can replace the server name by the IP address of the server, like this:

smbmount //xxx.xxx.xxx.xxx/pitagoras /home/your_user_name/mounts/pitagoras/

By default, using “smbmount” without any options will mount the share without given write permission for a regular user, in order to do that, you have to pass options to the “smbmount” program, using the “-o” switch, like this:

smbmount //nuno/pitagoras /home/your_user_name/mounts/pitagoras/-o uid=”your_user_name”

Read more at wiki.arslinux.com

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s