Adding and removing a disk

Adding a disc

To add a VPS server disk, create a ticket to the billing department. Next, you need to restart the virtual server. Only then the  changes will be applied.

Preparing a disk in Linux

To prepare a disk in Linux, you need to create a partition and filesystem, mount the disk, and create an entry in the /etc/fstab file. To do this, you need to know what the disks are called on your system. Typically this is vd* or xvd*. We recommend you clarify the data on disks using this instruction.

Here we will consider preparing the vdc disk.

Creating a partition

To create a disk using the fdisk utility, run:

fdisk /dev/vdb

Press n to create a new partition.

Then press p and select the partition type.

Next press Enter for other parameters.

Finally press w to save your changes.

File system creation

To create a file system (for example EXT4) enter:

mkfs.ext4 /dev/vdb1

Mount the disk

To create a new directory, enter:

mkdir /mnt/disk-2

Next, mount the disk to this directory:

mount -o barrier=0 /dev/vdb1 /mnt/disk-2

Now, when writing information to the disk-2 directory, it will be saved to the new disk.

Creating an entry in the /etc/fstab file

The binding of the disk to the directory must be preserved even after the operating system restart. To do this, run:

echo "/dev/vdb1 /mnt/disk-2 ext4 barrier=0 0 1" >> /etc/fstab

An entry will be added to the /etc/fstab file and the disk will be fully operational.

Removing a disc

In the configuration file /etc/fstab, remove the line with the file system of the disk.

If you still have questions, please create a ticket to technical support.