Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Mar 2010
    Posts
    2

    Question Question About two home directory

    Hello

    i add new hard disk drive and mounted as /home2 and i add in Basic cPanel/WHM Setup under Home Directory Prefix , now i have accounts already in default home directory which is /home

    the question is : how could i move the accounts already in /home to /home2

    thanks

  2. #2
    Member twhiting9275's Avatar
    Join Date
    Sep 2002
    Posts
    366
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: Question About two home directory

    You wouldn't.
    Moving accounts from /home/ to /home2/ is far more complicated than just moving the account's directory. You've got logins to worry about, apache to worry about, ftp, mail, cPanel, it's a big old mess. Right now, there's no "automated" way to do this, though you might be able to terminate and restore from backups IF you have the /home2/ partition setup as the primary one. I did say might, because I'm not sure that would work either.
    Linux Tech Networks: Reliable Server Administration and Monitoring since 2002

  3. #3
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    Nov 2006
    Location
    Lansing, Mi
    Posts
    19

    Default Re: Question About two home directory

    Quote Originally Posted by iLinux85 View Post
    Hello

    i add new hard disk drive and mounted as /home2 and i add in Basic cPanel/WHM Setup under Home Directory Prefix , now i have accounts already in default home directory which is /home

    the question is : how could i move the accounts already in /home to /home2

    thanks
    The quick and dirty way to do it is to copy all of the contents of the /home/$user directory to /home2/$user, and then symlink them. You will want to make sure, if there is content being written to those folders, that you stop Apache after your initial copy, and re-sync the data.

    Here's a list of commands. Make sure to replace the appropriate information, delineated by a '$'

    mkdir /home2/$user
    chown $user:$user /home2/$user
    rsync -avHl /home/$user/ /home2/$user/
    /etc/init.d/httpd stop
    /etc/init.d/cpanel stop
    rsync -avHl /home/$user/ /home2/$user/
    mv /home/$user /home/$user.bak
    ln -s /home2/$user /home/$user
    /etc/init.d/httpd start
    /etc/init.d/cpanel start
    That should get some space cleared up for you. If you work with a managed provider, they should be willing to help you out with getting those accounts moved.

    Good luck!
    Benny Crampton
    Liquid Web || StormOnDemand
    1-800-580-4985 | Twitter: @liquidweb | @StormOnDemand

Similar Threads & Tags
Similar threads

  1. Home directory not available
    By scifimeshes in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 02-15-2011, 12:15 PM
  2. Home Directory Backup
    By worldcom in forum cPanel and WHM Discussions
    Replies: 6
    Last Post: 02-28-2007, 04:27 PM
  3. Home Directory Backup Question
    By Chalk4Brains in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 05-27-2005, 05:33 AM
  4. What's .cpan in the home directory for?
    By DWHS.net in forum cPanel and WHM Discussions
    Replies: 5
    Last Post: 01-04-2004, 08:41 PM
  5. Home Directory Burning Question
    By lost in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 09-15-2003, 09:13 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube