Development

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.

Then check it was attached successfully by running:

fdisk -l

This will list the current disk partitions:

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

This 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:

Set 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

 

 

 

Share

Recent Posts

Kennington reservoir drained drone images

A drained and empty Kennington reservoir images from a drone in early July 2024. The…

1 year ago

Merrimu Reservoir drone images

Merrimu Reservoir from drone. Click images to view larger.

1 year ago

FTP getting array of file details such as size using PHP

Using FTP and PHP to get an array of file details such as size and…

2 years ago

Creating Laravel form requests

Creating and using Laravel form requests to create cleaner code, separation and reusability for your…

2 years ago

Improving the default Laravel login and register views

Improving the default Laravel login and register views in such a simple manner but making…

2 years ago

Laravel validation for checking if value exists in the database

Laravel validation for checking if a field value exists in the database. The validation rule…

2 years ago