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.

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
lsblk # List the disks wipefs -af /dev/sdx # Wipe the "sdx" disk, where sdx is the label of the disk, listed with lsblk. Most frequently will be in the sdX or nvmeXnY format.

For disks on RAID:

shell
lsblk # List the disks mdadm --stop /dev/sdx # Stop RAID wipefs -af /dev/sdx # Wipe the "sdx" disk, where sdx is the label of the disk, listed with lsblk. Most frequently will be in the sdX or nvmeXnY format.

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

Previous
Baremetal Servers Rescue Mode
Next
DetectLinuxOnAnotherDisk failed in HetznerBareMetalHosts