Mounting Extra Block Storage (in my case it’s buyvm)

This is a simple guide for mounting external block storage. I am using webdock and buyvm service and both are really great so far. However most block storage required self mounting. In my case, webdock done my 50GB mount for me, as they are always ready to help. However buyvm while having great service as well, is a true unmanaged which require some DIY. Luckily, its not hard at all.

 

First, attached the storage to the vps. Each provider does this differently but the option must be there in the vps panel. otherwise, rise a ticket and ask.

 

Next, ssh into the vps, and check if the disk is mounted wit the command

fdisk -l

it should return the result of your current mount disk. The extra block storage should be there if successfully attached to your vps.

Next we will need to get the disk id with the command

ls /dev/disk/by-id/

and the result, in my case is

ata-QEMU_DVD-ROM_QM***** scsi-0BUYVM_SLAB_VOLUME-****

It clearly stated the second drive is the slab volume.

Now we will need to format the disk

mkfs.ext4 -F /dev/disk/by-id/scsi-0BUYVM_SLAB_VOLUME-****

Next we will make the mounting directory, and subsequently mount the slab to the directory, and make an entry in /etc/fstab to have the storage mounted everytime the system reboot.

mkdir -p /yourpreferdir

 

mount -o discard,defaults /dev/disk/by-id/scsi-0BUYVM_SLAB_VOLUME-**** /home/yourpreferdir

 

echo ‘/dev/disk/by-id/scsi-0BUYVM_SLAB_VOLUME-****/home/yourpreferdirext4 defaults,nofail,discard 0 0′ | tee -a /etc/fstab

and if all goes well with no error, reboot your system and check df to see your mount is up and running