Skip to content

How to Mount Windows Shares in Ubuntu

12/02/2010

Mounting Windows shares permanently is relatively straightforward. This is how I did it:

  1. Create new mount point.
  2. Create new entry in /etc/fstab.
  3. Change the unmount order.

Create new mount point

martin@lagothrix:~$ sudo mkdir /srv/cifs/media

Create new entry in /etc/fstab

martin@lagothrix:~$ sudo nano /etc/fstab

Include the following line. Replace userid with the proper value:

//saimiri/media /srv/cifs/media smbfs credentials=/home/userid/.smbpasswd,uid=userid,gid=userid 0 0

Now create an password file in your home directory. Replace userid and password with the proper values:

martin@lagothrix:~$ martin@lagothrix:~$ echo username=userid > .smbpasswd
martin@lagothrix:~$ echo password=password >> .smbpasswd
martin@lagothrix:~$ chmod 600 .smbpasswd

Finally, mount the new filesystem:

martin@lagothrix:~$ sudo mount -a

Change the unmount order

This prevents CIFS (SMBFS) from hanging at shutdown.

martin@lagothrix:~$ sudo update-rc.d -f umountnfs.sh remove
martin@lagothrix:~$ sudo update-rc.d umountnfs.sh stop 15 0 6 .
Advertisement
Leave a Comment

Leave a Reply

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

Gravatar
WordPress.com Logo

You are commenting using your WordPress.com account. 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 )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 457 other followers