Sign In
Sign In

Server Configuration

Updated on 26 March 2024

You can manage your cloud server’s configuration in the Plan tab.

Image10

Here, you can:

  1. Select a new plan for the server thus changing the disk space, the amount of RAM and the number of CPU cores;
  2. Add up to 3 additional disks to your server;
  3. Delete disks;
  4. Increase the disk size.

Operations with disks are not available if a snapshot is created for the server.

Changing the server plan

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:

  1. Go to the Plan tab.

  2. Click Select plan

  3. Choose a new plan for the server.

  4. Click Save and reboot to apply the changes.

  5. Confirm the action.

Image6

Adding new disks

To add an additional disk to your server:

  1. Go to the Plan tab.

  2. Click Add disk.

Image3

  1. Set the desired disk size and click Add and reboot.

Image14

  1. Confirm the action.

You will see the new disk in the control panel.

Image16

Configuring the disk in the OS

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 from a to z. 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 for cloud-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:

  1. Connect to your server via SSH.

  2. 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.

  1. 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
  1. 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.

  1. 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.

Resizing the disk

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.

Main disk

To resize your main disk, simply change your server plan:

  1. Go to the Plan tab.

  2. Click Select plan

  3. Select a plan with the sufficient disk size.

  4. Click Save and reboot to apply the changes.

  5. Confirm the action.

Additional disk

To change the size of an additional disk:

  1. Go to the Plan tab.

  2. Hover over the disk and click on the cog icon.

  3. Select new disk size.

  4. Click Save.

Image4

Partitioning the disk

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.

Image9

  • Select Booting from the recovery disk.

Image7

  • 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.

Image2

  • 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

Image1

    • 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

Image13

Step 6. Resize the file system, specifying the partition name:

resize2fs /dev/vda3

Image19

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

Image15

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.

Deleting disks

To delete a disk:

  1. Go to the Plan tab.

  2. Hover over the disk and click on the bin icon.

Image18

  1. Confirm deleting the disk.

You also need to delete the disk from the operating system by removing the entry from the /etc/fstab file.

Edit the /etc/fstab file

If the server has only one additional disk:

  1. Open the file:

nano /etc/fstab
  1. Delete or comment out the disk entry:

Group 1321314175

  1. 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:

  1. Open the file:

nano /etc/fstab
  1. Delete or comment out the disk entry:

Group 1321314177

  1. 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:

Group 1321314178

This is actually your third disk (vdd), which has been mounted to the /mnt/disk3 directory.

  1. Mount the disk to the same directory, specifying its updated name (in our case, vdc1):

mount -o barrier=0 /dev/vdc1 /mnt/disk3
  1. Edit the /etc/fstab file with the updated data:
nano /etc/fstab

Group 1321314179

  1. Reboot the server.

CPU and RAM

To change the CPU and RAM parameters of your server, change the server plan:

  1. Go to the Plan tab.

  2. Click Select plan

Image10

  1. Select a plan with the required parameters.

Image6

  1. Click Save and reboot to apply the changes.
  2. Confirm the action.
Was this page helpful?
Updated on 26 March 2024

Do you have questions,
comments, or concerns?

Our professionals are available to assist you at any moment,
whether you need help or are just unsure of where to start.
Email us
Hostman's Support