How to Use Hetzner Rescue Mode: A Step‑by‑Step Guide
Introduction
Whether you need to repair a broken system, recover lost data, or reinstall an operating system, Hetzner Rescue Mode is the safety net that lets you boot a server into a minimal Linux environment with full root access. In this guide we walk beginners through the entire process, from enabling Rescue Mode in the Robot panel to customizing the environment for your specific task.
What Is Hetzner Rescue Mode?
Rescue Mode is a lightweight, network‑bootable Linux distribution (based on Debian) that runs directly on your dedicated server. It disables the regular disks, mounts them read‑only, and provides a set of tools (ssh, mdadm, lvm, gdisk, etc.) so you can:
- Fix a corrupted boot loader.
- Recover files from a failed OS.
- Clone disks or perform low‑level diagnostics.
- Reinstall a fresh OS without losing hardware configuration.
Step 1 – Enable Rescue Mode in the Hetzner Robot
1. Log in to the Robot
Open Hetzner Robot and select the server you want to rescue.
2. Choose “Rescue”
In the left navigation click Rescue. Select the Linux 64‑bit (Debian‑based) image, optionally set a custom kernel, and define a strong root password.
3. Activate
Press Activate Rescue. The panel will reboot the server into the rescue environment within a few minutes. You will receive an email with the temporary SSH credentials.
Step 2 – Connect to the Rescue System
Open a terminal on your local machine and run:
ssh root@your‑server‑ip
Use the password you set in the Robot. Because the rescue system has a clean networking stack, you can immediately start using apt-get, fdisk, rsync, etc.
Step 3 – Customize the Rescue Environment
While the default tools are sufficient for most tasks, you can install additional packages or mount special file systems to suit your needs.
Install Extra Packages
apt-get update apt-get install -y htop lvm2 mdadm smartmontools
Mount Your Disks
The disks are visible as /dev/sdX. To access data, mount them read‑only:
mkdir /mnt/recovery mount -o ro /dev/sda2 /mnt/recovery
If you use LVM, first activate the volume groups:
vgchange -ay mount /dev/mapper/vg0-lv_root /mnt/recovery
Network Tweaks (Optional)
For large uploads/downloads you might want to adjust MTU or enable a proxy. Edit /etc/network/interfaces or use ip link set dev eth0 mtu 9000 for jumbo frames.
Step 4 – Common Rescue Tasks
Repair a Broken GRUB
- Mount the system partitions (as shown above).
- Chroot into the mounted root:
mount --bind /dev /mnt/recovery/dev mount --bind /proc /mnt/recovery/proc mount --bind /sys /mnt/recovery/sys chroot /mnt/recovery /bin/bash
Now reinstall GRUB:
grub-install /dev/sda update-grub
Recover Deleted Files
Install testdisk and run it on the affected partition. The rescue environment’s read‑only mount ensures you don’t overwrite data while scanning.
Clone a Disk
dd if=/dev/sda of=/dev/sdb bs=4M status=progress
Or use rsync for file‑level copies:
rsync -aAXv /mnt/source/ /mnt/destination/
Step 5 – Exit Rescue Mode and Reboot
When you are finished, simply type exit to leave the chroot (if used) and then run:
reboot
Return to the Robot panel, disable Rescue Mode, and choose the normal operating system boot.
FAQ
- Do I lose data when I activate Rescue Mode? No. The rescue system mounts your disks read‑only by default, preserving all data.
- Can I use a custom kernel? Yes. In the Rescue tab you can specify a custom kernel URL or upload a .deb package.
- How long does Rescue Mode stay active? Up to 72 hours after activation. After that the server will boot normally unless you reactivate.
- Is there a size limit for additional packages? The rescue image provides ~2 GB of RAM and a 4 GB disk overlay, enough for most tools. For larger needs, mount an external storage device.
- Can I script the rescue steps? Absolutely. Because you have SSH access, you can run bash scripts or Ansible playbooks directly.
Conclusion
Hetzner Rescue Mode is a powerful, low‑risk way to fix, recover, or reinstall a server without physical access. By following the steps above you can enable the mode, customize the environment, and perform common maintenance tasks confidently.
Ready to get your server back on track? Activate Rescue Mode now and take control of your infrastructure.
Call to Action: Need a hand with a complex migration or a custom script? Contact our support team or schedule a one‑on‑one session today.
Comments are closed, but trackbacks and pingbacks are open.