Hetzner - DokuWiki

Storage Boxes/en

Inhaltsverzeichnis

Storage Box

Uebersicht StorageBox.png

Storage Boxes from Hetzner Online provide a safe and convenient way to store your data in our German data centers.

With our Storage Boxes, you can access your files at any time and from any place with an internet connection. It is also easy to connect Storage Boxes to your own drive on your PC and to access Storage Boxes with your smartphone and/or tablet. Hetzner Online Storage Boxes work with a variety of standard protocols, which are supported by a wide array of apps.

Various Storage Box classes allow you to choose the storage option that is best for your specific needs. And you can always upgrade or downgrade your Storage Box.

StorageBox Wechsel.png

Reliability

Your files on Storage Boxes are safeguarded with a RAID configuration which can withstand several drive failures. Therefore, there is a relatively small chance of data being lost. Please note, however, that you are responsible for your data and there is no guarantee from Hetzner against potential loss of data. The data is not mirrored onto other servers.

In addition, checksums for the individual data blocks are used to detect and correct bit errors.

Ordering

Storage Boxes can be ordered by using the administration interface Robot or via hetzner.com.

General Information

The speed at which your data can be transferred to your Storage Box is dependent on how many other customers simultaneously attempt to access the same server. If the transfer takes too long, it is best to try to do the upload at another time of day.

It is very important to use the DNS name (<username>.your-storagebox.de) instead of the IP address for your Storage Box; this is because the IP address can change. With the DNS address, you can access your Storage Box via IPv4 and IPv6.

It is not possible to create the directories "/etc" and "/lib" on Storage Boxes.

There is a 10-connection limit on each Storage Box account.

Important reminders

Please note that the executable right is required for the home directory. If you remove the executable right, you will not longer be able to log in.

Please also note that FTP and SAMBA connections may be unencrypted in some circumstances. Some Windows versions and FTP clients, however, use encryption by default. Instructions on how to encrypt your SAMBA connection can be found here.

Using CNAME records for the assigned DNS name does not work with WebDAV.

Before using any of the services listed below, please check your Robot account to see whether or not the setting is activated.

Use Robot to generate the password for your backup account. Robot will only display the generated password once. You cannot use your password for Hetzner Accounts for your backup account.

Access to Storage Box

FTP/FTPS

You can access your Storage Box by using FTP. Please use your assigned hostname (<username>.your-storagebox.de), username, and password. Please note that an FTP connection is unencrypted; only FTPS (FTP+TLS) is encrypted.

If you also plan on using a sub-account on your Storage Box, please make sure to also use the sub-account username for connection.

Active and Passive Modes

FTP protocol is built upon two connections: the first connection, via port 21 for all commands, and the second, for the transfer of all file content. The second connection can be differentiated into active and passive modes.

With the active mode, the ftp server attempts to establish a connection to the client (server -> client). However, this can be blocked with the client's firewall, and a timeout may occur. As a solution to this problem, you can use the passive mode.

With the passive mode, a connection is built from the client to the server (client -> server). The method for activating the passive mode differs between different client programs. For that reason, you should check the help guides of your program.

Instructions

Windows

In Windows, use the following instructions to add your Storage Box as a network address via FTP:

  1. Open Windows Explorer.
  2. Windows 7: On the left, click on "Computer" and then at the top on "Add a network location".
    Windows 8/10: On the left, click on "This PC". Finally, at the top, click on "Computer" and then on "Add a network location".
  3. Now click in the new dialog two times on "Next".
  4. Now enter "ftp://<username>.your-storagebox.de" in the text field and click on "Next".
  5. Unclick "Log in anonymously" and enter the name of your Storage Box.
  6. Click two times on "Next" and then on "Finish".
  7. Enter your username and password in the open window. Alternatively, you can save your password from Windows.
  8. After clicking on "Log on", you will be able to access your Storage Box under "This PC" (Windows 8.1/10) or "Computer" (Windows 7/8).

Software

Please note that this text only addresses a limited selection of software that can be used for this protocol.

Windows

  • Windows Explorer
  • FileZilla
  • WinSCP

Linux

  • FileZilla
  • ftp
  • ncftp
  • lftp

Android

  • AndFTP
  • ES File Explorer

SFTP/SCP

By using SFTP and SCP, you can access your Storage Box. This is completely encrypted.

