Urgent: Need To Change The Location Of A Directory Tree

Home » CentOS » Urgent: Need To Change The Location Of A Directory Tree
CentOS 3 Comments

Hi,

I am running CentOS 7 (fully updated) on a VM. This has a mounted nfs share (via fstab) (which mounts a remote storage system) on which we have created the home directories of 2 users

Here are the home directories:

/mynfsmount
|
|–/user1
|–/user1

We want to move this whole branch from the mounted NFS share to the local disk.

What is the way to do so?

Would it be enough to create a “mirror” branch on the local disk, say:

/mynfsmount2
|
|–/user1
|–/user1

(which is no more an nfsmount, despite the name), then remove the mount from fstab and the initial mount point /scimount and finally rename
/scimount2 to /scimount ?

Does it sound OK? Will we need to modify any other system info so that the above homes work correctly at their new location?

Thanks a lot, Nick

3 thoughts on - Urgent: Need To Change The Location Of A Directory Tree

  • Correction:

    …then remove the mount from fstab and the initial mount point
    /mynfsmount and finally rename /mynfsmount2 to /mynfsmount ?

    Sorry for the confusion. (I changed the directory names while editing the mail, but I failed to change them all.)

    Looking forward to your advice.

    Thanks, Nick

  • 1. Make sure both users are not logged in.
    2. Create new mountpoints
    3. Edit fstab to point to new mountpoints.
    4. Edit /etc/passwd to refer to the new mountpoint for the two users
    5. mount -a

    Would that do the trick for you?

  • Thanks Mauricio,

    Actually, the process you describe is the same as the one I described, with the difference that we use the same mount point for the new location (after unmounting the nfs mount), so we don’t need to edit
    /etc/passwd.

    I completed this procedure successfully.

    Thanks again, Nick

LEAVE A COMMENT