Forest OS

A free and open source operating system, written from scratch. A Bluethefox project, hosted by Enclica.

← Back to Wiki

Backup Before Installing

forinstall erases the target disk. Back up before you boot the installer — after the confirm screen there is no undo.

DATA DESTROYED warning: the forinstall confirm screen wipes partitions, filesystems, and bootloader sectors on the selected target disk. If your files exist only on that disk, they are gone. Complete this page first.

Install series: Overview · Requirements · Quick-Start · Backup · Partitioning · BIOS · UEFI · First Boot

What to Save

Back up the whole machine you are installing on, not just one folder:

  • Documents, photos, downloads — anything in Documents/, Downloads/, Pictures/, Desktop.
  • /home — all user homes (/home/<user>/). Easiest is to archive the whole tree.
  • Keys and credentials~/.ssh/, ~/.gnupg/, password-manager vaults, Wi-Fi passwords, license keys, 2FA recovery codes.
  • Browser profiles — bookmarks, passwords, extensions (~/.mozilla/, ~/.config/google-chrome/, ~/.config/chromium/).
  • App config and mail~/.config/, ~/.local/share/, Thunderbird/Outlook data files (~/.thunderbird/), project dirs outside /home.
  • Partition table — dump it so you can rebuild the old layout if you abort:
    sudo sfdisk -d /dev/sda > ~/backup-$(hostname)-$(date +%F)/sda-partition-table.dump
    cat ~/backup-$(hostname)-$(date +%F)/sda-partition-table.dump
  • MBR (first 512 bytes) — one-sector image for MBR/BIOS disks:
    sudo dd if=/dev/sda of=~/backup-$(hostname)-$(date +%F)/sda-mbr.img bs=512 count=1 status=progress
    ls -l ~/backup-$(hostname)-$(date +%F)/sda-mbr.img  # must be exactly 512 bytes

On UEFI/GPT disks also save the GPT backup header (sgdisk -b if available) alongside the sfdisk dump.

Where to Save It

  • Use a second USB stick or external disk — never the Forest OS install USB, never the target internal disk.
  • Label it (e.g. BACKUP-2026-09-05) and keep it unplugged during install so forinstall / dd cannot select it as a target.
  • Keep at least one copy off the machine (second drive, NAS, cloud). One copy on the desk next to the machine is zero copies during a disk wipe.

How to Back Up (Examples)

Run from your current OS (Linux examples; adjust /dev/sdX after checking lsblk):

# 0. Identify disks — never guess. BACKUP_DEV is the external disk.
lsblk -d -o NAME,SIZE,MODEL,TRAN
BACKUP_DEV=/dev/sdX   # <-- your EXTERNAL disk, e.g. /dev/sdb1 mounted at /mnt/backup
SRC_HOME=/home

sudo mkdir -p /mnt/backup
sudo mount "$BACKUP_DEV" /mnt/backup

# 1. Full /home archive (preserves permissions, symlinks)
sudo tar -czpf /mnt/backup/home-full-$(date +%F).tar.gz -C / "$SRC_HOME"
# or per-user:
sudo tar -czpf /mnt/backup/home-alice-$(date +%F).tar.gz -C /home alice

# 2. Keys + browser profiles + config (small, copy verbatim with cp -a)
mkdir -p /mnt/backup/dotfiles
sudo cp -a /home/alice/.ssh /home/alice/.gnupg /mnt/backup/dotfiles/
sudo cp -a /home/alice/.mozilla /home/alice/.config/google-chrome /home/alice/.config/chromium /mnt/backup/dotfiles/ 2>/dev/null; true
sudo cp -a /home/alice/.thunderbird /mnt/backup/dotfiles/ 2>/dev/null; true

# 3. Partition table + MBR of the future install target (here /dev/sda)
sudo sfdisk -d /dev/sda > /mnt/backup/sda-partition-table.dump
sudo dd if=/dev/sda of=/mnt/backup/sda-mbr.img bs=512 count=1 status=progress

# 4. Checksums so you can prove the backup is intact later
(cd /mnt/backup && sha256sum * > SHA256SUMS && cat SHA256SUMS)

sync
sudo umount /mnt/backup

Restore examples (test on a scratch machine, not the install target):

sudo mount /dev/sdX /mnt/backup
cd /mnt/backup && sha256sum -c SHA256SUMS
sudo tar -tzf home-full-2026-09-05.tar.gz | head        # list without extracting
sudo tar -xzpf home-full-2026-09-05.tar.gz -C /tmp/restore-test/
diff -r /tmp/restore-test/home/alice/Documents ~/Documents  # spot-check

Verify Restores

A backup you have not test-restored is a rumor:

  1. sha256sum -c SHA256SUMS on the external disk — must report OK for every file.
  2. tar -tzf <archive>.tar.gz > /dev/null — must exit 0 (no corruption).
  3. Extract to /tmp/restore-test/ and open a few documents, import one SSH key (ssh-keygen -y -f restored-key), launch a copied browser profile on another machine.
  4. Confirm the partition dump is readable: cat sda-partition-table.dump shows partition lines; ls -l sda-mbr.img is 512 bytes.
  5. Only then unplug the backup disk and start the installer.

forupdate / /boot/backup Note

  • forupdate (upgrades of an already installed Forest OS) automatically backs up the running system to /boot/backup/v<major>.<minor>.<patch>/ (forest-kernel, forest-initrd, plus best-effort forest-version, forest-hostname, forest-network) and keeps the newest 3. See System Tools.
  • That is not a substitute for this page: it lives on the same disk forinstall wipes, it covers only boot files (not /home, keys, or browser profiles), and a fresh forinstall destroys it. Keep your personal backup on the external disk regardless.

Checklist Before the forinstall Confirm Screen

Do not press confirm until every box is checked:

  • External backup disk contains: /home tarball, keys (~/.ssh, ~/.gnupg), browser profiles, sfdisk -d dump, MBR dd bs=512 count=1 image, SHA256SUMS.
  • sha256sum -c passes and a test extract to /tmp/restore-test/ opens correctly.
  • Backup disk is unplugged (or at minimum unmounted) so it cannot be picked as the install target.
  • lsblk / fdisk -l identifies source (install USB) vs target (internal disk) by size/model — target device name written down.
  • You have read the DATA DESTROYED warning on the confirm screen and accept that all partitions and data on the target disk will be erased.
  • Power is stable (AC plugged in, no dead battery) and you know which guide is next: Partitioning, BIOS / UEFI install guide, First-Boot.

See Also

← Back to Wiki