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.

Moving /home

Discussion in 'General Discussion' started by wzd, Jun 23, 2006.

  1. wzd

    wzd Well-Known Member

    Dec 16, 2005
    Likes Received:
    Trophy Points:
    South Africa
    cPanel Access Level:
    Root Administrator
    Hi Guys,

    I have recently added in a new 200GB hard drive to the server and would like to move the current /home and everything in it to the new HDD which is /home2

    Is Cpanel or WHM able to do this and if so how? We have about 200 domains hosted in the current /home directory which takes up about 40GB

    Can anyone help with this migration?

  2. Well-Known Member

    Feb 6, 2004
    Likes Received:
    Trophy Points:
    Bucharest, Romania
    cPanel Access Level:
    DataCenter Provider
    let's say you have the new 200 gig hdd in one partition, probably /dev/sdb1

    mkdir /mnt/newhdd
    mount /dev/sdb1 /mnt/newhdd

    copy the contents of /home to /mnt/newhdd
    (use rsync, it will take alot the first time).

    change your fstab, and add a line like this:

    /dev/sdb1 /home ext3 defaults,usrquota 1 2

    comment the line that's already refering to home (probably something like this):

    LABEL=/home /home ext3 defaults,usrquota 1 2

    Then, sometimes when the load is low(preferably night time), rsync again to have the latest changes active.
    reboot the server.

    Everything should be in place, with the /home partition having 200 GB

    the old home partition is now unused, you can mount it somwhere else.
    (to know which partition it is, before the change type "mount" in a shell.
    You'll se something like

    /dev/sda8 on /home type ext3 (rw,usrquota)

    That means that after you did these changes, you can mount the old partition with

    mount /dev/sda8 /mnt/a_name_you_want
    or even
    mount /dev/sda8 /home2

    Please ask a server admin to do this for you. I've wrote this right now, hopefully without errors, but have an admin check to see if there are some mistakes. Then again, and admin would't need this "tutorial" :))

Share This Page