The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Move users from /home to /home2

Discussion in 'General Discussion' started by Go2reg, Dec 16, 2003.

  1. Go2reg

    Go2reg Active Member

    Joined:
    Apr 30, 2003
    Messages:
    25
    Likes Received:
    0
    Trophy Points:
    1
    I have been having alot of issues with my server. So now i think that it could be the harddrive. I have added another drive to the server and need to know.

    How do I move users domains from one drive to another without loosing data and permissions.
     
  2. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    ON, Canada
    Under "Account Functions" in WHM you will see "Rearrange Accounts". That allows you to move them.
     
  3. Go2reg

    Go2reg Active Member

    Joined:
    Apr 30, 2003
    Messages:
    25
    Likes Received:
    0
    Trophy Points:
    1
    Thank you one more question will i need to sim link these user accounts if i have the main /home re-imaged.
     
  4. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    ON, Canada
    I'm not certain about that because I use my own method of putting some accounts on the 2nd drive. I think when WHM moves an account, it updates the location of it in the httpd.conf file. If that is how it does it, then you can do whatever you want to the home directory.

    Move one account and see if it changes the location in the httpd.conf file.

    Someone else can probably answer more accurately than I can for that.
     
  5. perlchild

    perlchild Well-Known Member

    Joined:
    Sep 1, 2002
    Messages:
    279
    Likes Received:
    0
    Trophy Points:
    16
    You will want them symlinked, mostly because going over every email alias/filter that may or may not have been retored to make sure they all point to /home2 would be an expensive proposition.
    httpd.conf and /etc/passwd(and in general all global system files) usually update immediately. But per-user configs may be restored by users, so having the symlinks(or symlinking /home to /home2 might be a valid investment of time)
     
  6. big

    big Well-Known Member

    Joined:
    Aug 12, 2001
    Messages:
    224
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Earth
    i was wondering is it possible to have multiple arrange accounts by one click ?

    i have around 200 accounts need to move them from /home to /home2 its a long task if i need to go to every account and do it.
     
  7. nat

    nat Well-Known Member

    Joined:
    Jan 16, 2003
    Messages:
    204
    Likes Received:
    0
    Trophy Points:
    16

    I'm wanting this too. The point of rearranging accounts is to free space on one drive. I would like to see Rearrange Accounts page chagned to list all accounts on one page with a check mark box beside each domain and the disk space usage of that domain.

    That way i can place a check mark on the ones I want to rearange, choose the drive to move all of the checked accounts to, and then click submit.
     
  8. big

    big Well-Known Member

    Joined:
    Aug 12, 2001
    Messages:
    224
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Earth
    i did it using the following
    cd /home2
    mv * /home
    cd /
    umount /home2
    ln -s /home /home2

    edit ur /etc/fstab and mount the other disk to another mount point.
     
  9. ddeans

    ddeans Well-Known Member

    Joined:
    Feb 13, 2004
    Messages:
    296
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Maryland
    Has anyone figured out if you can delete the sym link of /home2 and if everything will still work for that domain thats now on /home?
     
  10. big

    big Well-Known Member

    Joined:
    Aug 12, 2001
    Messages:
    224
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Earth
    it wont work, so many files need to edit.

    most of them are done automatically, but some in ~user/etc/passwd doesn't get changed and still points to the old dir.
     
  11. ddeans

    ddeans Well-Known Member

    Joined:
    Feb 13, 2004
    Messages:
    296
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Maryland
    thats dumb, i wanted to use that hd for backup purposes. ohh well
     
  12. ddeans

    ddeans Well-Known Member

    Joined:
    Feb 13, 2004
    Messages:
    296
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Maryland
    Does anyone know if this would work: Transfer the accounts that are symlinked to another server, then delete the accounts off of /home2(on server 1) on the current server, and then reformat /home2 and copy the accounts back to /home? Will that work?
     
  13. calvinphanctt

    calvinphanctt Active Member

    Joined:
    Mar 27, 2007
    Messages:
    44
    Likes Received:
    0
    Trophy Points:
    6
    After move?

    Hello,

    I move 1 account from /home (1st hard drive) to /home3 (2nd hard drive) using "Rearrange" of WHM.

    It worked but them I was not able to surf my web site (the one I just moved).

    Then I edit the file /etc/httpd/httpd.conf and edit the location of this account to /home3. I was able to surf my web site!

    Next, I can't log in FTP, then I change the path of file /etc/passwd , I was able to log in.

    However, in the WHM, when I click on "List accounts" I still see the domain (account) which I just moved still listed as it is in /home and not /home3/

    Do you know why? and how to fix this?

    Is there anything else I should do after I make a move of account from /home to /home3 ?Please help!

    Thank you.

    Regards,
    Calvin
     
  14. kevinm

    kevinm Member

    Joined:
    Feb 22, 2006
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    1
    Off topic , however should be pointed out , if you move the physical paths of the users home folders , any users scripts that have hard coded paths in will most likley start to complain about things not being found ..

    My preference would be to install a new hdd , shut down ftp services , then run a mv to the new hdd , then mount the new hdd onto the old folder that had the homes . That way no scripts will fail , the change will be transparent(ish) to the users , and httpd changes are not required.

    something like this could do the move / remount on an account by account basis (DONT USE THE BELOW ITS NOT TESTED , IVE JUST BASHED THIS TOGETHER TO GIVE A STARTER ! )

    cd /home
    ls --format=single-column |awk {'print "mv "$1 " /tmp_home/ ; mount -o bind /tmp_home/"$1" /home/"$1"'} && mount |grep bind |grep home | awk {'print " umount $3 -l"} && mount /dev/newhdd /home

    then as each account is moved, the home will be remounted to the new location meaning minimal disruption, then once all the moves / individual bind mounts are done / complete , all those binds are removed , and the new drive mounted to the /home folder.

    good luck !
     
    #14 kevinm, Mar 31, 2007
    Last edited: Mar 31, 2007
Loading...

Share This Page