6

I changed the user id of a user on an NFS client that mounts a volume from another server. My goal is to get the 2 users to have the same id, so that both servers can read and write to the volume.

I changed the id successfully on the client system, but now when I look at the NFS mount from that system, it reports the files being owned by the old id. So it looks like I need to "refresh" that mount.

I have found many instructions on how to remount, but each seems slightly different according to the type of system. Is there a simple command I can run to get the mounted volume to refresh so that it interprets the new user settings?

Aaron Copley
  • 12,345
  • 5
  • 46
  • 67
AKWF
  • 481
  • 2
  • 6
  • 17

3 Answers3

11

If your mounted points are permanent- placed in /etc/fstab - you can run mount -a to re-read fstab, which is same as a refresh.

You could also use remount in case of a temporary mount

Patel95
  • 468
  • 4
  • 7
5

It sounds like you need to change the ownership of the files -- not remount the share. The files will continue to be owned by the old UID since nothing has been done about that.

As root or with sudo: find /path/to/share/. -uid $OLDUID -exec chown $USER {} \;

That said, to answer the question you can remount a share on any Linux system with the remount option to the mount command.

mount -o remount /mountpoint

Aaron Copley
  • 12,345
  • 5
  • 46
  • 67
  • Thanks, but all I get from this, even after doing the remount, is: chown: changing ownership of `/myshare/abcxyz.def': Invalid argument – AKWF Oct 11 '12 at 03:54
  • 1
    We both answered your question (how to remount an NFS volume.) I'm sorry it didn't fix the problem but glad you were able to under your [other question](http://serverfault.com/questions/436877/a-tale-of-two-user-ids-why-does-nfs-not-recognize-a-new-user-id). – Aaron Copley Oct 11 '12 at 14:48
2

Most NFS settings cannot be changed using remount or mount -a. See 'man nfs' where you will read:

With few exceptions, NFS-specific options are not able to be modified during a remount.

As long as nothing is using the NFS share, after you have changed the settings in your /etc/fstab file you can do something like:

umount /mountpoint && mount /mountpoint

to quickly remount with new options. By using the && it will not try to mount the share again unless the umount was successful.