Vultr has a generous disk quota with the cloud servers you can set up. But what do you do when you want more space than the default allocation (for backup or application data)?
I have blogged before about setting up an Ubuntu server on the cloud on Vultr and configuring it if you do not already have a cloud server.
Vultr allows you to set up a server in minutes.
A Vultr $2.5 a month server comes with 20GB storage, a $20 a month server comes with 60GB of SSD storage.
Vultr does offer more storage for about 0.10c per GB. At this time or writing Vultr allows you to add more storage to serves in NY/NJ (only). Read my guide on moving data between servers with RSync. And cond forget yo secure your server with a free SSL certificate and secure it (read more here and here).
An additional 10GB of storage would cost $1/m.
An additional 50GB of storage would cost $5/m.
An additional 100GB of storage would cost $10/m.
An additional 250 GB of storage would cost $25/m
View the Vultr pricing calculator here. Vultr does say that you can resize your block storage volume but there are manual actions and risks involved so get the space you need early on and prevent resizing later.
Vultr did offer early customers in (limited location’s) a free 50GB storage (read more on these limits here).
I am going to spin up a Block storage and attach to my server in Sydney.
fyi: Read the official guide on Attacking Block Storage to a Vultr server.
2. Click Add Block Storage
3. Choose the size of your block storage volume.
Darn, I can’t choose Syndey yet as a location to create a block storage volume (I have asked Vultr when we can) so I’ll continue this guide with my existing (free) 50GB volume in New Jersey) and mount it in a server in NY/NJ (and also Syndey).
It appears I can’t connect to a Block Storage volume outside the block storages location (data centre).
You will need to attach the block storage volume to the server at that data centre location or you will get this error when you try and connect to it later.
In my case, the server did not automatically restart so I manually restarted it.
Connecting the Block Storage to your VM
FYI: You can only connect to block storage from the same location (one server at a time I’d imagine).
4. From the Vultr Admin panel SSH into the server (in the same location). See my guide here on setting up a Vultr server and configuring it.
Vultr say’s “Block storage is connected to your server as /dev/vdb. We do not create any filesystems on it by default.” Official Block storage documentation is located here.
5. Run the commands listed in the Block Storage screen (above)
Error: In my case, the echo command failed to add to configuration to the /etc/fstab file (even with sudo) and the mount command failed?
I checked the /etc/fstab file contents
I manually edited the /etc/fstab file and added the mount point configuration as suggested by Vultr.
6. I re-ran the mount command
sudo mount /mnt/blockstorage #
I can now directory list in the block storage volume.
ls /dev/vdb1 -al brw-rw---- 1 username disk 253, 17 Nov 7 21:18 /dev/vdb1
Now let’s attach it to another folder in the root folder (e.g /data)
First, unmount the volume
Edit the /etc/fstab file with sudo nano
Change the mount point somewhere else (e.g /data)
Make a folder in the new path (/data), If you don’t do this the mount will fail.
Remount the volume (but use the new path)
sudo mount /data
You can now use the path and new storage.
cd /data mkdir /data/test cd /data/test pwd # /data/test/ sudo nano /data/test/test.txt
Disposing of Block Storage
TIP: Move or backup any data before you destroy or detach the volume.
First, you will need to unmount the volume (SSH session with your server).
Then remove the entry from the /etc/fstab file
Then you can navigate to the https://my.vultr.com/blockstorage/ and edit the said block storage volume and detach the volume (this will cause the server to reboot).
After a few minutes you can delete the volume from the edited Block Storage Volume page (click the Trashcan up the upper right).
Done, You can now add and remove Block Storage volumes on Vultr.
How to check the disk usage of the block storage volume
You may need to remind yourself of the block storage volume (cat the /etc/fstab file and view the drive information on the mount line).
cat /etc/fstab # .. /dev/vdb1 ..
How much space is used/free
df -h /dev/vdb1 Filesystem Size Used Avail Use% Mounted on /dev/vdb1 50G 52M 47G 1% /data
You can also show the usage information in that mounted folder
du -xsch /data 10G /folder1 10G /folder2 20G total
Use the pydf tool to view mounted partitions
- You need to attach the block storage volume and reboot in the Vultr admin panel before mounting.
- The echo command (as documented by Vultr) may not add information to the /etc/fstab file (a manual edit will work).
How to Resize a Block Storage Volume on Vultr.
Coming soon (if requested below).
Donate and make this blog better
Ask a question or recommend an article
[contact-form-7 id=”30″ title=”Ask a Question”]
v1.2 added disk usage information