Results 1 to 7 of 7

Thread: Delaying a NFS mount in /etc/fstab on system boot

  1. #1
    Join Date
    Aug 2005
    Location
    Sydney, Australia
    Beans
    456
    Distro
    Ubuntu Development Release

    Delaying a NFS mount in /etc/fstab on system boot

    I have a NFS mount defined in /etc/fstab that would normally mount on system boot. The problem is that the network connection is over WiFi and that connection isn't active at the time the system tries to mount the NFS share. Is there any option to delay mounting the NFS until the WiFi connection is up?

  2. #2
    Join Date
    Aug 2009
    Beans
    48

    Re: Delaying a NFS mount in /etc/fstab on system boot

    You could remove it from fstab and create a sysv init style script to mount it after the wifi is up.

  3. #3
    Join Date
    Aug 2005
    Location
    Sydney, Australia
    Beans
    456
    Distro
    Ubuntu Development Release

    Re: Delaying a NFS mount in /etc/fstab on system boot

    Quote Originally Posted by benderisgreat View Post
    You could remove it from fstab and create a sysv init style script to mount it after the wifi is up.
    Thanks for the idea. I might look at an upstart task since Ubuntu uses upstart instead of init.
    Alternatively, I think I might be able to just run the mount manually from @reboot in a root cronjob but I'm not sure when the cronjobs get executed.

  4. #4

    Re: Delaying a NFS mount in /etc/fstab on system boot

    I generally flag all my nfs mounts as "noauto,users" in /etc/fstab, which makes it possible for a user to mount it whenever its ready.
    Ubuntu user #7247 :: Linux user #409907
    inconsolation.wordpress.com

  5. #5
    Join Date
    Aug 2005
    Location
    Sydney, Australia
    Beans
    456
    Distro
    Ubuntu Development Release

    Re: Delaying a NFS mount in /etc/fstab on system boot

    Quote Originally Posted by K.Mandla View Post
    I generally flag all my nfs mounts as "noauto,users" in /etc/fstab, which makes it possible for a user to mount it whenever its ready.
    Do you know which method I could use to mount it on system boot which would be guaranteed to occur after the wlan connection is up? I'm not quite sure when the user cronjob @reboot gets run.

  6. #6

    Re: Delaying a NFS mount in /etc/fstab on system boot

    Not really. It does seem like you could fork off a bash script at startup though, that would sleep for a minute or two before mounting that location. That's probably a rather brutish way to do it though, since it would be more elegant to check and see if the location was available before arbitrarily mounting it.
    Ubuntu user #7247 :: Linux user #409907
    inconsolation.wordpress.com

  7. #7
    Join Date
    Aug 2005
    Location
    Sydney, Australia
    Beans
    456
    Distro
    Ubuntu Development Release

    Re: Delaying a NFS mount in /etc/fstab on system boot

    I just stumbled across Autofs, which appears to do what I want. It will only mount the NFS share when it's accessed and unmount after a period of inactivity.

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
  •