---
title: 'Rebuilding a Linux box with nobody at the keyboard'
canonical: 'https://www.dealmobile.co.uk/writing/rebuilding-a-linux-box-with-nobody-at-the-keyboard'
url: 'https://www.dealmobile.co.uk/writing/rebuilding-a-linux-box-with-nobody-at-the-keyboard'
type: Post
published: '2026-11-22'
summary: 'Ubuntu 26.04 installed overnight on my home Linux box with no USB stick: the old system booted the installer ISO from its own disk, the answers came over HTTP from my other box, and it took three goes.'
---

# Rebuilding a Linux box with nobody at the keyboard

Published 2026-11-22

![A text card listing the stages of the rebuild in order: check the image against signed checksums, serve the answers from the other box, boot the installer from the old system’s own disk, install Ubuntu 26.04 on the second disk, match the other box with 171 packages and a 243 GB home folder, then compare the two.](https://www.dealmobile.co.uk/sites/default/files/styles/almanac_shot_md/public/content/images/posts/rebuilding-a-linux-box-with-nobody-at-the-keyboard/hero.png.webp?itok=_EqL8bNL)

My home Linux box went from Ubuntu 22.04 to a fresh 26.04 overnight with no USB stick and nobody sitting at it. The old system booted the official installer ISO from its own disk, the installer fetched its answers over HTTP from my other box, and it installed onto the machine’s second NVMe drive. The old system is still on the first one.

I didn’t want a copy of the other box’s system. I wanted a real Ubuntu install, then the packages, settings and data brought across, so nothing on the new system is there because the old one happened to have it.

## Before anything was wiped

The second drive held storage, so that went first: 388,212 files copied onto the main disk and checked with `sha256sum -c`, no failures, and an `rsync --checksum` dry run over the rest that listed nothing different.

The ISO was checked against Ubuntu’s signed checksums before it went anywhere near GRUB:

```bash
gpgv --keyring /usr/share/keyrings/ubuntu-archive-keyring.gpg SHA256SUMS.gpg SHA256SUMS
sha256sum -c --ignore-missing SHA256SUMS

```

## Booting the installer without a stick

GRUB can loop-mount an ISO and boot the kernel inside it. One entry in `/etc/grub.d/40_custom` on the old system:

```
menuentry "Ubuntu 26.04 autoinstall" {
    loopback loop /ubuntu-server.iso
    linux (loop)/casper/vmlinuz iso-scan/filename=/ubuntu-server.iso ip=dhcp autoinstall "ds=nocloud;s=http://OTHER_BOX:PORT/" ---
    initrd (loop)/casper/initrd
}

```

With `GRUB_DEFAULT=saved`, `grub-reboot "Ubuntu 26.04 autoinstall"` boots that entry once, and the boot after it goes back to the old system.

`ds=nocloud;s=` points the installer at a folder served by `python3 -m http.server` on the other box, holding `user-data` and `meta-data`. The answers file picks the target disk by its serial number, so it can’t choose the wrong drive, and lays out the same partitions as the other box: root, home and `/data`.

## Three goes

The first stopped before it touched a disk, with “Malformed autoinstall in ‘late-commands’ section”. One late command had a colon followed by a space in it, unquoted, and YAML read the line as a mapping. Every item in that list has to come out of `yaml.safe_load` as a string, which takes one line of Python to test before serving the file.

The second got as far as partitioning and writing the base system, and then the machine was hard-rebooted in the middle of it. The old system came up as if nothing had happened, because nothing had happened to its disk. `grub-reboot` again.

The third fetched its answers at 03:23 and installed everything, then failed on a late command that mounted the old root partition read-only: exit 32, “would change RO state”. The ISO had been loop-booted from that partition, so the live system already had it mounted read-write out of sight. A plain `mount` works. I finished the last few steps by hand from the installer’s error shell over ssh and rebooted into the new system.

Two things were wrong on first boot. The home folder was owned by root and empty, because the installer mounts the home partition over it before it creates the user. And the server installer sets the network up with systemd-networkd where my other box uses NetworkManager. I switched it over ssh with a three-minute `systemd-run` timer armed to put the old config back, and cancelled the timer when the connection came back.

## Matching the other box

A script on the new system pulled from the other one: its apt sources, its manually installed packages (171 to install), its snaps, a list of files under `/etc`, the three local `.deb`s rebuilt with `dpkg-repack`, and the services it has enabled. The home folder was 243 GB and the archive under `/data` another 475 GB.

The server ISO leaves things a desktop doesn’t want, so `needrestart`, `landscape-common`, `lxd-installer`, `ubuntu-server` and six more came off. That exposed a trap. `tmux`, `htop`, `git`, `curl`, `vim`, `ufw` and 30 others were marked as automatically installed on the new box and manual on the old one, so the next `apt autoremove` would have taken them. The script now marks manual whatever the source has manual.

The Wi-Fi came from the old disk: 33 profiles copied out of its `/etc/NetworkManager/system-connections/`. So did Bluetooth. It’s the same adapter, so copying `/var/lib/bluetooth/<adapter>/` with `bluetoothd` stopped brought all 10 pairings back without re-pairing anything.

After that every package on the box I carry was on the home one at the same version, with the same kernel and the same snaps. The final reboot was at 08:04. It came back in under a minute and `systemctl --failed` was empty.

The 22.04 system is still on the first drive, mounted under `/mnt` on the new one.

- **Tags:** [Linux](https://www.dealmobile.co.uk/writing/tag/linux.md), [Security](https://www.dealmobile.co.uk/writing/tag/security.md)

---

Index of this site: [llms.txt](https://www.dealmobile.co.uk/llms.txt)
