How to mount your network drive

You'll first need to create a credentials.txt file somewhere. Could just be in your home directory.

/home/yourUsername/credentials.txt

That file's contents should look like,

username=yourUsername
password=yourPassword

Run this command to get your user id number. Write it down or remember it.

$ cat /etc/passwd | grep "^yourUsername" | awk -F ':' '{print $3}'

Run this command to get your group id,

$ cat /etc/group | grep "^yourUsername" | awk -F ':' '{print $3}'

Now, edit /etc/fstab

Add a line like this,

//192.168.1.4/yourMountPoint /home/yourUsername/networkDrive cifs defaults,credentials=/home/yourUsername/credentials.txt,uid=???,gid=??? 0 0

Replace uid=??? with what ever your user id was and replace gid=??? with your group id. It'll look like this,

//192.168.1.4/yourUsername /home/yourUsername/networkDrive cifs defaults,credentials=/home/yourUsername/credentials.txt,uid=1000,gid=1000 0 0

Create the mount directory,

$ mkdir /home/yourUsername/networkDrive

Then if everything looks good, run,

$ sudo mount /home/yourUsername/networkDrive

From then on, when you reboot, it should mount automatically.

You can also run,

$ mount -a

and that will mount anything that hasn't been mounted already.

Page Comments (Click to edit)






[Click to add or edit comments])

Please prepend comments below including a date

Design by N.Design Studio, adapted by solidGone.org (version 1.0.0)
Have a nice day.