Build an emergency recovery mode for elementary OS
Prepare an emergency recovery mode for elementary OS before a failed update, corrupted bootloader or damaged filesystem turns a routine restart into hours of troubleshooting. The aim is not a magical repair button. It is a short, repeatable route from a blank screen to a working shell, your files and enough information to decide whether the installed system can be repaired.
The most dependable setup combines three layers: a live USB that starts without the installed system, an external backup of personal files, and a known recovery path into the installation. A local Timeshift snapshot or a custom systemd rescue entry adds speed, but neither replaces the live environment or an off-machine backup.
For Australian users, physical separation matters. A Sydney or Melbourne commuter may carry the laptop daily while the spare USB remains at home; Brisbane households may likewise rely on one external drive stored beside the router. Keep two copies in different places, and remember that the Privacy Act 1988 and Australian Privacy Principles may govern personal data held by organisations subject to that legislation, including data copied into backups.
| Recovery method | Best use | Important limitation |
|---|---|---|
| Live USB | Start when the installed system will not boot | Requires a working USB and correct boot selection |
| GRUB rescue target | Reach a root shell when the installed kernel starts | Does not bypass disk encryption |
| Timeshift snapshot | Roll back package or system changes | A snapshot on the same disk may fail with it |
| External file backup | Recover documents and user data | Does not recreate the operating system |
Match the recovery route to the failure
Separate a boot problem from a data problem before touching disks. A blank screen after an update may still allow access through GRUB, while a missing GRUB menu calls for the live USB. A desktop that starts but cannot open a folder may point to a mount, permission or filesystem fault. A deleted file needs a recent backup, not a repair command.
The live environment is the safest place to inspect the installed disk. It leaves the failing system untouched and lets you identify partitions, mount them read-only and copy important files. The GRUB rescue target is useful when the bootloader and kernel remain largely intact, but it can still write to disk unless you take care. Decide which path is appropriate before attempting repairs.
Full-disk encryption is a separate boundary. A rescue target or live session does not remove a LUKS passphrase, and no legitimate recovery shortcut bypasses it. Keep the encryption key somewhere secure, and use the passphrase to unlock the affected volume before attempting filesystem checks.
Prepare and verify a live USB
Download an official elementary OS image on a wired connection, verify its published checksum, and write it to a USB drive with a current disk-imaging tool. A wired connection matters when Wi-Fi drivers are among the reason the installed system will not start. If the official image does not offer a try or live option on your model, use a current Ubuntu LTS live image as the rescue environment; do not start its installer.
Create the USB carefully, because selecting the wrong target can erase a data drive. After writing the image, boot it and choose the live or try option, not “Install”. Confirm that the desktop opens, the keyboard and network work, and a terminal is available. In the live session, lsblk -f should show the internal disk and the USB with their filesystem labels.
Australian electronics shops commonly stock both USB-A and USB-C drives, but adapters are easy to leave behind. Match the connector to the laptop used for recovery, or buy a dual-interface drive, and keep a second tested USB separately. Many commuters carry one drive in a work bag; a second copy at home protects against the loss, theft or accidental formatting that makes the first recovery option unavailable.
Create system and file recovery points
Timeshift is particularly useful for rolling back a bad update, driver or configuration change. Install it from the software repositories, then create a snapshot before making risky changes:
sudo apt update
sudo apt install timeshift
Open Timeshift and select a destination on a separate partition or disk when one is available. Use the snapshot method suited to the filesystem shown by lsblk -f: RSYNC works with ext4, while a Btrfs installation can use native snapshots. If the target is encrypted, keep its unlocking details available. A schedule catches routine changes, but a deliberate snapshot before a kernel or graphics change is still worthwhile.
Timeshift protects the operating system state; it does not replace a file backup. elementary OS includes the Backup application, based on Deja Dup, for documents, browser profiles and other home-directory data. If it is absent, install deja-dup, choose an external drive as the destination, and run a test restore to another folder. Keep the backup destination formatted to a filesystem that can preserve the data you need; ordinary file copying is simpler but may lose Unix ownership or symbolic links.
Backups can contain tax records, client information, health documents and private correspondence. For an organisation covered by the Privacy Act 1988, Australian Privacy Principle 11 requires security controls that are reasonable in context, so the spare backup should be encrypted, access-controlled and stored safely. The same basic precautions are sensible for a household drive left in a vehicle or shared workspace.
Add a permanent GRUB rescue target
First make the boot menu predictable. Open /etc/default/grub, set GRUB_TIMEOUT=5 and GRUB_TIMEOUT_STYLE=menu, then regenerate the configuration:
sudo nano /etc/default/grub
sudo update-grub
If the menu remains hidden, hold Shift from the moment the computer powers on on a traditional BIOS system, or press Escape repeatedly after the firmware screen on a UEFI system. These key presses reach the same GRUB menu and are useful when the permanent entry below is being tested.
Collect the exact kernel filename, initrd filename and root identifier before editing the menu. The current running kernel is usually the one to reference:
uname -r
ls -1 /boot/vmlinuz-* /boot/initrd.img-*
findmnt -no UUID /
Append a menu entry to /etc/grub.d/40_custom, keeping it below the file’s existing exec tail line. Replace both placeholders with values from the previous commands:
menuentry "elementary OS rescue mode" {
linux /boot/vmlinuz-VERSION root=UUID=ROOT-UUID ro systemd.unit=rescue.target systemd.show_status=true
initrd /boot/initrd.img-VERSION
}
Run sudo update-grub, reboot, and select “Advanced options for elementary OS”, then the new rescue entry. The ro option starts the root filesystem read-only; systemd.unit=rescue.target gives a systemd rescue shell with basic diagnostic tools. On LVM, Btrfs or an encrypted-root layout, copy the root= value and any subvolume options from an ordinary generated GRUB entry rather than forcing the simple UUID example.
Recover data from an unbootable installation
Boot the verified live USB and choose the live desktop. Open a terminal and identify devices by size, model and filesystem labels before mounting anything:
lsblk -f
sudo blkid
Never guess a device name. If the root and home partitions are separate, mount them read-only at temporary paths; adjust the device names and omit the second command when /home is not separate:
sudo mkdir -p /mnt/root /mnt/home
sudo mount -o ro /dev/sdX2 /mnt/root
sudo mount -o ro /dev/sdX3 /mnt/home
Mount the external backup drive through the file manager, create a destination folder, and copy the important home directory before attempting repairs. On an ext4-formatted destination, rsync can preserve ownership, permissions, links and extended attributes:
sudo rsync -aHAX --numeric-ids --info=progress2 \
/mnt/home/alice/ /media/liveuser/Recovery/alice/
Replace the source and destination with the mounted paths. If /home was not separate, the source is under /mnt/root/home; if the USB is exFAT or FAT, use the file manager for a straightforward copy, but expect some Unix permissions and links not to survive.
Only after the copy is verified should you attempt a repair, and only on the exact unmounted filesystem. For example, check the root partition with sudo fsck -f /dev/sdX2 after running sudo umount /mnt/root; never run fsck on a mounted filesystem or against an unidentified partition. If lsblk shows crypto_LUKS, unlock it with cryptsetup and the correct passphrase first. If the problem is a missing bootloader rather than data damage, use the live session to mount the EFI system partition and repair it only after identifying the correct disk and partition.
Test and maintain the recovery setup
Test the GRUB entry while the installed system still works. Boot into “elementary OS rescue mode”, run lsblk -f and findmnt, and confirm that the expected partitions are visible without changing their mount state. Leave the rescue shell with exit, then verify a normal boot. This test proves that GRUB can reach the kernel and that the root identifier is correct.
Kernel updates can retire the kernel filename used in a static custom entry. After each significant update, check the version with uname -r, compare it with the VERSION placeholders in /etc/grub.d/40_custom, and run sudo update-grub after any correction. Keep the live image checksum handy and replace the USB drive if it fails to boot or no longer fits the available firmware settings.
Keep the recovery materials realistic rather than decorative: one tested live USB in the daily work bag, a second offline copy at home, a recent file backup, and a current Timeshift point before major changes. The practical takeaway is to rehearse the path quarterly and treat the spare drives, backup destination and rescue entry as one small but complete recovery system.