geekesque - home page

How to Mount Windows Shares Permanently on Ubuntu 9.10

As I wrote here, I recently got a NAS server and wanted to mount its shared folders permanently. After going through some forum threads, reading tutorials, asking around and trying stuff like installing packages that might not be necessary (like nfs-common, it didn’t change anything afterwards), I managed to mount my Seagate BlackArmor NAS shares permanently.

So, here’s what I did:

I found my user and group id by typing “id” into a terminal, as I needed them later for adding them to fstab. Most of the tutorials or help manuals suggested using the name of the server from your local network. It didn’t work this way. So I had an idea: to use the IP instead of the server name. It came after seeing this forum thread, which I found after looking for the CIFS VFS: cifs_mount failed w/return code = -22 error on the web. I could see the most recent system errors by typing into a terminal

dmesg | tail

The next step was to modify /etc/fstab. I did it by using gedit as root, using sudo gedit /etc/fstab.

I added the following line to /etc/fstab:

//192.168.0.65/privatefolder /media/servfolder cifs username=xxxxx,password=yyyyyy,uid=1000,gid=1000 0 0

The final step was to type:

sudo mount -a

and I had the shares mounted permanently. I gave up on using another file for storing the credentials, as I am the only user of this computer and I don’t think I’m going to face any hacking threats soon.

posted: 10 March 21
under: Ubuntu

2 Responses to “How to Mount Windows Shares Permanently on Ubuntu 9.10”

  1. Scaine says:

    Just a wee note – editing your /etc/fstab and putting in your drive shares there will work, but if you’re on wireless, you’ll subsequently be stung for 90 second during shutdown with a “CIFS VFS: no response for cmd 50 error” (https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/211631?comments=all).

    A better way might be to use autofs. Install it, then follow the article here to get going : http://www.howtoforge.com/accessing_windows_or_samba_shares_using_autofs

  2. Daniel says:

    Thanks for the comment, it’s good for those having wireless connections. I haven’t tested mounting the shares on a computer using wireless, though. I only have a laptop using it and it’s running Windows. I might change my network settings on the computer running Ubuntu to see how it acts. If I find something new, I will update this article.

Leave a Reply