This is an old revision of the document!
How to set up your Storage Slab
BuyVM offers storage slabs for all KVM Slice customers in all locations.
Storage slabs cost $5 per TB and are running on enterprise 7200RPM hard drives with an NVME cache. A storage slab is simply like an extra hard drive for your KVM Slice.
WARNING, please make sure you follow this guide correctly or you risk wiping your boot drive.
Step 1) Attach the slab to your desired KVM slice in the Storage Volumes section in Stallion.
Step 2) Run fdisk -l
to find out what the device path is for the slab you've just attached.
$ sudo fdisk -l Disk /dev/vda: 20 GiB, 21474836480 bytes, 41943040 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x19ed42f3 Device Boot Start End Sectors Size Id Type /dev/vda1 * 2048 39843455 39841408 19G 83 Linux /dev/vda2 39843456 41940607 2097152 1G 82 Linux swap / Solaris Disk /dev/sda: 256 GiB, 274877906944 bytes, 536870912 sectors Disk model: SLAB Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x716cfadf
In this case, there are 2 drives. One of them is the boot drive which is usually /dev/vda
. This is not the device we are looking for. What we're looking for is the newly attached slab's device path. You can usually tell which disk it is because every slab's Disk Model is “SLAB”. In this case, the device path is /dev/sda.
Step 3) Now, you need to create a partition on your slab. Run sudo fdisk /dev/sda
to use the fdisk partitioner on /dev/sda.
Welcome to fdisk (util-linux 2.33.1). Changes will remain in memory only, until you decide to write them. Be careful before using the write command. Command (m for help):
Type the letter g to create a new GPT partition table.
Type the letter n to create a new partition. Use the default partition letter and sectors by pressing enter.
You can now quit fdisk by typing the letter w to write the new changes to the slab and quit.
$ sudo fdisk /dev/sda Welcome to fdisk (util-linux 2.33.1). Changes will remain in memory only, until you decide to write them. Be careful before using the write command. Command (m for help): g Created a new GPT disklabel (GUID: ECA757E9-5304-594C-A9CA-17E061B2E516). The old dos signature will be removed by a write command. Command (m for help): n Partition number (1-128, default 1): 1 First sector (2048-536870878, default 2048): 2048 Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-536870878, default 536870878): 536870878 # Set this to your own default by pressing enter. Created a new partition 1 of type 'Linux filesystem' and of size 256 GiB. Command (m for help): w
Step 4) Run fdisk -l again to see the new partition you just created (/dev/sda1
).
$ fdisk -l [... your boot drive ...] Disk /dev/sda: 256 GiB, 274877906944 bytes, 536870912 sectors Disk model: SLAB Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x716cfadf Device Boot Start End Sectors Size Id Type /dev/sda1 2048 536870911 536868864 256G 83 Linux
Step 5) Now, you need to format the slab to have an actual filesystem. The most common filesystem is ext4 so we will be using that in this guide. To create an ext4 filesystem on your slab, run
mkfs.ext4 /dev/sda1
This might take a few seconds depending on the size of your slab.
Step 6) Now you are going to prepare to mount the slab. To do this, you're going to need to run a few commands to figure out the UUID of the device.
First, you need to determine the slab's UUID. You can do that by running:
blkid
In this case, the device you're looking for is /dev/sda1. The line should look like:
/dev/sda1: UUID="1cb43a43-105c-46f1-9d7f-1c736c10ffdf" TYPE="ext4"
Now, you're going to add the slab's UUID to /etc/fstab
so your slab will automatically mount when your server is booted. Open up /etc/fstab
with your favorite text editor. At the end of the file, you will need to add the following line:
UUID=1cb43a43-105c-46f1-9d7f-1c736c10ffdf /mnt/slab ext4 defaults 0 0
This tells the system that /dev/sda1
(1cb43a43-105c-46f1-9d7f-1c736c10ffdf
) should be mounted at /mnt/slab
. You can change /mnt/slab
to another directory if you'd like.
# /etc/fstab: static file system information. # # Use 'blkid' to print the universally unique identifier for a # device; this may be used with UUID= as a more robust way to name devices # that works even if disks are added and removed. See fstab(5). # # <file system> <mount point> <type> <options> <dump> <pass> # / was on /dev/vda1 during installation UUID=813b9d75-c617-4db0-b0f2-6758d17b31f4 / ext4 errors=remount-ro 0 1 # swap was on /dev/vda2 during installation UUID=a1103972-6b3e-49d1-ac18-d6bf16ea0f68 none swap sw 0 0 #SLAB UUID=1cb43a43-105c-46f1-9d7f-1c736c10ffdf /mnt/slab ext4 defaults 0 0
Step 7) Creating the mount point
You're almost there! One of the last things you need to do is create the mount point. In this guide, /mnt/slab
is being used as the mount point. So, run:
mkdir /mnt/slab/
This will create the directory for the slab to be mounted at and it will be the path you use to access the slab.
Step 8) Mounting the Slab!
mount -a
This will mount the device you just added in /etc/fstab at /mnt/slab/. You can check out the newly mounted slab with df -h
.
$ df -h Filesystem Size Used Avail Use% Mounted on [...] /dev/sda1 251G 81M 250G 1% /mnt/slab [...]