11. Updates, backups and the read-only filesystem¶
Three maintenance jobs — update, upgrade, back up — and one design decision that makes all three easier: the filesystem that barely ever changes.
The read-only design, from the evidence¶
Chapter 4 quoted the shipped /etc/fstab. Read it as a design
statement:
/mounts read-only (ext4 defaults,noatime,ro), and so does/boot/firmware.- Everything that genuinely must change at runtime is a small
tmpfs in RAM:
/run,/tmp,/var/log(capped at 64 MB), PHP sessions, DHCP state, Samba scratch — a dozen little scratch spaces, each size-capped. - When Pi-Star needs to write configuration, it remounts the root writable for the moment of writing, then returns it to read-only — that's why applying changes makes the box pause and why the dashboard warns you to wait for it.
Consequences worth understanding:
- The card barely wears and rarely corrupts. Nothing writes to flash in normal operation, so the classic Pi failure — SD card killed by logs and swap — is designed out. Pull the power and the system on the card is exactly as it was.
- Logs are volatile.
/var/logis RAM. A reboot wipes the evidence, so the live modem log (chapter 8) is a now tool, and the daily housekeeping (the image carriespistar-daily.cron,pistar-hourly.cron, and theHostFilesUpdate.shthat refreshes the callsign/host databases) works against that rhythm. - "It forgot my setting" almost always means an edit was made somewhere the read-only remount didn't cover — use the dashboard and its Apply Changes rather than editing files over SSH by hand, or learn the remount dance properly from the project's docs before improvising.
Update versus upgrade¶
Pi-Star separates two verbs, on the dashboard's Admin → Update
page and as SSH commands for user pi-star:
- Update (
pistar-update) — the routine run: operating-system packages plus the Pi-Star components themselves. Chapter 4 read the script: it checks the components' git folders against their upstream remotes and pulls what's new — the dashboard, the binaries, the host files. This is the one to run regularly (there's also the daily cron doing host-file duty). - Upgrade (
pistar-upgrade) — the version step: 4.2.x to 4.3.x style moves, within the release train the project's changelog marks "available for upgrade". Run it when the changelog offers your line an upgrade, after a backup (below), and expect it to take longer. - Major moves beyond that (the changelog's new-image releases) are a re-flash: new image on the card, then restore your backup zip and you're home. Which is the other reason the backup matters.
Backups: the zip that rebuilds you¶
Admin → Backup/Restore (config_backup.php) offers Download
Configuration: a zip of everything that makes this hotspot
yours — the /etc configs, wireless settings, the lot. Keep the
zip somewhere that isn't the hotspot.
Restoring is the elegant part, documented by the project since 3.4.0: drop that zip file into the boot partition of a card — the FAT partition any computer can see — and on boot Pi-Star finds it and configures itself from it. New card, replacement Pi, borrowed hardware: flash, drop the zip, power on, and the hotspot comes back with your callsign, frequency and networks intact. Test the restore once on a spare card before the day you need it; a backup whose restore you've never seen work is a hope, not a backup.
Also in the neighbourhood: pistar-clone and pistar-expand
(shipped tools for card cloning and growing into a larger card),
and pistar-factory-reset — new enough to have arrived with a
sudo-wrapped helper in the 4.3 line — for returning a box to the
chapter 5 state when it's changing owners. A hotspot leaving your
house should leave reset, with your passwords and keys gone; the
sudoers listing in the image (/etc/sudoers.d/pistar-dashboard) is
a reminder that the dashboard's powers on the box are deliberate
and scoped — treat the box as the appliance it is.