ECE 440 · Week 6
Modern Computer: Full Stack
A read-only root still has to boot after power is pulled.
Week 6 of 10 · Solitude
ECE 440 · Week 6 · In class
A read-only root still has to boot after power is pulled.
- Ten pulls, ten rows.
- Make the project root read-only, pull power ten times, and record each boot.
- A pull that never returns a prompt is a failed boot.
- The homework is the rule you will use to count that failure, and the place on the page where the mark goes.
ECE 440 · Week 6 · In class
A read-only root still has to boot after power is pulled. (continued)
- Write the rule before you pull power.
ECE 440 · Week 6 · In class
An eleventh pull is extra.
- Mark it as extra, and keep it out of the ten rows.
ECE 440 · Week 6 · Lecture
Why a pull can hurt a writable root
- Writes sit in the page cache before they reach the card; a pull loses whatever had not landed.
- A journal keeps the filesystem's structure consistent, not the contents of the file you were writing.
- A card may also be mid-way through its own internal work when power drops.
- A root nobody writes to has nothing in flight to lose.
ECE 440 · Week 6 · Lecture
Mounting root read-only
# /etc/fstab
UUID=<root-uuid> / ext4 ro,noatime 0 1
tmpfs /tmp tmpfs mode=1777,size=64m 0 0
tmpfs /var/tmp tmpfs mode=1777,size=16m 0 0
roon the kernel command line mounts root read-only first; fstab decides what it stays.- Paths that must be written go on
tmpfs, in RAM, and are empty after each boot.
ECE 440 · Week 6 · Lecture
Proving it is read-only
findmnt -no OPTIONS /
touch /probe # expect: Read-only file system
systemctl --failed # units that wanted to write
- The mount options are the hand-in evidence; the failed
touchconfirms them. - A unit that fails here is a write you have not moved yet.
- For maintenance,
mount -o remount,rw /, then back torobefore the next pull.
ECE 440 · Week 6 · Lecture
A log that counts pulls
| Pull | Time pulled | Prompt returned? | Note |
|---|---|---|---|
| 1 | … | … | … |
| … | … | … | … |
| extra | … | … | not one of the ten |
Decide the failure rule before the first pull: a rule chosen afterwards fits the data.
ECE 440 · Week 6 · Lab
Lab
- Make the project root read-only.
- Pull power ten times. Record each boot. Second pass: pull power once more and mark that row as extra, not one of the ten.
- Assemble the lab hand-in: The mount options showing a read-only root, and a ten-row log of power pulls that still boot.
ECE 440 · Week 6 · Lab
Hand in
The mount options showing a read-only root, and a ten-row log of power pulls that still boot.
ECE 440 · Week 6 · Homework
Homework
- Write how you will count a boot as failed if the prompt never returns, and where that mark goes.
ECE 440 · Week 6 · Homework
Turn in
The failure rule and the place you will mark it.
ECE 440 · Week 6 · Read
Read
On the lab site: Module 12, A whole system, mentions robustness. This week grades the mount options and the ten-row log.
ECE 440 · Week 6 · Next
Week 7
A bad update is installed only on spare media.