GNU bug report logs -
#39670
Cannot mount NFS share as user or root
Previous Next
Full log
View this message in rfc822 format
Hello,
Maxim Cournoyer <maxim.cournoyer <at> gmail.com> writes:
>
> I encountered this too. Perhaps we should patch some references to
> mount.nfs (from nfs-utils) in the util-linux package which provides
> 'mount'.
>
> In the meantime, you should use "mount.nfs" directly.
I've looked into patching util-linux to reference explicitly the
mount.nfs helper, and I think this should do it:
--8<---------------cut here---------------start------------->8---
modified libmount/src/context.c
@@ -1939,8 +1939,13 @@ int mnt_context_prepare_helper(struct libmnt_context *cxt, const char *name,
struct stat st;
int rc;
- rc = snprintf(helper, sizeof(helper), "%s/%s.%s",
- path, name, type);
+ if (startswith(type, "nfs")) {
+ rc = snprintf(helper, sizeof(helper), "/gnu/store/c7kpr1jh5z3mrkz0yw9am86851y57cq7-nfs-utils-2.4.2/sbin/mount.nfs");
+ } else {
+ rc = snprintf(helper, sizeof(helper), "%s/%s.%s",
+ path, name, type);
+ }
+
path = strtok_r(NULL, ":", &p);
if (rc < 0 || (size_t) rc >= sizeof(helper))
--8<---------------cut here---------------end--------------->8---
But, adding nfs-utils to util-linux creates a dependency cycle which is
bothersome to resolve (nfs-utils requires eudev through lvm2, as well as
util-linux itself).
I've also realised that when I was using 'sudo mount.nfs ...' it
wouldn't work because it'd look up the root user's PATH for the helper.
'sudo -E mount.nfs ...' should work.
We should document that the 'nfs-utils' package needs to be added to the
operating system declaration packages field when NFS file systems are
used.
Maxim
This bug report was last modified 4 years and 217 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.