You can manage your cloud server’s configuration in the Plan tab.
Here, you can:
Operations with disks are not available if a snapshot is created for the server.
You can only upgrade your server’s plan. Downgrading is not possible as reducing the disk size can damage the file system.
To change your server's plan:
Go to the Plan tab.
Click Select plan.
Choose a new plan for the server.
Click Save and reboot to apply the changes.
Confirm the action.
To add an additional disk to your server:
Go to the Plan tab.
Click Add disk.
Set the desired disk size and click Add and reboot.
Confirm the action.
You will see the new disk in the control panel.
Now you have to add the disk in the operating system. It can be done using the fdisk
utility.
On Hostman servers, disk names follow the format
vd*
, where*
is replaced by a letter froma
toz
. The letter corresponds to the disk’s number in the system.
The primary disk always contains the operating system and is named
vda
. The second disk,vdb
, is reserved forcloud-init
.
In the examples below we’re adding a disk named
vdc
.
You can check the actual disk names in your system with the command:
fdisk -l
To add the new disk:
Connect to your server via SSH.
Create a new partition.
Enter the command:
fdisk /dev/vdc
Next:
Press n
to create a new partition
Press p
to select the primary partition type.
Press Enter to leave the rest of the parameters unchanged.
Press w
to save changes.
Create the file system.
Now you need to create a file system in the new partition. We will create the EXT4
system. Enter the command:
mkfs.ext4 /dev/vdc1
Mount the disk.
To be able to work with the new drive, you need to mount it to a directory.
Each disk should be mounted to a separate directory. If later on you add another disk (
vdd
), you will need to create a separate directory for mounting it, e.g.disk3
.
Create the directory:
mkdir /mnt/disk2
Mount the disk:
mount -o barrier=0 /dev/vdc1 /mnt/disk2
Now the files saved to the /mnt/disk2
directory will be written to the new disk.
Add an entry to the /etc/fstab
file.
To make mount permanent (so the disk is still mounted after reboot), enter the command:
echo "/dev/vdc1 /mnt/disk2 ext4 barrier=0 0 1" >> /etc/fstab
It will create the necessary entry in the /etc/fstab
file.
We recommend creating a server backup before resizing disks.
You can only increase the disk’s size. Decreasing the size is not possible as it can seriously damage the file system.
In most cases, after you resize the disk in the control panel, the disk will be repartitioned automatically.
However, if you have previously partitioned the disk yourself and now it has two or more logical partitions, you will need to repartition manually.
To resize your main disk, simply change your server plan:
Go to the Plan tab.
Click Select plan.
Select a plan with the sufficient disk size.
Click Save and reboot to apply the changes.
Confirm the action.
To change the size of an additional disk:
Go to the Plan tab.
Hover over the disk and click on the cog icon.
Select new disk size.
Click Save.
In most cases, after you resize the disk in the control panel as described above, the disk will be repartitioned automatically.
However, if you have previously partitioned the disk yourself and now it has two or more logical partitions, you will need to repartition manually, following the steps described below.
Step 1. Boot the server in the recovery mode:
Go to the Access tab.
Click Change in the OS boot mode section.
Select Booting from the recovery disk.
Click Save and reboot.
Step 2. Go to the Console tab and enter the following command using your disk name:
parted /dev/vda
You can check disk names in your system with the command:
fdisk -l
Step 3. Execute the print
command and view the list of partitions in its output.
If you want to extend the last partition so it takes all the free space on the disk, go to step 4a.
If you want to create a new partition, proceed to step 4b.
We do not cover in this article the cases when you need to create several new partitions, but you can find those guides online.
If at this point you need to delete a partition, you can do it with the rm command, specifying the partition number, for example:
rm 3
Step 4. Partition the disk.
Step 4a. To extend the last partition, run the resizepart command, specifying the desired partition number and size. If you enter 100%
, the partition will take up all available space on the disk.
resizepart 3 100%
Next:
Run print
to check the result.
Enter q
to exit the partitioning program.
Proceed to Step 5.
Step 4b. To create a new partition in a free disk space, run the mkpart
command, specifying the partition type (primary or extended), its number and size. If you enter 100%
, the partition will take up all available space on the disk.
mkpart primary 4 100%
Next:
Enter yes
when prompted to confirm the new partition size.
Run print
to check the result.
Enter q
to exit the partitioning program.
Create a file system in the new partition with the command below, specifying the partition name.
mkfs.ext4 /dev/vda4
Proceed to Step 5.
Step 5. Check for errors and correct the file system structure.
To do this, run the e2fsck
command in the console, specifying the name of the partition from the Step 4 (/dev/vda3
, /dev/vda4
, etc.):
e2fsck -yf /dev/vda3
Step 6. Resize the file system, specifying the partition name:
resize2fs /dev/vda3
Step 7. Check the file system after expansion.
Mount the partition that was modified (/dev/vda3
, /dev/vda4
, etc.):
mount /dev/vda3 /mnt
Check that the size was successfully changed:
df -h
If the disk size has remained the same, we recommend going back to Step 1 and repeating the procedure once again.
If the disk size has changed, unmount the system disk:
umount /mnt
8. Boot the server in the standard mode.
Go to the Access tab.
Click Change in the OS boot mode section.
Select Standard mode.
Click Save and reboot.
To delete a disk:
Go to the Plan tab.
Hover over the disk and click on the bin icon.
Confirm deleting the disk.
You also need to delete the disk from the operating system by removing the entry from the /etc/fstab
file.
If the server has only one additional disk:
Open the file:
nano /etc/fstab
Delete or comment out the disk entry:
Save changes (Ctrl + X, then Y and Enter).
If there are several additional disks on the server and the one you are deleting is not the last one:
Open the file:
nano /etc/fstab
Delete or comment out the disk entry:
Check the disk names on your system, for example with the lsblk
command. They should have moved one step up. Say, you had additional disks vdc
and vdd
. Then after deleting the vdc
disk, you should see the following:
This is actually your third disk (vdd
), which has been mounted to the /mnt/disk3
directory.
Mount the disk to the same directory, specifying its updated name (in our case, vdc1
):
mount -o barrier=0 /dev/vdc1 /mnt/disk3
/etc/fstab
file with the updated data:nano /etc/fstab
To change the CPU and RAM parameters of your server, change the server plan:
Go to the Plan tab.
Click Select plan.
Select a plan with the required parameters.