How to expand storage using Block Storage Volumes

jani3000

New member
Joined
Jun 18, 2020
Messages
1
Location
Slovenia
[NEWBIE] I have a DirectAdmin instance running on a Cloud server with Hetzner. The base specs are as follows:
- 2 vCPU
- 8 GB RAM
- 80 GB Disk space
- 20 TB Traffic

I'm running a small mail server and would care to grow it over time, hence the need for additional storage. Hetzner offers the option of Block Storage Volumes of up to 10 TB/instance and I would like to use it to add additional storage space (for emails mainly) to my existing installation.

Is there a(n easy) way to get the two to work? I'm looking to add additional Volumes based on my needs - an additional 0,5 TB here and there. I'm open to different possibilities as well, of course.

Cheers!
 
You can absolutely do this. There are 3 steps:

1. Format the storage volume
2. Mount it (in fstab to persist on reboot)
3. Set DirectAdmin to handle a new path

I would recommend mounting your volume as /home2 as this is typical and documentation makes more sense (if you're new to it) when you read it from that existing perspective.

After attaching the block storage in their control panel, run "fdisk -l" and look for the volume. You should see it stand out by it's size and having no partitions on it. This may help to better understand how to use/read fdisk: https://www.thegeekdiary.com/understanding-linux-fdisk-utility/

Now, for this guide, let's assume the block storage is /dev/sdb. That's likely not correct, make sure you know which one it is from the fdisk output. But for my example, I'm going to format it:

Code:
mkfs.ext4 /dev/sdb

Next, I'm going to create the home2 folder and set it in fstab, as well as go ahead and mount it now:

Code:
mkdir /home2
echo "/dev/sdb               /home2           ext4    defaults        1 2" >> /etc/fstab
mount /dev/sdb /home2

Finally, you'll follow the DA documentation for setting home2: https://www.directadmin.com/features.php?id=2060
 
mxroute does that mean he will end up with his regular /home and a /home2? And then if he adds more he will have to have /home3? Because I think he would want to add to existing partitions and therefore increase storage. He might be better off using LVM and then he can add storage to existing logical partitions and end up with just a /home.

I don't know anything about Hetzner and Block Storage so I'm just asking questions. Maybe cloud storage works completely differently than normal storage solutions. I'm just trying to understand it,
 
mxroute does that mean he will end up with his regular /home and a /home2? And then if he adds more he will have to have /home3? Because I think he would want to add to existing partitions and therefore increase storage. He might be better off using LVM and then he can add storage to existing logical partitions and end up with just a /home.

I don't know anything about Hetzner and Block Storage so I'm just asking questions. Maybe cloud storage works completely differently than normal storage solutions. I'm just trying to understand it,

Yeah you’d have both, and more if you want to keep adding. I have 4 home directories on my current deployments. The block storage looks just like adding a physical hard drive to the system. It’s connected over network to the host, but the guest has no knowledge of that.
 
Could LVM be used so that the operating system sees it as one partition?
 
Could LVM be used so that the operating system sees it as one partition?

You could. If you did, I'd recommend leaving system root out of it and just using it for /home. Block storage is kind of notorious at all the big providers for occasionally having mild issues, and there's benefit to having the system root functioning even if /home goes down for a bit (exim queue writing and MySQL data).
 
Back
Top