How to attach BuyVM Block storage slabs

A simple method and guide to attaching BuyVM storage disk slabs to your VPS. This post uses a 3TB disk slab and VPS running Ubuntu 20.04.

Firstly make sure your block storage slab is attached to your server in the Stallion web panel.

Attach BuyVM storage slab stallion web panel

Then check it was attached successfully by running:

fdisk -l

This will list the current disk partitions:

Attach BuyVM storage slab fdiskI have the 3TB slab listed here as /dev/sda

Now use: fdisk /dev/sda

Then option n (new partition)

Next enter p and press enter (primary partition type)

Then for partition number, first sector and last sector you can press enter for each as the defaults will be fine.

Attach BuyVM storage slab fdisk create partitionThis has now created a disk partition.

As the size of the disk or slab is greater than 2TB fdisk cannot be used to create the actual full partition, for this Parted will be used.

Note: If your storage slab is 2TB or below skip to the “Format the partition” section.

Using parted for GUID partition

If not installed use: sudo apt-get install parted  to install parted.

Select the partition: parted /dev/sda

Then print to see the details:

Attach BuyVM storage slab partedSet the partition table to GPT with: mklabel gpt

Expand the disk with mkpart

Now using mkpart the disk can be expanded to its actual full capacity.

From the screenshot above (output from the parted print command) the max disk size is 3299GB.

mkpart primary 0GB 3299GB will expand the partition to be ~3TB.

Format the partition

Format this newly expanded partition with: mkfs /dev/sda

Mount the disk to a directory

Now to mount the disk:

mkdir /data

mount /dev/sda /data

Adding an entry to fstab

Add this entry into the fstab file to be a permanent disk mount (through restarts):

nano /etc/fstab

/dev/sda /data ext4 defaults 0 0

To check the new disk: df -h

Attach BuyVM storage slab added