This is an old revision of the document!
How to setup 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 lots of NVME cache.
A storage slab is simply like a extra “hard drive” for your KVM Slice that runs on a different partition.
This guide will help you setup your Storage Slab.
Warning, make sure you follow this correctly or you could risk wiping your boot drive.
Step 1) Enable the slab in the Storage Volumes section on the Stallion.
Step 2) Run fdisk -l to find out what the file system is for that slab.
$ 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 Device Boot Start End Sectors Size Id Type
You should see your boot drive, which we don't have to touch. We want to find the slabs filesystem. For example, on my VPS the filesystem is /dev/sda. You can tell because it shows the disk model as “SLAB” or has 256GB of storage.
Step 3) Run
$ sudo fdisk /dev/sda # or whatever filesystem your slab is in 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):
Step 4) Type the letter g to create a new GPT partition table.
Step 5) Type the letter n to create a new partition. Use the default partition letter and sectors by pressing enter.
Step 6) 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 7) Run fdisk -l again to see what the new partition is.
$ 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 Device Boot Start End Sectors Size Id Type /dev/sda1 2048 536870911 536868864 256G 83 Linux
You should be able to see a new partition on the bottom. We want to keep note of the device, for example, mine is /dev/sda1.
Step 8) Now we can mount the slab. Either run
sudo mount /dev/sda1 /mnt/slab # FOR TEMPORARY MOUNT
or edit /etc/fstab with your favorite text editor for permanent mount.
# /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 # Your slab goes here, as always replace /dev/sda1 with your slabs filesystem. /dev/sda1 /mnt/slab ext4 defaults 0 0
Step 9) Run
mkfs.ext4 /dev/sda1 (or whatever your slab is)
This will format the drive and make it EXT4
Step 10) Run df -h to check if the drive has been correctly formatted. If it has you should be able to see your slab. It will say 0G used for you, but I'm already using my slab.
$ df -h Filesystem Size Used Avail Use% Mounted on udev 474M 0 474M 0% /dev tmpfs 98M 11M 88M 11% /run /dev/vda1 19G 16G 2.4G 87% / tmpfs 490M 0 490M 0% /dev/shm tmpfs 5.0M 0 5.0M 0% /run/lock tmpfs 490M 0 490M 0% /sys/fs/cgroup /dev/sda1 251G 221G 18G 93% /mnt/slab tmpfs 98M 4.0K 98M 1% /run/user/0
You can now use your slab for whatever you'd like! Such as storing backups or many other things!