PDA

View Full Version : [SOLVED] Mount on startup Network Hardrive



gwu777
May 11th, 2008, 10:22 AM
Hi there, I have a network hardrive, Maxtor Shared Storage II, up til now, I am mounting it in termnial using:

sudo mount -t cifs //192.168.1.4/folder1 -o username=user,password=pass /home/user/maxtor

This way I have it in my home folder to access it for my documents.

It is all working fine, how can I do to have this same share mounted automatically by the system if I restart?

.rdg
May 11th, 2008, 11:12 AM
Hi there, I have a network hardrive, Maxtor Shared Storage II, up til now, I am mounting it in termnial using:

sudo mount -t cifs //192.168.1.4/folder1 -o username=user,password=pass /home/user/maxtor

This way I have it in my home folder to access it for my documents.

It is all working fine, how can I do to have this same share mounted automatically by the system if I restart?

The simplest way would be adding the following line to /etc/fstab:

//192.168.1.4/folder1 /home/user/maxtor cifs defaults,username=user,password=pass 0 1

If that doesn't work, just try mounting that share with a script, for example file /etc/init.d/maxtor-share:
#!/bin/bash
mount -t cifs //192.168.1.4/folder1 -o username=user,password=pass /home/user/maxtor
# end of file

One note to the mount above - no need for sudo, as it would be run by root on system start. That script would have to be executable, so in terminal write:

sudo chmod 775 /etc/init.d/maxtor-share

So it can be actually run. Finally, you would have to make it run on system start:

ln -s /etc/init.d/maxtor-share /etc/init.d/rc5.d/S100-maxtor-share

That should do it.

gwu777
May 11th, 2008, 01:14 PM
Thank you very much for the line of code, I have modified the fstab and it works perfectly. I haven't tried the script, I am not sure I would have been able to make it work, my knowledge is quite limited yet with ubuntu, but I am learning little by little, thank you very much.

.rdg
May 11th, 2008, 04:37 PM
Not a problem - no need for scripting when it "Just works" with a simple fstab entry. Enjoy you Ubuntu ;)

gwu777
June 21st, 2008, 12:51 PM
Hi there, I thought I would keep updating this post as it relates to it... I manage to mount my network drive without problems, but I do not seem to have write access to it? I have done

sudo mount -t cifs //192.168.1.4/folder1 -o username=user,password=pass /home/user/maxtor
I don't know how I could get write access, if anyone as any idea it would be much appreciated...

gwu777
July 5th, 2008, 06:40 AM
Please, I am sure some of you can help me, How do I get write access on my network share?