Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mounting a subfolder from a nfs share fails #3

Open
jerrac opened this issue Oct 7, 2013 · 2 comments
Open

Mounting a subfolder from a nfs share fails #3

jerrac opened this issue Oct 7, 2013 · 2 comments

Comments

@jerrac
Copy link

jerrac commented Oct 7, 2013

In /etc/fstab, if I do something like:

nfshost:/export/data/subfolder    /mounts/data/subfolder/ nfs     nfsvers=3,rw    0 0

It mounts just fine.

If I try with nfs_automount:

MOUNTS=MOUNTS=("rw|nfshost|/export/data/subfolder|/mounts/data/subfolder|")

It throws a [CRIT] Remote share '/export/data/subfolder' unavailable! error because showmount -e nfshost does not output subfolders of nfs shares. The check_remoteshare function returns false.

The only way to make it work I can think of right now (with no testing, and not being very good at bash programming), is to not run the check_remoteshare function.

Anyone else have a better idea?

@jerrac
Copy link
Author

jerrac commented Oct 8, 2013

FYI, I "fixed" the problem by commenting out lines 311-312 and 330-332 in /usr/local/bin/nfs_automount.

Not a very good fix since it removes the check for the nfs share.

    # Make sure the remote NFS share is available
    #check_remoteshare ${_remotesystem} ${_remoteshare}
    #if ${_RET} ; then

      # Make sure the local mountpoint exists and is free
      valid_for_mount ${_localmountpoint}
      if ${_RET} ; then

        log "[INFO] Attempting mount: ${mountcmd} ${_mountopts} ${_remotesystem}:${_remoteshare} ${_localmountpoint}"
        ${mountcmd} ${_mountopts} ${_remotesystem}:${_remoteshare} ${_localmountpoint}
        if [ $? -ne 0 ] ; then
          log "[CRIT] Unable to mount share '${_remoteshare}'!"
        else
          log "[INFO] Share '${_remoteshare}' mounted from '${_remotesystem}' at '${_localmountpoint}'."
        fi

      else
        log "[CRIT] Local mount point '${_localmountpoint}' missing or already in use!"
      fi

    #else
    #  log "[CRIT] Remote share '${_remoteshare}' unavailable!"
    #fi

@proximous
Copy link

I created a pull request to fix this. It will strip the remoteshare down to the first folder and check for that folder being shared. #12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants