Page 1 of 4 123 ... LastLast
Results 1 to 10 of 34

Thread: fstab not mounting my cifs, I have to manually call mount -a

  1. #1
    Join Date
    Jun 2005
    Beans
    278

    fstab not mounting my cifs, I have to manually call mount -a

    Hi, I don't get it.

    I have the following line in my fstab:
    Code:
    //192.168.0.242/websites /mnt/supercube cifs rw,user=XXX,pass=XXX,iocharset=utf8,file_mode=0777,file_mode=0777,dir_mode=0777,uid=XXX 0 0
    But it doesn't auto mount with everything and disconnects whenever I suspend my computer. The only way to get it to mount is with
    Code:
    sudo mount -a
    and it mounts fine with no error.

    Did lucid change the way it uses fstab or something? Obviously writing mount -a isn't a huge concern, but it kind of destroys the point of putting it in my fstab.
    http://patrickavella.com -> blah blah blah blog

  2. #2
    Join Date
    Jun 2006
    Location
    Nux Jam
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: fstab not mounting my cifs, I have to manually call mount -a

    MountManager is your boy

  3. #3
    Join Date
    Jun 2005
    Beans
    278

    Re: fstab not mounting my cifs, I have to manually call mount -a

    That doesnt' really look like what I'm looking for.
    http://patrickavella.com -> blah blah blah blog

  4. #4
    Join Date
    Jun 2005
    Beans
    278

    Re: fstab not mounting my cifs, I have to manually call mount -a

    Bump?

    It makes no sense that the network share won't mount until I manually run sudo mount -a
    http://patrickavella.com -> blah blah blah blog

  5. #5
    Join Date
    Jun 2005
    Beans
    278

    Re: fstab not mounting my cifs, I have to manually call mount -a

    Bump?

    It makes no sense that the network share won't mount until I manually run sudo mount -a
    http://patrickavella.com -> blah blah blah blog

  6. #6
    Join Date
    Dec 2009
    Beans
    6,776

    Re: fstab not mounting my cifs, I have to manually call mount -a

    I may get you part of the way there. It's possible that fstab is being executed before your network is up. Add the following option to your fstab entry:

    Code:
    _netdev
    Option _netdev delays mounting until the network has been enabled.

    Disconnecting during a suspend is another matter. There may be something in my notes. Hopefully you'll get more responses.

  7. #7
    Join Date
    Nov 2009
    Beans
    Hidden!
    Distro
    Kubuntu 10.10 Maverick Meerkat

    Re: fstab not mounting my cifs, I have to manually call mount -a

    If you can script the mount command and stick the script into /etc/network/if-up.d, your mount will run as soon as your network is up. A similar umount script thrown into /etc/network/if-down.d should bring it down. Make sure the scripts are executable and is owned by root.

    The following is an example of a mount script called by wireless network. (call it say 'mntNetShare' and change "wlan0" if not wireless by looking at the output of 'ifconfig')

    Code:
    #!/bin/bash
    if [ "$IFACE" = "wlan0" ]; then
          mount -t cifs -o rw,user=XXX,pass=XXX,iocharset=utf8,file_mode=0777,file_mode=0777,dir_mode=0777,uid=XXX  //192.168.0.242/websites /mnt/supercube
    fi
    Create a similar script for umount and remove your fstab entry.
    FYI, I use a similar script but serves me another purpose.

  8. #8
    Join Date
    Jun 2005
    Beans
    278

    Re: fstab not mounting my cifs, I have to manually call mount -a

    Thanks guys, those solutions help greatly.

    I'm leaving the thread 'unsolved' in case anyone knows why fstab behavior has changed.
    http://patrickavella.com -> blah blah blah blog

  9. #9
    Join Date
    Dec 2009
    Beans
    6,776

    Re: fstab not mounting my cifs, I have to manually call mount -a

    I like the script idea a lot. Opens up all sorts of possibilities for other things. As for the change in behaviour - and trust me this is just a guess - there was a great effort to reduce boot up times. This and a similar thing that is happening to VirtualBox guests seem to be victims of "unintended consequences" of doing so.

  10. #10
    Join Date
    Nov 2009
    Beans
    Hidden!
    Distro
    Kubuntu 10.10 Maverick Meerkat

    Re: fstab not mounting my cifs, I have to manually call mount -a

    At some point (perhaps in Jaunty or Karmic), the networking stuff got moved to upstart. There was a dependency introduced to bring up the network manager daemon after mounting the filesystems(in fstab). So the behavior should be similar if you have used Karmic I'd imagine.

Page 1 of 4 123 ... LastLast

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
  •