If you also plan on using a sub-account on your Storage Box, please make sure to also use the sub-account username for the connection.

Authentication Using SSH Keys

If you access your Storage Box by using SFTP/SCP, you can also authenticate yourself with a public key. Further information and an example are available on the following wiki site: Backup Space SSH Keys.

Connection Error

11: Application Error

If you receive this error while connecting via SFTP or SCP, then that is the result of the SSH key forwarding. Please deactivate the forwarding and try again.

Software

Please note that this text only addresses a limited selection of software that can be used for this protocol.

Windows

  • WinSCP (SFTP)
  • FileZilla (SFTP)

Linux

  • scp
  • sftp
  • FileZilla (SFTP)

Android

  • ES File Explorer (SFTP)
  • AndFTP (SFTP)

SAMBA/CIFS

You can link your storage box via Samba/CIFS. You can use the following UNC path.

If you are using your main account, the share name is backup.

If you are using a sub-account, you must use the username of the sub-account as the username and share name.

Linux/Unix:

//<username>.your-storagebox.de/<share_name>

Windows

\\<username>.your-storagebox.de\<share_name>

If you use a FritzBox Router from AVM, it is necessary to deactivate the NetBIOS filter for Samba/CIFS to work. Please see point 4 of https://en.avm.de/service/fritzbox/fritzbox-7330/knowledge-base/publication/show/1083_Cannot-access-FRITZ-Box-home-network-using-port-sharing/ for more information.

Instructions

Linux

In Linux-based systems you can use the following command on the CLI to mount the file system:

mount.cifs -o user=<username>,pass=<password> //<username>.your-storagebox.de/backup /PATH/FOLDER

By adding the following line to /etc/fstab, your system will automatically mount the file system at boot. (It is a single line!):

//<username>.your-storagebox.de/backup /mnt/backup-server cifs iocharset=utf8,rw,credentials=/etc/backup-credentials.txt,uid=,gid=,file_mode=0660,dir_mode=0770 0 0

The file /etc/backup-credentials.txt (mode 0600) should contain two lines as follows:

username=<username>
password=<password>

In Debian-based distributions, the command is provided via the package cifs-utils.

apt-get install cifs-utils

On Debian Wheezy based systems, edit the parameters as follows if you are having problems:

rsize=65536,wsize=130048

You should also add the following lines to /etc/rc.local:

modprobe cifs
echo 0 > /proc/fs/cifs/OplockEnabled

FreeBSD

On FreeBSD, you can mount the storage box as follows:

Add the following line to /etc/fstab

//<username>@<username>/backup /mnt/storagebox smbfs rw,-N 0       0

Replace username with the Robot-assigned username. Also you need to use 'mkdir' to create /mnt/storagebox if it does not already exist.

Add the following lines to /etc/nsmb.conf

[<username>]
charsets=UTF8:cp850
addr=<username>.your-storagebox.de
[<username>:<username>]
password=$crypt-string

Create the crypt-string with 'smbutil crypt'.

In FreeBSD 10.1, the necessary packages are already pre-installed.

Windows

In Windows, use the following instructions to connect your Storage Box as a network drive with its own drive letter:

  1. Open Windows Explorer.
  2. Windows 7: On the left, click on "Computer" and then at the top on "Map network drive".
    Windows 8/10: On the left, click on "This PC". And then at the top click on "Computer" and then on "Map network drive".
  3. In the new dialog, select a network drive letter of your choice and enter \\<username>.your-storagebox.de\backup for the folder. Enter a check next to "Reconnect at login" if you want to automatically establish a connection upon starting the system.
  4. When you are asked for login information, you should here enter the username and password you used for your Storage Box. Optional, you can save the login information in Windows.
  5. The setup of your Storage Box as a network drive is now finished and can be found as separate drive under "This PC" (Windows 8.1/10) or "Computer" (Windows 7/8).

Error with files larger than 4 GB

If there are errors when copying files that are 4 GB or larger, then it can help to deactivate caching. To do so, the storage box must be mounted with the extra parameter '-o cache=none'.

Encrypt SAMBA connection

To encrypt a SAMBA connection, add the following option to your mount command: seal

Example:

mount.cifs -o seal,user=<username>,pass=<password> //<username>.your-storagebox.de/backup /PATH/FOLDER

