kieranbarnes Independent PHP, WordPress & CubeCart Programmer

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!


Related posts

  1. CIFS/SMBFS “mount error 13 = Permission denied”
    Are you getting a rather generic "mount error 13 = Permission denied"  when trying to...
  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. Super simple Active Directory with Samba
    I needed a super simple, straight forward way of installing samba on Ubuntu and joining...
  5. Setting up and using NFS on Ubuntu
    Network File System, NFS, has been around since Noah first networked his ark. Setting up...

Posted by Kieran


Tagged as: Leave a comment
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment

(required)

No trackbacks yet.