Wiping baremetal server disks

If you ever need to clean the disks on a bare-metal machine running Linux, this is a quick reference on how to do it in our Hetzner environment.

tip

If you are facing an issue and see this error message: Error: Error Message: DetectLinuxOnAnotherDisk failed (permanent error): FAIL: nvme0n1p1 eui.002538bb31006f8f looks like a Linux /boot/efi partition on another disk. , the process described in this page will solve it.

Using The Annotation

The first way to wipe the disks is by using the annotation wipe-disk in the HetznerBareMetalHost object. Servers with this annotation will have the indicated disks wiped the next time it's provisioned.

baremetalhosts.yaml yaml

If you have already added the server to the cluster, you can scale down and up again the associated machine deployment to trigger a reprovisioning.

Otherwise, the server disks will be wiped the next time you perform an update.

warning

In case you are managing your HetznerBareMetalHosts with GitOps, remember to remove the capi.syself.com/wipe-disk annotation from the source, otherwise your servers would be wiped every time they are reprovisioned, leading to potential data loss.

Using The Rescue System

Another way to wipe the disks is by doing it manually using the rescue system.

We recommend using the annotation method, but the manual way is explained here for users in older versions of Autopilot that don't yet support the wipedisk annotation.

Activate Rescue

Access the Hetzner Console and go to the Robot servers.

After selecting the server you want to wipe, go to the Rescue tab, select the appropriate ssh key and keyboard layout, and enable the rescue system.

Now you need to reboot the machine in the Reset tab. To enter the rescue system, only a "Send CTRL+ALT+DEL to server" reset will work. The machine will take a few minutes to become available after the reboot.

Wipe the disks

SSH into the machine using the key you specified in the previous step.

For disks without RAID, do the steps below:

shell

For disks on RAID:

shell

Repeat this process for all disks in the machine as needed.