Bare metal restore: rebuilding a server from empty disks

A bare metal restore brings a machine from blank disks back to the exact working system it was before, operating system, settings, applications and data included. It is the recovery you need when restoring a few files is not enough.

When do you need a bare metal restore?

Whenever the system itself is gone or cannot be trusted. Both disks of a mirror failing together, a compromised server that must be wiped, a botched upgrade that leaves the machine unbootable, or a move to replacement hardware all call for it. File-level restores assume a working operating system to restore into; a bare metal restore starts with nothing and ends with a server that boots and serves traffic.

What are the two main approaches?

Image-level restore writes back a complete copy of the disks, block for block or partition by partition, including the bootloader. Rebuild-and-restore installs a fresh operating system, applies configuration from automation and then restores application data from backups. On rented hardware the second approach is usually the better fit, because a fresh install from our console is fast and clean, and configuration as code makes the rest repeatable.

ApproachWhat you keepStrengthWatch out for
Disk or partition imageExact copy of every blockRestores undocumented tweaks tooLarge images, hardware differences, copies malware too
File-level system backupAll files plus partition layoutSmaller, can restore to different disksBootloader and RAID must be rebuilt
Rebuild and restore dataAutomation plus data backupsClean, documented, works on any modelEvery manual change must be in code

What must be captured for a full rebuild?

More than the data folders. Record the partition and RAID layout, the list of installed packages, everything under /etc, cron jobs and systemd units, user accounts and SSH keys, TLS certificates and their keys, firewall rules and the exact application versions. A short script that saves these to the backup set each night removes guesswork later.

sfdisk --dump /dev/nvme0n1 > /root/rebuild/nvme0n1.sfdisk
mdadm --detail --scan > /root/rebuild/mdadm.conf
dpkg --get-selections > /root/rebuild/packages.list
nft list ruleset > /root/rebuild/ruleset.nft
tar -czf /root/rebuild/etc-$(date +%F).tgz /etc

On AlmaLinux, Rocky Linux and Fedora, use rpm -qa --qf '%{NAME}\n' | sort in place of the dpkg line.

How does a restore run on one of our machines?

In five steps. First, if hardware failed, the data centre technicians replace the part; if the system is simply broken, skip ahead. Second, reinstall the same operating system from our console with your SSH key. Third, run your configuration playbook or replay the saved package list and configuration. Fourth, restore application data from your backup server and start the services. Fifth, check the service from outside and switch DNS back if you had moved it. For an image restore, boot the machine into rescue mode instead, recreate the partitions from the saved layout and stream the image back over SSH.

sfdisk /dev/nvme0n1 < nvme0n1.sfdisk
ssh bk@203.0.113.40 "cat /srv/images/web02-root.img.zst" | zstd -d | dd of=/dev/md2 bs=4M status=progress

What about the bootloader and RAID?

They need special attention because they live outside normal files. After a file-level or image restore, reassemble the software RAID arrays, update the mdadm configuration, regenerate the initramfs and reinstall the bootloader on every disk of the mirror, so the machine boots whichever disk survives next time. Our guides on Software RAID with mdadm and UEFI boot on software RAID cover both.

How long does a bare metal restore take?

Add the steps up honestly. A reinstall takes minutes, configuration perhaps fifteen, and data restore depends on volume and port speed: 500 GB over a 1 Gbps link needs well over an hour, while a 3 Gbps Business port cuts that to under half an hour. If a new machine has to be ordered, add delivery, usually within 24 hours. Measure the whole chain in a drill; that number belongs in your Writing a disaster recovery plan.

Where should the backups for a restore live?

On a separate server in another data centre, encrypted, with older versions protected from deletion. We do not sell a backup product, so most customers rent a disk server such as STORAGE-1 at $109.80 a month for this role. Data backup and recovery explains retention and testing.

Machines often used to hold restore sets

ModelProcessorCoresMemoryDrivesPortPer month
STORAGE-1AMD Ryzen 7 Pro 3700832 GB2x 480 GB SSD SATA + 4x 14 TB HDD SAS1 Gbps unmetered$109.80
STORAGE-2 2024AMD EPYC 4344P832 GB2x 960 GB SSD NVMe + 2x 22 TB HDD SAS3 Gbps unmetered$187.80
STORAGE-2 2026AMD EPYC 4345P832 GB2x 960 GB SSD NVMe + 2x 24 TB HDD SAS3 Gbps unmetered$273.00
BUSINESS-1 2024AMD EPYC 4244P632 GB2x 960 GB SSD NVMe3 Gbps unmetered$81.60

Related pages

Data backup and recovery

What a backup is and is not, the 3-2-1 rule for rented servers, file and database methods, retention, encryption and proving that a restore works.

Read more

Rescue mode walkthrough

A full rescue session from start to finish: boot the network system, find and mount your drives, repair, chroot in and return to disk boot.

Read more

Software RAID with mdadm

Read, create, monitor and tune Linux software RAID arrays with mdadm: status fields, email alerts, scrubs and the write-intent bitmap.

Read more

Writing a disaster recovery plan

Build a disaster recovery plan that works: inventory, recovery targets per system, standby choices, runbooks, contact lists and tests that prove it.

Read more

Questions and answers

What does bare metal restore mean?

Recovering a complete server, from empty disks to a running system with its operating system, settings, applications and data.

Is an image backup or a rebuild better on rented servers?

A rebuild from a fresh install plus automation and data backups is usually cleaner and works on any model; images suit undocumented legacy systems.

Can I restore an image onto one of your servers?

Yes. Boot into rescue mode, recreate the partitions and stream the image onto the disks, then reinstall the bootloader on each disk.

Do you offer remote console access for restores?

Our servers have no IPMI or KVM console. The console offers reboot, reinstall and rescue boot, which cover restores.

What should I save besides data for a full rebuild?

Partition and RAID layout, package list, /etc, cron and systemd units, users and keys, certificates and firewall rules.