You are not logged in.

#1 2013-09-16 22:26:30

Nareto
Member
From: Pisa,Italy
Registered: 2009-07-18
Posts: 148

can't rename on NFS share

I have a raspberry pi running archlinuxARM, with a nfs4 export. I followed the procedure on the wiki to set it up, and I can mount it fine from my other archlinux machines, but the problem is "rename" doesn't work:

$ touch a
$ rename a b a
rename: a: rename to b failed: Invalid cross-device link

This is a problem because I'd like to use the share as storage for backup and other things, and a lot of script fail. For example if I set my pacman cache to a folder on the nfs share, once it finishes download of a package pacman wants to rename package.tar.xz.part to package.tar.xz, and fails with the above error.

So, what could it be? Where should I look? Here is /etc/exports on the raspberry pi:

/srv/nfs4/ 192.168.0.1/24(rw,fsid=root,no_subtree_check)
/srv/nfs4/media 192.168.0.1/24(rw,no_subtree_check,nohide,no_root_squash)
/srv/nfs4/backup 192.168.0.1/24(rw,no_subtree_check,nohide,no_root_squash)

Offline

#2 2013-09-16 22:30:02

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: can't rename on NFS share

Moving to Other Architectures...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2013-09-17 08:24:54

Nareto
Member
From: Pisa,Italy
Registered: 2009-07-18
Posts: 148

Re: can't rename on NFS share

so you're suggesting it has something to do with the raspberry pi specifically?

Offline

#4 2013-09-17 08:28:51

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: can't rename on NFS share

No, if that were the case I would have closed the thread and directed you to the Arch ARM boards, as per our policy. What does searching on that error message tell you?


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#5 2013-09-17 09:11:55

Nareto
Member
From: Pisa,Italy
Registered: 2009-07-18
Posts: 148

Re: can't rename on NFS share

so I don't get why it was moved, it seemed more appropriate in the Networking section...

unfortunately googling isn't very fruitful this time: that error usually appears when someone is trying to hard link across filesystems, which is not my case, since I'm on the same filesystem and I can actually hard link (from the NFS client), it's just rename that throws that error (and mv also copies actually copies files). So I guess I could just alias "rename" to hard link and then remove the original file, but that's a dirty hack

Last edited by Nareto (2013-09-17 09:12:37)

Offline

#6 2013-09-17 09:13:30

Nareto
Member
From: Pisa,Italy
Registered: 2009-07-18
Posts: 148

Re: can't rename on NFS share

sorry maybe I didn't say this: everything works on the NFS server, the raspberry pi - it's just from the clients that I can't rename

Offline

#7 2013-09-17 09:22:32

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: can't rename on NFS share

Nareto wrote:

so I don't get why it was moved, it seemed more appropriate in the Networking section...

Read the policy: it is stickied in this forum. The architecture is relevant.


As to what the problem is: who knows? Is rename the only utility failing? What happens when you SSH in: it all works? How are you mounting thr share from the client: what options do you pass?


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#8 2013-09-17 09:25:05

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

Re: can't rename on NFS share

How do you mount the share?


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

#9 2013-09-17 09:49:39

Nareto
Member
From: Pisa,Italy
Registered: 2009-07-18
Posts: 148

Re: can't rename on NFS share

on the server: as suggested on the wiki, I first mount the partitions under /mnt normally, then I mount those, with "mount --bind", to /srv/nfs4

on the clients: I have these lines in /etc/fstab:

192.168.0.100:/media   /rpi/media   nfs4   rsize=8192,wsize=8192,timeo=14,intr,_netdev  0 0
192.168.0.100:/backup   /rpi/backup   nfs4   rsize=8192,wsize=8192,timeo=14,intr,_netdev        0 0

Offline

#10 2013-09-17 10:04:14

Nareto
Member
From: Pisa,Italy
Registered: 2009-07-18
Posts: 148

Re: can't rename on NFS share

As to what the problem is: who knows? Is rename the only utility failing? What happens when you SSH in: it all works? How are you mounting thr share from the client: what options do you pass?

yes as far as I can tell "rename" and "mv" are the only utilities failing, hard linking works as I mentioned which seems strange to me (doesn't rename do something similar to hard linking?). When SSHed in the server rename works, as normal user, both under the /mnt and the /srv/nfs4 mounts

Offline

#11 2013-09-17 10:30:48

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

Re: can't rename on NFS share

IIRC, mv should copy and remove, so should cope with this. If it is just copying, there may be a permissions error. I have always assumed that rename wraps mv, but maybe it doesn't.

I can rename and mv no problem and have the following exports:

/srv/nfs4             192.168.1.78(rw,fsid=0)
/srv/nfs4/data     192.168.1.78(rw,nohide)

So it could be to do with permissions and root squashing.

As an aside, no_subtree_check is unnecessary now as it's the default value (see man exports).

Last edited by skanky (2013-09-17 10:36:24)


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

Board footer

Powered by FluxBB