kieranbarnes these are the things i learnt today

Permanently mount a Windows share in Linux

Posted on April 4, 2009

A Terrabyte?Sick of manually mounting a Windows share on Linux with "mount" for it to drop off randomly? Or not really knowing if it is mounted or not?

Then make a permanent mount in fstab.

First, check you have smbfs installed

apt-get install smbfs

Now, make a mount path

mkdir /mnt/YOUR_NEW_PATH

Now we will edit /etc/fstab. Add a new line like this

//WINDOW_SERVER/SHARE_NAMEĀ  /mnt/YOUR_NEW_PATH credentials=/etc/samba/credentials 0 0

Save and exit!

Next we need to make the credentials file that will store the username and password

nano /etc/samba/credentials

Add two lines and save.

username=WINDOWS_USERNAME
password=WINDOWS_PASSWORD

Now, set permissions on the file so that only root can see it

chmod 700 /etc/samba/credentials

Now, lets mount it.

mount -a

Mount doesn't usually return anything, so a quick df -h will show that your Windows share has been permanently mounted. Go on, reboot if you don't believe me!

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay

Related posts:

  1. Managing User Shares in Windows
    So you've probably got a Users folder with directories in matching all your Windows users,...
  2. NFS mount point hung?
    Has your NFS mount point hung and turned into a black hole swallowing every filesystem...
  3. NTLM Authentication (Active Directory) on Apache (Linux)
    Here is a quick guide to enabling NTLM authentication for Apache 2. I generally use...
  4. Setting up and using NFS on Ubuntu
    Network File System, NFS, has been around since Noah first networked his ark. Setting up...
  5. Using rsync to maintain backups on Linux
    Following on from my previous article, regarding Setting up and using NFS on Ubuntu, here's...

What this article useful to you?



Let me know, buy me a beer!
Alternatively, if you're feeling impecunious, you may like to subscribe to my RSS feed, or see other articles in the Geeky, Linux, Windows category.

Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


No trackbacks yet.