NFS only gives user read access

NFS only gives user read access

I had NFS set up such that my RasberryPi had its Documents/ folder stored on my main Ubuntu system and it worked fine. I then made it such that the entire /home/raspi1 folder (note, not /home/ itself) was stored on my Ubuntu NFS server. However, now I no longer have write access to those files/folders.

Here is my exports file on my Ubuntu server. 192.168.1.109 is the internal ip address of my Raspberry Pi client.

/etc/exports (server):

/home/USER/Documents/raspi/raspi1 192.168.1.109(rw,sync,no_subtree_check,no_root_squash)

Here is the fstab file on my Raspberry Pi client. 192.168.1.102 is the internal ip address of my Ubuntu Server.

/etc/fstab (client):

192.168.1.102:/home/USER/Documents/raspi/raspi1 /home/raspi1 nfs rsize=8192,wsize=8192,rw,auto,nolock

After which, on the server, I issue the command

sudo exportfs -a

Now, when I log into my Raspberry Pi, and issue the command ls -l /home/raspi1, I get the following output

Output:

total 88
drwxrwxr-x 13 4294967294 4294967294  4096 Oct  2 04:33 .
drwxr-xr-x  4 root       root        4096 Oct  2 03:46 ..
-rw-r--r--  1 4294967294 4294967294  3390 Oct  2 04:32 .bashrc
drwxr-xr-x  2 4294967294 4294967294  4096 Oct  2 03:44 bin
drwxr-xr-x  3 4294967294 4294967294  4096 Oct  2 03:44 camcv
drwxr-xr-x  3 4294967294 4294967294  4096 Oct  2 03:44 camcv.step4
drwxr-xr-x  3 4294967294 4294967294  4096 Oct  2 03:44 camcv.step5
drwxr-xr-x  3 4294967294 4294967294  4096 Oct  2 03:44 camcv.step5.5
drwxr-xr-x  3 4294967294 4294967294  4096 Oct  2 03:44 camcv.step6
-rw-r--r--  1 4294967294 4294967294   475 Oct  2 04:32 .inputrc
drwxr-xr-x  4 4294967294 4294967294  4096 Oct  2 03:44 magicMirror
drwxr-xr-x  5 4294967294 4294967294  4096 Oct  2 03:44 media
drwxr-xr-x  3 4294967294 4294967294  4096 Oct  2 03:44 motionDetection
-rw-r--r--  1 4294967294 4294967294   675 Oct  2 04:32 .profile
drwx------  2 4294967294 4294967294  4096 Oct  2 04:33 .ssh
drwxr-xr-x 21 4294967294 4294967294  4096 Oct  2 04:34 .vim
-rw-r--r--  1 4294967294 4294967294 21938 Oct  2 04:33 .vimrc

Who is user 4294967294 and what has gone wrong here?

EDIT: If I try to export and then mount a different folder, lets say /home/USER/xyz to /home/raspi1/xyz, it works out as expected, with the file/folder owners being raspi1.

EDIT2: Issuing the below commands on the RaspberryPi client generate different results.

showmount -a 192.168.1.102
showmount -e 192.168.1.102

output:

All mount points on 192.168.1.102:
192.168.1.109:/home/USER/xyz

Export list for 192.168.1.102:
/home/USER/xyz              192.168.1.109
/home/USER/Documents/raspi/raspi1 192.168.1.109

答案1

Although I did not find out what was going on, despite this insightful answer over on ServerFault, I did, however, find a work around. Just use NFS3 instead of NSF4. To do so, just add nfsvers=3 to the /etc/fstab/ file like so

/etc/fstab:

192.168.1.102:/home/USER/Documents/raspi/raspi1 /home/raspi1 nfs nfsvers=3,rsize=8192,wsize=8192,rw,auto,nolock

This fixed the UID=4294967294 issue, although it has led to another issue whereby the file is owned by a user other than raspi1 (user pi), see here.

相关内容