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.

Adding a new partition to an existing drive

Discussion in 'Workarounds and Optimization' started by mvandemar, Feb 29, 2016.

  1. mvandemar

    mvandemar Member

    Joined:
    Jun 17, 2006
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    1
    I currently have a vps through OVH. I upgraded the package to double the disk size. However, they are very "hands off" (which I knew going in, part of why the hosting is so inexpensive), so when they increased the disk size it's up to me now to add the new partition. The disk is actually larger now, it's not a separate device, so I am concerned because when researching how to do this I found this warning from the CentOS docs:

    Chapter 6. Managing Disk Storage

    I am guessing the same, or even moreso, warning would apply to increasing the disk size. As I only have whm and ssh access to the server, I am also guessing the device will always be in use when I access it.

    How can I safely utilize this new disk space? This is what I get with parted -> print free:

    Code:
    root@ns1 [~]# parted
    GNU Parted 2.1
    Using /dev/sda
    Welcome to GNU Parted! Type 'help' to view a list of commands.
    (parted) print free                                                       
    Model: VMware Virtual disk (scsi)
    Disk /dev/sda: 107GB
    Sector size (logical/physical): 512B/512B
    Partition Table: msdos
    
    Number  Start   End     Size    Type     File system     Flags
            32.3kB  2097kB  2065kB           Free Space
    1      2097kB  53.2GB  53.2GB  primary  ext3            boot
    2      53.2GB  53.7GB  499MB   primary  linux-swap(v1)
            53.7GB  107GB   53.7GB           Free Space
    Thanks!

    -Michael
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  3. mvandemar

    mvandemar Member

    Joined:
    Jun 17, 2006
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    1
    So are you saying it's safe to follow those instruction on a device that is in use? Also, those instructions appear to be for deleting and recreating a partition, which I am pretty sure is not what I need to do here. I just need to partition the free space so I can use it as /home2.

    -Michael
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    I don't believe OVH advises doing this without extra caution:

    They offer a service to make this change on your behalf, from what I read on their documentation.

    Thank you.
     
  5. mvandemar

    mvandemar Member

    Joined:
    Jun 17, 2006
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    1
    I am not asking about mistakes, I am asking if it is safe to do this operation on a drive that is in use? If not, is there a way to remotely perform these operations without the disk being in use?

    This isn't an OVH specific question, it is in regards to a cpanel vps running on centos. Do you know the answer?

    -Michael
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    It's important to keep in mind that while your question is about CentOS and cPanel, OVH uses a particular software for their VPS machines, so special care is sometimes required. For instance, often times VPS software allows for easier manipulation of partitions or easier methods of increasing free space compared to traditional dedicated servers. I suggest consulting with OVH to see how they suggest handling this.

    Thank you.
     
  7. mvandemar

    mvandemar Member

    Joined:
    Jun 17, 2006
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    1
    Thank you for that. They finally got back to me to let me know that they don't handle it at all, even for a fee. It really is a completely unmanaged server. The offer to do it for a fee has to do with their European branch.

    So, that being said, is there an easy way to do a complete off-site backup when you don't have room to back up the server locally?

    Thanks!

    -Michael
     
  8. storminternet

    storminternet Well-Known Member

    Joined:
    Nov 2, 2011
    Messages:
    462
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    It's better to backup the sites on remote ftp locations for the data safety.
     
  9. mvandemar

    mvandemar Member

    Joined:
    Jun 17, 2006
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    1
    And I am asking if there is an easy way to do this en masse for all of the cpanel accounts on the server, thanks.

    Is there?

    -Michael
     
  10. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    Could you confirm how much space is available on the local server? This can help determine if the native backup features included with cPanel will help.

    Thank you.
     
  11. mvandemar

    mvandemar Member

    Joined:
    Jun 17, 2006
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    1
    It is currently using 37G of 49G. The new partition will double the space.

    -Michael
     
  12. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    You can use the "Transfer Tool" option in Web Host Manager on the destination server (assuming you are creating a new server with the additional space). It's documented at:

    Transfer Tool - Documentation - cPanel Documentation

    Could you verify if that's the plan, or if you are simply seeking offsite storage solutions for your account backup archives?

    Thank you.
     
  13. mvandemar

    mvandemar Member

    Joined:
    Jun 17, 2006
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    1
    Ah, neither. I am attempting to enlarge the existing partition, and I would like to back up the server somewhere before I do, in case something goes wrong.

    -Michael
     
  14. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    You can configure backups to a remote destination:

    Backup Configuration - Documentation - cPanel Documentation

    However, note that you may need to exclude the home directory on larger accounts and rsync that data over manually to the remote destination, depending on how large your accounts are.

    Thank you.
     
  15. mvandemar

    mvandemar Member

    Joined:
    Jun 17, 2006
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    1
    Wouldn't there need to be enough free space on the local server to perform all of the account backups first? I am not sure there is.

    What about this, if I just rsync the home and mysql directories off site, what else would I need to backup in order to rebuild things if everything goes wrong?

    -Michael
     
  16. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    It's possible your system will run out of space during the backup generation, yes. How many accounts are on this server? You could manually package each account and then copy the account to the remote server via the command line:

    /scripts/pkgacct — Package a cPanel Account - Documentation - cPanel Documentation

    This way, you only need enough space to backup one account at a time. Manually copying the entire server is not supported, as configuration data is stored throughout the server. You could look into a solution from a company such as R1Soft for that type of backup.

    Thank you.
     
Loading...

Share This Page