Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save MahdadGhasemian/6766b9a1bd9868c6ca7b283d63bcb9cb to your computer and use it in GitHub Desktop.
Save MahdadGhasemian/6766b9a1bd9868c6ca7b283d63bcb9cb to your computer and use it in GitHub Desktop.
Determine Available Disk Space on Hetzner Volume (K3S)

This guide will help you determine the available disk space on a Hetzner volume assigned to a K3S node.

1- Find Volume ID

  • Using hcloud CLI:

Run the following command to list your volumes:

hcloud volume list

Example output:

# ID          NAME                                  SIZE    SERVER            LOCATION   AGE
# 100910597   pvc-6ff6af69-3c9d-47d1-xxxx-xxxxxxx   30 GB   k3s-agent-x-xxx   fsn1       14m
  • Using Hetzner UI:

You can also find the volume ID using the Hetzner Cloud UI:

volume-list

2- Find Linux Path of Volume

Use the volume ID to describe the volume and find its Linux device path:

hcloud volume describe 100910597

Example output:

# ID:		100910597
# Name:		pvc-6ff6af69-3c9d-47d1-xxxx-xxxxxxx
# Size:		30 GB
# Linux Device:	/dev/disk/by-id/scsi-0HC_Volume_100910597

3- Run df command via SSH

Use the df command to check the disk space usage. It will connect to your node via SSH and then will run the df command:

ssh root@nodeip df -h /dev/disk/by-id/scsi-0HC_Volume_100910597

Example

$ ssh root@x.x.x.x -i ~/.ssh/id_ed25519_hetzner_cloud -o StrictHostKeyChecking=no -p 22 df -h /dev/disk/by-id/scsi-0HC_Volume_100910597

Example output:

# Filesystem                                  Size  Used   Avail Use%
# /dev/disk/by-id/scsi-0HC_Volume_100910597   30G   5.5G   24G   19%

Security Tips

  • Ensure your SSH keys are securely stored.
  • Use -o StrictHostKeyChecking=yes to avoid man-in-the-middle attacks.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment