Bosse_B wrote: ↑Mon Jul 13, 2020 9:34 pm
Can you tell me how you intend to do a rollback?
Only thing I can think of is taking a full image copy of the SDcard before the upgrade, right?
No. I netboot virtually everything around here, as it makes management a lot easier: broken SD cards are not a thing, and if I break cmdline.txt or config.txt or install a bad rpi-update, it doesn't matter.
Every Pi has its own ZFS filesystem on my router / rootfs server / general dogsbody machine, which is snapshotted every 15 minutes and kept for varying lengths of time. So rolling back is a matter of 'zfs rollback rt0/support/$piname@$snapshotdatetime'[0] and rebooting the Pi. Symlinks in /tftpboot point to each rootfs/boot, which means they're all part of the same filesystem, so rpi-update and raspberrypi-* package updates all just work.
20 minutes to recover from a bad rpi-update? I can do it in seconds...
I highly recommend this approach if you have a machine capable of being a bootserver. And as that can be another Pi -- I'd use a Pi4 8GB with a 64b kernel and a brace of USB-attached SSDs if I was going to use one -- there's little to stop anybody...
[0] Just for illustration:
Code: Select all
root@pi4:~# ls /.zfs/snapshot/ | wc -l
336
root@pi4:~# ls /.zfs/snapshot/ | tail -20
2020-07-13_18.45.01--4h
2020-07-13_19.00.01--1w
2020-07-13_19.15.01--4h
2020-07-13_19.30.01--4h
2020-07-13_19.45.01--4h
2020-07-13_20.00.01--1w
2020-07-13_20.15.01--4h
2020-07-13_20.30.01--4h
2020-07-13_20.45.01--4h
2020-07-13_21.00.01--1w
2020-07-13_21.15.01--4h
2020-07-13_21.30.01--4h
2020-07-13_21.45.01--4h
2020-07-13_22.00.01--1w
2020-07-13_22.15.01--4h
2020-07-13_22.30.01--4h
2020-07-13_22.45.01--4h
pre5.4
presysvinit
x
root@pi4:~#
I can 'zfs rollback rt0/support/telly-buster@' any one of those, and roll back to where it was at the time. Because this filesystem has been cloned into other live filesystems, there are actually a few more snapshots than there should be; I should tidy it up manually. Otherwise, '--1w' are kept for about a week, '--4h' four hours, etc. Midnight snapshots are kept for three months, which gives an awful lot of lattitude for breaking things and fixing them later in time. Amusingly, I can do it to a live Pi, and assuming nothing has changed all that much, it'll continue running as if nothing has happened, just with the older filesystem underneath it. It's very clever.
[Edit:]
Knew I'd get it wrong. 20m, not 30m.
[/Edit:]