WebDAV

You can access your Storage Box by using WebDAV; through this connection, it is encrypted.

By default, WebDAV for Storage Boxes is deactivated. You can activate it for free via the Robot. Please note that it can take a few minutes after the activation before your Storage Box will be accessible via WebDAV.

Unfortunately, the WebDAV protocol does not support the output of the available memory and it may produce false values. Please use sftp instead as is described in Determining available memory.

If you are using a sub-account, please make sure to use the sub-account username and link for the connection.

With Windows servers it may be necessary to install the "Desktop View" or "Desktop Experience" feature.

Instructions

Linux

To create a link to the WebDAV directory, use the following command:

mount -t davfs https://<username>.your-storagebox.de /MOUNTPOINT

By adding the following line to /etc/fstab, your system will automatically mount the file system at boot. (It is a single line!):

https://<username>.your-storagebox.de /MOUNTPOINT davfs rw,uid=<system_user>,gid=<system_group>,file_mode=0660,dir_mode=0770 0 0

In order to be able to automatically mount the WebDAV directory, enter the following line in the file /etc/davfs2/secrets:

https://<username>.your-storagebox.de <username> <password>

In Debian-based distributions, the command davfs is provided via a package of the same name:

apt-get install davfs2

Windows

In Windows, use the following instructions to connect to your Storage Box via WebDAV:

  1. Open Windows Explorer.
  2. Windows 7: On the left, click on "Computer" and then at the top on "Map network drive".
    Windows 8/10: On the left, click on "This PC". And then at the top click on "Computer" and then on "Map network drive".
  3. Click on "Connect to a Web site that you can use to store your documents and pictures".
  4. In the new assistent, click on "Next".
  5. Select "Choose a custom network location" and click on "Next".
  6. Under "Internet or network address" enter the address of your Storage Box with the protocol https (For example: https://<username>.your-storagebox.de) and click on "Next".
  7. Now you can assign a new name for the network address under the one that should be visible in Windows. Then, click on "Next".
  8. Now click on "Finish".
  9. Now enter the user name and password of your Storage Box in the login dialog.
  10. The setup of your Storage Box as a network address is now finished and can be found under "This PC" (Windows 8.1/10) or "Computer" (Windows 7/8).

Software

Android

  • ES File Explorer

Errors in Files Larger than 50 MB (Windows)

If you see the following error message during a copying process from Windows to a WebDAV directory, it is likely caused by a file that is larger than 50 MB:

The file size exceeds the limit allowed and cannot be saved.

This is blocked by a security setting in Windows. The following link demonstrates how you can remove this limit: https://support.microsoft.com/en-us/kb/900900

SSH / rsync / BorgBackup

You can access your storage box via an SSH connection to use rsync and BorgBackup there. Use port 23 to access your storage box for this purpose.

To create an SSH connection on your storage box, first activate the SSH support setting for your storage box via the Robot administration interface.

Important note: For SSH key authentication, you must save a public SSH key in normal OpenSSH format on your storage box. Do not save the key in RFC4716 format. For a more detailed guide, please see our Wiki page Backup Space SSH Keys.

Please also note that only the directory /home/ is writable on the storage box. To address directories or files on the storage box, we therefore recommend that you use relative paths. For example, to download the file /server1/full_backup.tar.gz from the storage box, you can use the following file paths:

server1/full_backup.tar.gz
./server1/full_backup.tar.gz

Interactive SSH access is not allowed.

BorgBackup

With BorgBackup, you can save encrypted and duplicate backups of your storage box. You can find a guide for how to do this at BorgBackup.

rsync

You can use rsync to synchronize the current state of your file directories to your storage box. For example, to synchronize a local directory to the storage box, you can use rsync as follows:

rsync --progress -e 'ssh -p23' --recursive <local_directory> <username>@<username>.your-storagebox.de:<target_directory>

To re-download a directory from the storage box, you only need to swap the directories:

rsync --progress -e 'ssh -p23' --recursive <username>@<username>.your-storagebox.de:<remote_directory> <local_directory>

Please note that it is not possible to customize the user and group ID of the uploaded files.

SCP

You can also use SCP via port 23. To upload a file via SCP, you can execute the following command:

scp -P 23 <local_file> <username>@<username>.your-storagebox.de:<remote_file>

To download the file again, you only have to swap the target and source files:

scp -P 23 <username>@<username>.your-storagebox.de:<remote_file> <local_file>

SFTP

Accessing your storage box via SFTP is similar to accessing it with an FTP client. To start an SFTP session, please execute the following command:

sftp -P 23 <username>@<username>.your-storagebox.de

You can then upload files using put and download them using get. With ls you get a directory listing:

sftp> put 100MB.file
Uploading 100MB.file to /home/100MB.file
100MB.file                           100%  100MB  78.7MB/s   00:01
sftp> ls -ahl
drwxr-xr-x    0 12345      12345     16B  Mar 28 10:55 .
dr-x--x--x    0 0          0         10B  Mar 27 12:16 ..
-rw-r--r--    0 12345      12345     100M Mar 28 11:34 100MB.file
sftp> get 100MB.file
Fetching /home/100MB.file to 100MB.file
/home/100MB.file                     100%  100MB 110.6MB/s   00:00
sftp> quit

Determine available disk space

The amount of available disk space can be displayed on Robot. Please note that the usage is updated approximately every 10 minutes.

To determine in a script how much available disk space you have, use the program "sftp" in Linux-based systems:

echo "df"     | sftp <username>@<username>.your-storagebox.de
echo "df -h"  | sftp <username>@<username>.your-storagebox.de
echo "df -hi" | sftp <username>@<username>.your-storagebox.de

Under certain circumstances, lftp can return wrong values; therefore it is better to use the variant with sftp. Below is the variant with lftp:

# apt-get install lftp
# echo du -hs .  \
| lftp -u <username>,<password> BACKUPSERVER

You can also embed the command in Tartarus using a hook. To do this, insert the following lines into the Tartarus configuration:

TARTARUS_POST_PROCESS_HOOK() {
echo "du" | /usr/bin/lftp -u "$STORAGE_FTP_USER,$STORAGE_FTP_PASSWORD" "$STORAGE_FTP_SERVER" | awk -v LIMIT=100 '$2=="." {print ((LIMIT*1024*1024)-$1)/1024 " MiB backup space remaining"}'
}

In order to always get a reliable value, we recommend that you use Robot to display the amount of occupied memory space. You can do this automatically via our Robot Webservice.

Snapshots

Snapshots are full images of a storage box. These can be created via the Robot under Storage Boxes. A snapshot does not need any space when it is created. It grows as files are changed or deleted. No space is required for newly added files in the snapshot. The storage space consumption of the snapshots is calculated with the storage capacity of the storage box.

The storage box can be reset to the state of a snapshot. This restores changed and deleted files, while new files are deleted. Also, all snapshots that are newer than the snapshot which was restored to, are deleted. The restored snapshot and all older ones are retained.

Access to Snapshots

Access to a snapshot is possible via the directory "/.zfs/snapshot" on the storage box, if activated in the Robot. In this directory, there is a subfolder for each snapshot that maps the storage box at the time of the snapshot. Individual files or entire directories can be downloaded as usual. It is not possible to write to the "/.zfs" directory or its subfolder.

Automatic Snapshots

Via the Robot it is possible to automatically create snapshots according to a defined schedule. The schedule can be setup to create daily, weekly, or monthly snapshots. The time, day of the week, and day of the month are freely selectable. When the limit of automatically created snapshots has been reached, the oldest snapshot is automatically deleted to allow a new snapshot to be created. Automatically created snapshots can be accessed just like normal snapshots.

Upgrade and Downgrade

An upgrade or downgrade to another storage box is possible at any time without data loss. The access data remains the same. A downgrade is only possible if less space is used than what would be available after the downgrade.

Additional users / sub-accounts

Additional users can be created for a storage box via Robot. FTP, FTPS, SFTP, SCP, SMB/CIFS, HTTPS, and WebDAV are all available as protocols for these users. Access is only possible to a subdirectory of the main user and uses the storage space of the main user. The main user will have complete access to the directories of all sub-accounts.

Deleting the directory of a sub-account is only possible if the sub-account has first been deleted via Robot.

Furthermore, it is possible to set a sub-account to read-only. No files can be uploaded or deleted. Downloads are still possible.



© 2018. Hetzner Online GmbH. Alle Rechte vorbehalten.