Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12

Thread: Editing fstab for conditional nfs mounting

  1. #11
    Join Date
    May 2010
    Beans
    75
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Editing fstab for conditional nfs mounting

    @ Captain James T kirk: sorry mate for being lazy and not putting up a solution...actually the issue has evolved with time and the solution i had...off course by taking help from some other ubuntu forums... I have an unfinished help written for my problem and the solution and I shall post it soon. To be true, I was first going to shout back at you and then I realized that you are right. THanks for pointing it out. I shall surely post the help soon in a separate thread and post the link here.

  2. #12
    Join Date
    Jan 2013
    Beans
    1

    Re: Editing fstab for conditional nfs mounting

    Quote Originally Posted by roelforg View Post
    I'd do it like this:
    Code:
    #!/bin/bash
    
    mount -t nfs server.local:/homeshare /home
    if [ $! != 0 ]
    then
      mount /<path_to_local_home_drive_or_partition> /home
    fi
    For those ending up here in the future: that should be $? not $!

    (I am mounting a disk on through different mean (ntfs/cifs) depending on whether the Ubuntu is running natively or under a VM (in which it has no access to the partition. I managed to get it to work with the information from this topic, thanks!)

Page 2 of 2 FirstFirst 12

Tags for this Thread

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
  •