Home Scroll Top Categories

How to Add a Hetzner StorageBox to Proxmox with SMB/CIFS

Adding a basic Hetzner Storage Box to your online or local Proxmox Installation. (also works with clusters).

Introduction

Hetzner sell relatively cheap storage called Storage Boxes which can be extremely useful for storing your iso files or even backups if your internet has enough upload bandwidth. Currently, 1TB storage costs around 4 euros.

The whole process of connecting the storage box is not as you would expect. Personally i expected just to buy the box, enable SMB then add the SMB share in the Proxmox GUI. Obviously, this is Linux were talking about, nothing ever goes the right way the first time unless you are an absolute guru.

Here’s the instructions to get your storage visible in the proxmox GUI. If you do not have a storage box yet read on. If you have already purchased your storage box skip to connecting to your Storage Box.

Getting a Storage Box

While logged into Hetzner go to the “Robot” tab on the top right

Now go to the ordering tab on the bottom left

Here you should be able to scroll down and find storage boxes

Pick the size you want and then order and your storage box will be delivered to you within a few minutes by email.

The login will look something like u253463 and the password may need to be reset. A new password will be displayed on the screen. Take note because you will not be able to recover it but you can always reset it.

Connecting to your StorageBox

Your details will be in the following format

Current product:	BX11
Server:	u322720.your-storagebox.de
Host System:	FSN1-BX147
User name:	u322714
Samba/CIFS share:	//u322720.your-storagebox.de/backup

As stated earlier its not as easy as “just adding it through GUI”.

First, we need to access our Proxmox server via ssh.

ssh [email protected]

Creating Mount Folder

We need to create a folder to mount the storage to.

I have chosen /mnt/pve/sb.

Create the folder

cd ../
mkdir -p mnt/pve/sb

Editing fstab file

We need to tell Proxmox about the storage and make sure it gets mounted on every boot. To do that we edit the /etc/fstab file.

In the Proxmox terminal type the following

nano /etc/fstab

Ignore all the entries and go to a new line at the bottom

Add the storage details here as follows this is one line

//u322723.your-storagebox.de/backup /mnt/pve/sb cifs iocharset=utf8,rw,credentials=/etc/storagebox-credentials.txt,file_mode=0660,dir_mode=0770 0 0

Here is what each part means

  • /mnt/pve/sb = the mount point we are mounting our storage to
  • /etc/storagebox-credentials.txt = StorageBox credentials txt file
  • u322723.your-storagebox.de/backup your main login location

Once you have added the line use CTRL+X then y to save.

Credentials

Create a txt file with the StorageBox credentials.

First enter /etc and create the file

cd /etc
nano storagebox-credentials.txt

Enter the username and password in the following format

username=u322723
password=8mLf6DQ1fVmPCFcZ

Save the file CTRL+X then y.

Set the permissions on the file

chmod 0600 /etc/storagebox-credentials.txt

We can mount and check to see if the mount has worked, type

mount -a

If you get no errors, everything is good and you can use df -H to check the storage has mounted.

mounted storage in folder

Reboot Proxmox and then we can add the directory.

reboot

Adding Directory in Proxmox

We can now add the storage as a directory in Proxmox.

Click Datacenter > Storage > Add > Directory in the Proxmox GUI.

Add the directory as you would any other.

Make sure to disable containers and disk images because we don’t want to actually create the virtual machines or containers on there.

Complete!

You should now have your StorageBox enabled in your Proxmox server! 🎉

Clusters

If you are using a cluster the storage will show on all nodes but only the node that has had the /etc/fstab file edited and the storagebox-credentials.txt created.

Simply repeat the process on all nodes to make sure they all sync and access the same storagebox.