Posted in Linux, Ubuntu

Mounting Windows Shares permanently in Linux

So I had a need to mount so NAS shares on my linux box, lets face it who wouldn’t these days with the advent of Plex, these are the basic steps snagged from the Ubuntu wiki and a StackExchange post:

sudo apt-get install cifs-utils
sudo mkdir /media/windowsshare

Then edit your /etc/fstab file (with root privileges) to add this line:

//servername/sharename  /media/windowsshare  cifs  guest,uid=1000,iocharset=utf8,sec=ntlm  0  0

Where

  • guest indicates you don’t need a password to access the share,

  • uid=1000 makes the Linux user specified by the id the owner of the mounted share, allowing them to rename files,

  • iocharset=utf8 allows access to files with names in non-English languages. This doesn’t work with shares of devices like the Buffalo Tera Station, or Windows machines that export their shares using ISO8895-15.

  • If there is any space in the server path, you need to replace it by 40, for example //servername/My40Documents

  • I added the sec=ntlm at the end otherwise I kept getting a (95) error when running the mount -a in the next step.

After you add the entry to /etc/fstab type:

sudo mount -a

This will (re)mount all entries listed in /etc/fstab.

Et Voila, you should now have some shiny new mounted shares under the /media directory.

If you want more detail check out the following posts:

https://wiki.ubuntu.com/MountWindowsSharesPermanently

http://unix.stackexchange.com/questions/70411/mount-t-cifs-operation-not-supported-but-can-connect-via-smbclient

Author:

I am and have been an Oracle dba for the past twenty something years, with a few deviations to dabble in other areas. I’m certified (or is that certifiable) in both Oracle 10 and 11G OCP. I’m an “old skool” hacker at heart in the traditional sense, pulling apart bits of kit to see how they work, mainly with the intention of fixing it, mostly with the outcome of breaking it! I like toying with hardware, software and new technologies and love Linux, although Windows 10 is looking pretty slick too. I have a keen interest in reading / writing and electronics, and occasionally snap a few photos. If I can help you I will, so if you have any questions feel free to ask by using my contact form. -Lee And now for the disclaimer: Anything I write here is my own opinion and does not represent the view of any company I work for now or have worked for in the past.

2 thoughts on “Mounting Windows Shares permanently in Linux

  1. Hey would you mind stating which blog platform you’re working with? I’m planning to start my own blog in the near future but I’m having a difficult time choosing between BlogEngine/Wordpress/B2evolution and Drupal. The reason I ask is because your design seems different then most blogs and I’m looking for something unique. P.S Apologies for being off-topic but I had to ask!|

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.