Adding a new partition to an existing drive

mvandemar

Well-Known Member
Jun 17, 2006
91
22
158
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

Do not attempt to create a partition on a device that is in use.
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:
[email protected] [~]# 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
 

mvandemar

Well-Known Member
Jun 17, 2006
91
22
158
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
 

cPanelMichael

Technical Support Community Manager
Staff member
Apr 11, 2011
47,911
2,233
363
cPanel Access Level
DataCenter Provider
Twitter
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.
I don't believe OVH advises doing this without extra caution:

This change should be done with great caution. Any error can cause total data loss. It is therefore advisable to take a snapshot before starting. Or contact support to do this as part of an intervention for a fee.
They offer a service to make this change on your behalf, from what I read on their documentation.

Thank you.
 

mvandemar

Well-Known Member
Jun 17, 2006
91
22
158
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
 

cPanelMichael

Technical Support Community Manager
Staff member
Apr 11, 2011
47,911
2,233
363
cPanel Access Level
DataCenter Provider
Twitter
This isn't an OVH specific question, it is in regards to a cpanel vps running on centos. Do you know the answer?
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.
 

mvandemar

Well-Known Member
Jun 17, 2006
91
22
158
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
 

mvandemar

Well-Known Member
Jun 17, 2006
91
22
158
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
 

cPanelMichael

Technical Support Community Manager
Staff member
Apr 11, 2011
47,911
2,233
363
cPanel Access Level
DataCenter Provider
Twitter
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?
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.
 

mvandemar

Well-Known Member
Jun 17, 2006
91
22
158
It is currently using 37G of 49G. The new partition will double the space.

-Michael
 

cPanelMichael

Technical Support Community Manager
Staff member
Apr 11, 2011
47,911
2,233
363
cPanel Access Level
DataCenter Provider
Twitter
It is currently using 37G of 49G
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.
 

mvandemar

Well-Known Member
Jun 17, 2006
91
22
158
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
 

cPanelMichael

Technical Support Community Manager
Staff member
Apr 11, 2011
47,911
2,233
363
cPanel Access Level
DataCenter Provider
Twitter

mvandemar

Well-Known Member
Jun 17, 2006
91
22
158
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
 

cPanelMichael

Technical Support Community Manager
Staff member
Apr 11, 2011
47,911
2,233
363
cPanel Access Level
DataCenter Provider
Twitter
New 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.
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.