[SOLVED] NFS mounted by red-only despite correct permissions
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
NFS mounted by red-only despite correct permissions
I've been trying to figure this out all day. Perhaps someone can help shed some light on the problem?
So, I have a RaspPi2 with an NFS (v4) export that I want to mount on my laptop, running Slackware "14.0" (kernel 3.8.11; it was originally installed as Slack64 13.37 and have upgraded various packages via slackpkg, but not the entire thing).
I took special care to ensure that the gid's on the Pi and my laptop match (though it's called something else on my laptop; www2 instead of www on the Pi).
I'm able to mount the NFS export on my laptop, and it *appears* that the permissions are correct (gid on the mounted directory & the directory's contents is 'www2'), and my laptop user belongs to the 'www2' group.
But, all the contents of the directory are read-only to me. I can write to files easily if I'm root (on the laptop), and if I chmod to 777, I'm able to write to the share as my laptop user, but when the directory is 775, I can only read.
Furthermore, I have another box that I recently installed Slack64 14.1 onto, and despite some fiddling with getting rc.rpc started, I'm able to mount and write to the NFS share with no problems at all.
I have the bind setup in /etc/fstab. It goes as such:
Code:
/var/www/project /export/project none bind 0 0
I should also mention that I currently have /var/www mapped to a ramdisk/tmpfs on the Pi (instead of using the slow SD card; I copy the content into /var/www from the SD card).
It is setup in fstab as such:
Code:
tmpfs /var/www tmpfs defaults,size=300M 0 0
I also tried upgrading my laptop kernel (out of desperation) to 3.10.17; the one that comes with Slack 14.1, as well as updated my nfs-utils package (to 1.2.8; again from Slack 14.1) and it didn't make a difference.
I did, however, notice some items in my laptop's syslog that may or not be related. Figure I'd post them and see if it's a hint of what's going on:
Code:
rpc.statd[764]: Running as root. chown /var/lib/nfs to choose different user
kernel: [ 95.820838] svc: failed to register lockdv1 RPC service (errno 97).
Again, I don't know why I'm able to mount this without any problems on my other Slack64 14.1 box but my laptop will only give me read-only access. I'd expect that if it was a problem with the Pi's setup then I'd get the same result on both systems.
Thoughts?
Last edited by skubik; 06-09-2015 at 11:40 AM.
Reason: Added additional details
for nfs version 3 you don't have to do the bind mount, are you mounting using nfsv3 on the Slack64 14.1 box? Maybe post the fstab for the Slack64 14.1 box is there's any difference..
On the Slack64 14.1 box, I'm only manually mounting to test the Pi's NFS export, so no fstab entry. Ditto for the laptop currently as well (once I have something that works manually, I'dd add it to the fstab)
Code:
mount -t nfs 10.8.0.30:/export/project /mnt/tmp/
When I posted the mountpoint details on the laptop, above, it indicated nfsvers=3, which I explicitly used for a bit to try and mount using nfsv3 since it seems everything defaults to v4, but it didn't seem to make any difference.
Something I came across is that the uid of the user I'm using to try and edit files on the NFS mount is the same on the Pi and the 14.1 box, but not on the laptop.
That is, on the Pi and the 14.1 box, the uid I'm using is 1001, but on the laptop it's 500.
Might this make a difference with the RPC service?
The gid is the same across all three systems, which is what I'm hoping would allow me to have rw access to the files on the NFS mount (all files are 775).
I'm becoming increasingly desperate to find a solution for this. Any insight or suggestions is greatly appreciated!
Something I came across is that the uid of the user I'm using to try and edit files on the NFS mount is the same on the Pi and the 14.1 box, but not on the laptop.
That is, on the Pi and the 14.1 box, the uid I'm using is 1001, but on the laptop it's 500.
Might this make a difference with the RPC service?
The gid is the same across all three systems, which is what I'm hoping would allow me to have rw access to the files on the NFS mount (all files are 775).
I'm becoming increasingly desperate to find a solution for this. Any insight or suggestions is greatly appreciated!
Yes, of course that would prevent the laptop user from writing to the NFS mount.
The laptop user is presumably member of the 1995 group - on the laptop - but NOT on the NFS machine!
I have been following this thread but it never registered that the uid was different on the laptop. Here is what you now say you have:
This is exactly right! Because my user on SW64-14.1 had UID 1001 as did the Pi, those two were able to connect no problem. But because my laptop UID was 500, it wasn't authenticated by the RPC service.
I solved this by changing the UID of my account on the Pi and SW64-14.1 to 500 to match my laptop (going through and chowning all my files would have been a pain, whereas the Pi & SW64-14.1 are very fresh installs).
I just tried it and I'm able to edit files on the NFS mount no problem.
Thank you so much to everyone for offering their suggestions!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.