Linux-Noob Forums
Mount a shared drive - Printable Version

+- Linux-Noob Forums (https://www.linux-noob.com/forums)
+-- Forum: Linux Noob (https://www.linux-noob.com/forums/forum-3.html)
+--- Forum: Tips and Tricks (https://www.linux-noob.com/forums/forum-59.html)
+---- Forum: Samba and NFS (https://www.linux-noob.com/forums/forum-23.html)
+---- Thread: Mount a shared drive (/thread-3682.html)



Mount a shared drive - Sheriff - 2004-01-26


Hello, I hope someone may beable to help me.

I have two computers with drives I need access to, what I do right now is this:

from a terminal I su - so I am on as root then type in:

Mount -t smb //xbox/f /mnt/xbox

once I hit enter it asks for a password I type it in and viola that drive is now mounted.

the other one is:

Mount -t smb //192.168.0.100/storage /mnt/pc2

once I hit enter it asks for a password I type it in and viola that drive is now mounted.

I can also type it in this way:

Mount -a //xbox/f /mnt/xbox and it works fine after I enter my password.

 

What I would really like to know is how do I enter this into FSTAB so this is all done automatic at boot?

I would sure love a small guide from someone on how to enter this properly :)

 

Thank you for any help

 

Sheriff




Mount a shared drive - grep420 - 2004-01-29


// First you need a file to store your user/pass info. You should keep it somewhere secure like in /root, so for an example we will use /root/.cred Here is a quick way to create the needed file. Supply your own username and password of course. //

 

echo "username=Administrator" > /root/.cred

echo "password=YOURPASSWORD" >> /root/.cred

 

// Note the first line uses a single > and the second uses two >> to append to the file. //

 

// Make a backup of fstab and add this line to the current one. //

 

cp /etc/fstab /etc/fstab.bak && echo "//xbox/f /mnt/xbox smbfs defaults,credentials=/root/.cred 0 0" >> /etc/fstab

 

// Now to test it. First make sure its not mounted. //

 

umount /mnt/xbox

mount -a

 

// This will read /etc/fstab and attempt to mount all entries. If successful it will drop you back to the prompt. Now you can cd /mnt/xbox to verify. //




Mount a shared drive - freak - 2004-03-07

thanks a lot grep420, very helpful :)



Mount a shared drive - znx - 2005-04-13


!-- insert self promotion --!

how to mount a smb share

!-- / insert self promotion --!

:P