Results 1 to 6 of 6

Thread: Mount on startup Network Hardrive

  1. #1
    Join Date
    Apr 2008
    Location
    Beautifull France
    Beans
    172
    Distro
    Ubuntu

    Red face Mount on startup Network Hardrive

    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?

  2. #2
    Join Date
    Nov 2006
    Beans
    62

    Re: Mount on startup Network Hardrive

    Quote Originally Posted by gwu777 View Post
    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.

  3. #3
    Join Date
    Apr 2008
    Location
    Beautifull France
    Beans
    172
    Distro
    Ubuntu

    Talking Re: Mount on startup Network Hardrive

    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.

  4. #4
    Join Date
    Nov 2006
    Beans
    62

    Re: Mount on startup Network Hardrive

    Not a problem - no need for scripting when it "Just works" with a simple fstab entry. Enjoy you Ubuntu

  5. #5
    Join Date
    Apr 2008
    Location
    Beautifull France
    Beans
    172
    Distro
    Ubuntu

    Permission denied on network share

    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
    Code:
    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...

  6. #6
    Join Date
    Apr 2008
    Location
    Beautifull France
    Beans
    172
    Distro
    Ubuntu

    Re: Mount on startup Network Hardrive

    Please, I am sure some of you can help me, How do I get write access on my network share?

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •