[CentOS] How to relocate $HOME directory

Mon Jan 31 08:49:05 UTC 2011
Rudi Ahlers <Rudi at SoftDux.com>

On Mon, Jan 31, 2011 at 8:22 AM, Tom H <tomh0665 at gmail.com> wrote:
> On Mon, Jan 31, 2011 at 12:18 AM, Rudi Ahlers <Rudi at softdux.com> wrote:
>> On Sun, Jan 30, 2011 at 11:07 PM, Soo-Hyun Choi <s.choi at terabit.org.uk> wrote:
>>>
>>> As you know, $HOME is generally located at "/home/$username" by default.
>>>
>>> I would like to re-locate all users' $HOME directories to something like
>>> "/export/home/$username" without having a hassle/trouble.
>>>
>>> Initially, I've thought of just copying them to the new directory (under
>>> /export/home/xxx), but guessed it might trouble for the normal use (I'm
>>> pretty new to CentOS, although many experiences with Debian/Ubuntu).
>>>
>>> Is there any good tricks (or caveats) when moving users' home directory
>>> cleanly with CentOS? (I'm with CentOS 5.5 x86_64)
>>
>> The easiest way would be to move (or copy) everything in /home to
>> /export/home, and then remount /home on /export/home in your fstab.
>>
>> Before you remount it, you may want to rename it to say /oldhome or
>> /home2 or something like that, and then if everything works fine then
>> you simply delete it :)
>
> If you're changing the root of /home to another mount point or
> directory, say "/export/home", you'll also have to use semanage to set
> its selinux context to "home_root_t", etc.
> _______________________________________________



I generally do this on systems without website stored in the home
folders, since website files are normally stored in /var/www/html
folder by default.

So,  in this case you just need to update the httpd.conf file and tell
it where the new home folder resides, IF you actually store website
files in the /home folder.

-- 
Kind Regards
Rudi Ahlers
SoftDux

Website: http://www.SoftDux.com
Technical Blog: http://Blog.SoftDux.com
Office: 087 805 9573
Cell: 082 554 7532