How can I remount an NFS volume on Red Hat Linux?

70,253

Solution 1

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

Solution 2

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

Solution 3

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.

Share:
70,253

Related videos on Youtube

AKWF
Author by

AKWF

I have been developing in Ruby on Rails for over 10 years. I'm focusing on developing reusable APIs with Grape API in Ruby. I have 25 years of experience with relational databases including Oracle, MySQL, and Postgres. I have been programming computers since I received a Commodore 64 in the early 1980s.

Updated on September 18, 2022

Comments

  • AKWF
    AKWF almost 2 years

    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?

  • AKWF
    AKWF over 11 years
    Thanks, but all I get from this, even after doing the remount, is: chown: changing ownership of `/myshare/abcxyz.def': Invalid argument
  • Aaron Copley
    Aaron Copley over 11 years
    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.
  • nullability
    nullability almost 6 years
    mount -a solved my problem