Results 1 to 6 of 6

Thread: mounting a NAS folder on startup - the troubles of a newbie

  1. #1
    Join Date
    Jul 2011
    Beans
    9

    mounting a NAS folder on startup - the troubles of a newbie

    Hi.

    I got around 9 hours of experience with ubuntu right now(hence the absolute beginner forum), and I'm trying to get it to automatically mount a folder on my NAS(smb://datakori/share, datakori being my NAS at 192.168.0.101) on startup, but having trouble.

    I've been searching for answers for the past four hours, but everything I found was above my level of expertise, thus I decided to post here. So far I've figured the simplest way to do this might be with either fstab or rc.local, but that's about as far as I've gotten, since I found myself unable to understand the examples I found with google well enough, even after reading enough man pages to get a headache.

    So, I'd really appreciate it if someone could take few minutes and explain just exactly how I could mount the aforementioned folder into my home folder.

    Thanks
    Last edited by Witra; July 22nd, 2011 at 11:12 PM. Reason: Typo

  2. #2
    Join Date
    Feb 2009
    Location
    Dallas, TX
    Beans
    7,790
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: mounting a NAS folder on startup - the troubles of a newbie

    Which version of Ubuntu are you running?
    Did you install samba already?

    Regards.

  3. #3
    Join Date
    Dec 2007
    Location
    The last place I look
    Beans
    Hidden!
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: mounting a NAS folder on startup - the troubles of a newbie

    well, there are a couple options:
    1) mount the folder at boot
    2) mount the folder at login

    to mount on boot, you need to add the share to your /etc/fstab file.
    Check these out:
    http://www.mattvanstone.com/2007/11/...-in-ubuntu-v3/
    https://help.ubuntu.com/community/Mo...resPermanently

    or for login, create a script file with a command like this:
    Code:
    
    #!/bin/bash
    mount -t smbfs -o username=username,password=password //server/share /local/mount/point/
    (editing each parameter for your system). then call the script from startup applications with a command like:
    Code:
    gksu <path/to/script>
    .

    also make sure your script file is executable
    Code:
    sudo chmod u+x <path/to/script>
    also note that /local/mount/point must exist and be accessible before you can mount to it.
    Things are rarely just crazy enough to work, but they're frequently just crazy enough to fail hilariously.

  4. #4
    Join Date
    Aug 2010
    Location
    Between Heatsink and CPU
    Beans
    538
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: mounting a NAS folder on startup - the troubles of a newbie

    doas777 is right, however :

    Quote Originally Posted by doas777 View Post
    Code:
    
    #!/bin/bash
    mount -t smbfs -o username=username,password=password //server/share /local/mount/point/
    SMBFS is deprecated and CIFS should be used instead

    Install CIFS:
    Code:
    sudo apt-get install smbfs
    (odd but yeah, tis will install CIFS)

    Mount your share:
    Code:
    sudo mount -t cifs -o user=username,password='password' //server/share /local/mountpoint
    Last edited by e79; July 23rd, 2011 at 02:15 AM.

    ** My Blog
    **

  5. #5
    Join Date
    Jul 2011
    Beans
    9

    Re: mounting a NAS folder on startup - the troubles of a newbie

    That was exactly what I was looking for, worked quite well. Raises the question of how I managed to not find it earlier.. Ah well..

    Thanks, to all three of you.

  6. #6
    Join Date
    Aug 2010
    Location
    Between Heatsink and CPU
    Beans
    538
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: mounting a NAS folder on startup - the troubles of a newbie

    No sweat,

    please mark the thread as solved if you feel you don't need any more help.

    Regards

    ** My Blog
    **

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
  •