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.

Upgrade Hard Drive

Discussion in 'Data Protection' started by Andy83, Mar 21, 2018.

  1. Andy83

    Andy83 Member

    Joined:
    Jul 28, 2017
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Canada
    cPanel Access Level:
    Root Administrator
    Hi,

    My server is running out of disk space very soon.

    Currently, the CPanel software, database and web files are stored in 480GB SSD.

    And there is a 500 GB hard disk drive for storage and backup purposes.

    I am considering to add a 500GB SSD or 2 TB hard disk drive.

    What is the recommended method to upgrade or increase the disk space with minimum downtime?

    Thank you.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    42,782
    Likes Received:
    1,712
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
  3. Andy83

    Andy83 Member

    Joined:
    Jul 28, 2017
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Canada
    cPanel Access Level:
    Root Administrator
    Hi Michael,

    I would like to describe my situation in detail.

    One of my accounts is taking up more than 400GB of space inclusive of the MariaDB database.

    And one of the database tables is using 300GB and still growing (innodb 1 file per table). We derive this figure because its .ibd file shows 300GB.

    For your information, my existing SSD is 480GB only.

    So I have been getting email alerts that The filesystem "/" mounted at "/" reached "critical" status because you currently use 97.88% of its available blocks.

    Could you recommend a solution to add new hard drive to the server so that we can solve this lack of disk space issue?

    Thank you.
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    42,782
    Likes Received:
    1,712
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    In that case, you'll likely want to mount the 2TB drive and then move the MySQL data directory to a location on the new drive. Here's a thread with an example of how you can do that:

    How to move MySQL data directory

    Note that you can mount the new drive to a location such as /var/lib/mysql-2 as opposed to the /home location referenced in the example.

    Thank you.
     
  5. Andy83

    Andy83 Member

    Joined:
    Jul 28, 2017
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Canada
    cPanel Access Level:
    Root Administrator
    Hi Michael,

    Thanks for your reply.

    Based on your experience and knowledge, how long does it take to move the MySQL data directory from SSD to the new 2 TB hard disk drive?

    How much downtime do you anticipate the entire process to take?

    Thank you.
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    42,782
    Likes Received:
    1,712
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    You are mostly just moving the directory with the "mv" command, updating the MySQL data directory value in the /etc/my.cnf file, and adding a symlink. This generally only takes a few minutes to complete, but do keep in mind it's an unsupported solution.

    Thank you.
     
  7. Andy83

    Andy83 Member

    Joined:
    Jul 28, 2017
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Canada
    cPanel Access Level:
    Root Administrator
    Hi Michael,

    My developer suggested another solution.

    The root partition is under LVM. We can extend the LVM with the new disk and then resize the root partition over the new disk. The result will be partition spanning two disks, no need for moving files/renames/symbolic links etc., everything will be in the standard place. The downtime would be just for physically adding the new disk.

    rootusers.com/how-to-increase-the-size-of-a-linux-lvm-by-adding-a-new-disk/

    Please let me know your thoughts.

    Thank you.
     
    #7 Andy83, Mar 24, 2018
    Last edited by a moderator: Mar 24, 2018
  8. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    42,782
    Likes Received:
    1,712
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Yes, that's also an acceptable method of increasing the space available to the default MySQL data directory. Let us know how it works out.

    Thanks!
     
Loading...

Share This Page