Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

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 /home to new disk

Discussion in 'Workarounds and Optimization' started by autumnwalker123, Dec 27, 2016.

  1. autumnwalker123

    autumnwalker123 Active Member

    Joined:
    Jan 19, 2014
    Messages:
    39
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    Hello,

    I've been running out of room on my cPanel server so I have added a new disk and partition via LVM. The intent was to rsync the contents of /home over to the new partition and then remount the new partition as /home when the data was copied; however, I've run into an issue where rsync is copying the full contents of /home/virtfs to the new drive.

    Thoughts on how I should proceed here? I'd like to avoid going with /home2 and actually have /home moved to a new partition which is under LVM and can be expanded in future.

    Thanks!
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,419
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    You may want to consider moving the accounts to the new partition via the following option instead of via rsnyc:

    Rearrange an Account - Documentation - cPanel Documentation

    Ensure the new partition name matches the home directory prefix before using the option. Then, once the accounts are copied over, you can adjust your partitions accordingly.

    Thank you.
     
  3. autumnwalker123

    autumnwalker123 Active Member

    Joined:
    Jan 19, 2014
    Messages:
    39
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    Thanks Michael. I was able to successfully move /home to the new logical volume using rsync and excluding /home/virtfs from being copied across. After putting the server into single user mode I could move the old /home directory to a new location (/hm_old) and remount the new logical volume as /home with all of the accounts working as desired. A reboot of the server caused cPanel to recreate /home/virtfs under the new LV.

    My question now is, am I able to delete /hm_old/virtfs? I assume that cPanel won't have mounted the /virtfs folder in the hm_old directory.

    FYI - for anyone reading this with the same issue the reason I chose "hm_old" is because cPanel will look to place new accounts in any directory with "home" in it, which has the most disk space available - I wanted to avoid this so chose a name without "home" in it.
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,419
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    You can review the /proc/mounts file to check your system for VirtFS mount points. Feel free to open a support ticket with us if you'd like us to verify that removing the old directory won't cause any problems.

    Thanks!
     
  5. autumnwalker123

    autumnwalker123 Active Member

    Joined:
    Jan 19, 2014
    Messages:
    39
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    Excellent, thanks! I've taken a look at /proc/mounts and I see the VirtFS mount points for the new /home, but nothing under /hm_old.
     
  6. 24x7server

    24x7server Well-Known Member

    Joined:
    Apr 17, 2013
    Messages:
    1,480
    Likes Received:
    60
    Trophy Points:
    28
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Hi,

    You can simple perform rsync to exclude the folder you don't want to copy over. Below is the command you can use..

    # rsync -av --progress --exclude 'virtfs' /home/ /home2/
     
Loading...

Share This Page