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.
