this post was submitted on 26 Sep 2023
86 points (97.8% liked)

Linux Gaming

15270 readers
236 users here now

Discussions and news about gaming on the GNU/Linux family of operating systems (including the Steam Deck). Potentially a $HOME away from home for disgruntled /r/linux_gaming denizens of the redditarian demesne.

This page can be subscribed to via RSS.

Original /r/linux_gaming pengwing by uoou.

Resources

WWW:

Discord:

IRC:

Matrix:

Telegram:

founded 1 year ago
MODERATORS
top 8 comments
sorted by: hot top controversial new old
[–] Sh1nyM3t4l4ss@lemmy.world 4 points 1 year ago (2 children)

I wonder why they use A/B root in the first place instead of a single BTRFS partition with Subvolumes and snapshots

[–] just_another_person@lemmy.world 18 points 1 year ago* (last edited 1 year ago) (1 children)

This is standard for devices which receive firmware and OS updates non-interactively. Edge devices, phones, routers...etc. It's a simple and effective way to lessen the chance that a device may brick during an update failure or similar event.

One running partition is the primary known-good copy of the system, and the other is a failover of a previous known-good. When an update is received, it isn't applied directly to the current primary, it's applied to failover. When the system reboots, the bootloader attempts to boot the newly updated partition to see if it works, and if it does, it is marked as the "new" known-good primary and boots from then on. If not, the existing primary is rebooted, and the user is notified that a failure occured, and dually an error or recourse to take if so.

Subvolumes and such require a kernel to be loaded in order to use, so that's why the base device partitions don't run that way. Even if you wanted to go that way, it's safer working at the lower levels as above when you're dealing with deployed devices out in the world. Nobody wants a customer service disaster on their hands if devices start bricking themselves from a bad update.

[–] Chewy7324@discuss.tchncs.de 2 points 1 year ago* (last edited 1 year ago) (1 children)

Subvolumes and such require a kernel to be loaded in order to use, so that's why the base device partitions don't run that way.

That's a great point I never thought about. I really wondered why they wouldn't go with btrfs subvolumes, since they could easily btrfs send and receive subvols like they do now with whole partitions. Subvols would even have the benefit of less space needed since many files probably stay the same between updates.

My guess was that the update mechanism used doesn't support btrfs, though after a quick search on the rauc github it might actually support it.

steamos-teardown is a great project to learn more about SteamOS, btw. https://github.com/77Z/steamos-teardown

Pretty much every Linux bootloader supports BTRFS these days.

The critical thing though, is that happens if your BTRFS partition gets corrupted? You just lost your failover since both your primary and failover are on the same partition.

That's fine on a desktop system where the user can boot into a recovery image and repair the filesystem, but it's not fine when you do a completely automated system upgrade. So for a kiosk, console, or other embedded system, the two partition setup is more reliable than a BTRFS root with subvolumes.

[–] vividspecter@lemm.ee 5 points 1 year ago* (last edited 1 year ago)

Possibly because of better reliability. If a filesystem breaks, all subvolumes it contains break in turn. Whereas independent filesystems will continue to run if one is corrupted.

[–] Scio@kbin.social 3 points 1 year ago (1 children)

Will this let us modify both A/B partition for small system level configuration changes without shenanigans?

Configuration is kept separate. The A/B referred to here is just boot and static system, essentially.

[–] yum13241@lemm.ee 2 points 1 year ago