I have a machine that is set up in such a way that /home is a symlink to a directory on an NFS volume (something like /nfsvol/some/other/path/home). I need to move this back on to the machine's own filesystem, but I'm not sure what's the safest way to do this:
- Simply copy the contents of /home to /new_home then remove /home and rename /new_home to /home
- Use
usermod -d -m /new_home/$USERNAME $USERNAMEand then rename /new_home to /home - but if I rename /new_home to /home after runningusermod -d -m, will that cause any problems? Would any part of the system still think that home directories are in /new_home - Is there a better way?
Also, if I use usermod, do I need to consider locking the user's account until the move operation is complete? Some users have very large home directories (>100GB) so it may take several minutes.
rsyncand then come migration time do a finalrsync(which should be faster as it should only need to move the delta from the pre-copy run).ldapsearch -xshould tell you if there are ldap accounts. In a secure ldap setup root can't make any changes to the users (you have to useldapmodifyinstead)