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

2 thoughts on “Mounting Windows Shares permanently in Linux

  1. dukan diet book August 3, 2015 / 11:48 am

    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!|

    • l1dge August 13, 2015 / 5:05 pm

      No worries about being off topic, it’s WordPress. I’ve just deployed a theme and have done a lot of customization with it.

Leave a Reply

Your email address will not be published.

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