Score:1

How to change ownership of a remote file tree

us flag

I have a tree of files on a remote server, and I want to obtain ownership of them. The tree is mounted at /Musique. I tried chown -R paul /Musique but I got an error message "Invalid argument" for every file in the tree.

I think if I could mount the tree with the no_root_squash option, that would fix the problem. Currently, I mount the tree like this:

mount -t nfs 192.168.0.21:/volume1/Musique /Musique

That mounts the tree correctly, but I can't change the ownership of the files in it. I can't figure out where to put no_root+squash. I think it should be an option on the mount command, but I just haven't been able to get the syntax right.

The remote server is a Synology network attached storage unit. I've created a user paul there, but I haven't figured out how to get the numerical user IDs into correspondence.

hr flag
Is there actually a user named `paul` on the remote server? Does it have the same numerical UID as `paul` on your local system?
hr flag
... in any case, `no_root_squash` isn't something you can set as a client-side mount option, it would need to be specified in the server-side `exports` file
Score:1
fr flag

Mounting with -t nfs you are using NFSv3. This has almost no concept of the "identity mapping" added in NFSv4, so your NFSv3 Server needs to have a user with the same UID as your system's user named paul. It would be a good idea to name the remote user paul as well.

You are probably getting "Invalid argument" because the NFSv3 Server does not have any user with paul's UID, so you're trying to change ownership to a user which the NFSv3 Server does not know about.

To find paul's UID on your computer, use id -u paul. For example:

$ id -u paul
1000

Make a user on the NFSv3 Server named paul with the same UID as you got above (eg: 1000).

If the NFSv3 Server is a NAS with a web interface, then use that.

If the NFSv3 Server is a Linux system, create a group and a user like so. Change the UID from 1000 if needed:

groupadd -g 1000 paul
useradd paul -u 1000 -g 1000 -M

Now you should be able to change ownership of the NFSv3 files to paul.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.