Skip to the text
KDOS
Menu
kdos.dev KDOS from Scratch KDOS 0.2 · 4dd4a10 · 2026-11-30 Contents Index

398. A/B slots and rollback

An installed KDOS machine can keep two complete copies of the system, called slot A and slot B. An update is written into the slot you are not running and booted on trial; if that boot is not confirmed, the next boot starts the old slot again, exactly as it was, and your files in /home are shared by both slots. This page is for anyone who administers an installed machine: how to read which slot is running, what the installer sets up, how to put an update on trial, how to roll one back, and what to check when a slot will not boot or will not be kept.

How the initramfs (the small system that runs before the root filesystem is mounted) counts attempts is explained in A/B slot selection, why each slot has its own kernel in One kernel per slot, and how a UEFI trial uses BootNext in One boot through BootNext; this page gives the procedures.

Installation

Everything here belongs to kdos-bootctl, one of the names of the ksvc binary in kdos-tools (/usr/bin/kdos-bootctl is a link to /usr/sbin/ksvc). The image build copies it into the initramfs, where kdos-bootctl select decides which root to boot. kdos update apply, from the same port, is what writes the inactive slot. kdos-sysupdated is the root daemon that confirms a boot and serves the slots to the desktop: Discover installs an update through it, and System Settings’ System Versions page, from kcm-kdos-system, shows both slots and starts the other one next time.

The installer, kdos-installer, sets a machine up for slots whenever the install has an ESP. It writes slot A’s kernel and initramfs into EFI/kdos/a/, the first boot state, and kdos_slot=a and bootstate=UUID=<esp> on each /KDOS menu entry. On the A/B layout it makes the second slot as well. That layout is what the erase plan under LVM gives a disk with room for it: one volume group, kdos, holding root_a and root_b, a swap volume when swap was asked for, and home, the rest, which both slots mount at /home. Each slot is sized at the largest of three figures, rounded up to a whole GiB: the size of the install and half as much again, so an update has room to grow; 30 per cent of the space left after the swap; and 8 GiB. The home takes the rest and is at least 4 GiB. The installer fills slot B with a copy of slot A as it stands at the end of the install, accounts and accent included, gives slot B its own kernel pair under EFI/kdos/b/, writes each slot’s release record beside its kernel, and records both slots in the boot state. A disk too small for two slots gets root_a alone, holding the home as well, and no second slot.

The two halves of a boot’s decision run at set points of every boot: select in the initramfs, and mark-good once the boot has been confirmed. /etc/init.d/46_sysupdated.sh supervises kdos-sysupdated, which runs mark-good.

The live medium has no slots and no boot state. Everything on this page applies to an installed machine only.

Configuration

The boot state

The state is one file on the ESP, EFI/kdos/bootstate, which is /boot/efi/EFI/kdos/bootstate on the running system. No file in the tree ships it; the installer writes the first version:

		mkpath(TARGET "/boot/efi/EFI/kdos");
		wr("/boot/efi/EFI/kdos/bootstate",
		   "# KDOS boot state. Written by the installer; maintained by\n"
		   "# kdos-bootctl.\n"
		   "slot_a   = %s\n"
		   "slot_b   = %s\n"
		   "crypt_a  = %s\n"
		   "crypt_b  = %s\n"
		   "active   = a\n"
		   "try      = \n"
		   "attempts = 0\n",
		   root_uuid, b_uuid, luks_uuid, b_uuid[0] ? luks_uuid : "");
	}

src/system/kinstall-core/install.c, lines 4067–4079

slot_b is empty unless the installer made the A/B layout. kdos-bootctl writes every later version, under a header of its own (Written by kdos-bootctl; the initramfs reads it before it mounts a root filesystem.), and adds five keys: bootnext, which is empty except during a UEFI trial, when it reads yes; armed, the kernel’s boot id of the boot that armed the trial; failed, the slot whose last trial ended without being confirmed, until the next try, a confirmation or an unfill of that slot clears it; abandoned, the slot whose trial was set aside by picking the confirmed slot at the boot menu, cleared the same way and never reported as a failure; and unfilled, the slot an update has begun writing and not yet deployed, until kdos-bootctl deploy into it clears it:

slot_a   = c55c90d8-b72a-4e05-b729-bbd60388a06a
slot_b   = a5549778-64ed-4a32-88a1-bde080ddba46
crypt_a  =
crypt_b  =
active   = a
try      = b
attempts = 1
bootnext = yes
armed    = 1b0e4c52-6c8f-4b8e-9a51-2f1d7b0c9e3a
failed   =
abandoned =
unfilled =

The keys are described in A/B slot selection. Edit the file only through kdos-bootctl: it writes a temporary file, fsyncs it, renames it, then fsyncs the renamed file and syncfses the ESP, because the ESP is FAT and has no journal. A directory fsync alone is not enough there: on Linux’s vfat the entry a rename reuses is written through the renamed file’s inode, so an editor’s save can reach the disk as a zero-length file after a power cut. A file it cannot parse is treated as absent, which boots the root= of the menu entry.

The ESP layout

Path on the ESP Holds Written by
EFI/kdos/a/vmlinuz, EFI/kdos/a/initramfs.cpio.gz Slot A’s kernel and initramfs kinstall, then kdos-bootctl deploy
EFI/kdos/b/… Slot B’s kinstall on the A/B layout, then kdos-bootctl deploy
EFI/kdos/<slot>/release The identity of the root that slot holds: VERSION, BUILD_ID, BUILD_DATE, TREE and TREE_TIME from its /etc/kdos-release. The other slot is not mounted when a session asks what it holds, so kdos-bootctl status, System Versions and the rollback notice read this file kinstall for each slot it fills, then kdos-bootctl deploy
EFI/kdos/bootstate The boot state kinstall, then kdos-bootctl
limine.conf The menu; its /KDOS entries follow the state kinstall, then kdos-bootctl
EFI/kdos/trial/ A copy of the ESP’s BOOTX64.EFI (BOOTIA32.EFI on 32-bit firmware) and a trial limine.conf, during a UEFI trial only; removed when the trial ends kdos-bootctl try
EFI/kdos/keymap One line: the console map (/etc/keymap) that the initramfs loads before the disk passphrase prompt, shared by both slots kinstall, then kdos-settingsd when the keymap changes and at its start
EFI/kdos/memtest.efi, EFI/kdos/wallpaper.png, EFI/kdos/font.bin The memory test, the menu’s backdrop and its typeface, shared by both slots; each only when the installer finds its source kinstall

Which lines of the menu kdos-bootctl rewrites is covered on Boot menu and kernel parameters.

Where each half runs

In the initramfs, the BOOT SLOT stage mounts the ESP, asks select for the root and crypt for that root’s container, reads the console map for the passphrase prompt from EFI/kdos/keymap, and unmounts it again. The \$ in this excerpt is the generator’s escaping: the init is written by a heredoc, and the generated script has a plain $.

#
# A/B slots: the boot state lives on the ESP because it must be readable and
# WRITABLE before any root filesystem is mounted — including the one that turns
# out not to work. \`select\` prints the UUID to boot and spends an attempt in the
# same breath, so a kernel that hangs after this point has still been counted.
#
# Failing to read it is not fatal: \`root=\` on the command line is what a machine
# without A/B uses anyway, and it stays the fallback.
#
# AND THE SLOT'S OWN CONTAINER COMES WITH IT. \`select\` yields a FILESYSTEM
# identifier; on an encrypted machine that filesystem is inside a LUKS
# container, and the command line can name exactly one \`cryptdevice=\`. Two
# slots inside two containers cannot both be named there, so each slot records
# its own and \`crypt\` is asked for the one that belongs to the filesystem
# \`select\` just chose. A slot that names none leaves \`CRYPTDEV\` exactly as the
# command line set it, which is every machine installed without encryption and
# every machine whose two slots share one container.
#
# THE ORDER IS LOAD-BEARING: this block runs BEFORE the unlock below, because
# the unlock is what has to happen to the container this block names. Moving
# the unlock above it would unlock whichever container the command line
# mentions and then look for the other slot's filesystem inside it.
#
if [ -n "\$BOOTSTATE_UUID" ] && [ -x /bin/kdos-bootctl ]; then
    sp_total 1
    sp_step "BOOT SLOT"
    modprobe -q vfat 2>/dev/null
    mkdir -p /esp
    ESP_DEV=""
    for i in \$(seq 1 10); do
        ESP_DEV=\$(blkid -U "\$BOOTSTATE_UUID")
        [ -n "\$ESP_DEV" ] && break
        sleep 1
    done
    if [ -n "\$ESP_DEV" ] && mount -t vfat "\$ESP_DEV" /esp 2>/dev/null; then
        # \`kdos_slot=\` is the slot whose ESP directory this kernel came
        # from, and it is handed to \`select\`: that slot's modules are the
        # only ones this kernel can load, so a hand-picked entry boots its
        # own slot and nothing else. Absent on a menu whose entries share
        # one kernel, where \`select\` decides alone. \`select\` also rewrites
        # the menu on the ESP when its decision moves the next boot.
        # KDOS_CMDLINE names /proc/cmdline outright: a state file away from
        # /boot/efi reads no command line without it, and \`select\` reads
        # \`kdos_menu=trial\` there to tell a confirmed entry picked from a
        # trial menu from a firmware fallback.
        SEL=\$(KDOS_BOOTSTATE=/esp/EFI/kdos/bootstate \
               KDOS_CMDLINE=/proc/cmdline \
               /bin/kdos-bootctl select \${BOOT_SLOT:+"\$BOOT_SLOT"} \
               2>/dev/console)
        # BOTH READS HAPPEN WHILE IT IS MOUNTED. \`crypt\` reads the same file
        # \`select\` just wrote, so asking after the umount below reads nothing
        # and silently drops the container — an encrypted second slot would
        # then be unlocked with the first slot's container and fail to mount,
        # which reads as a corrupt filesystem rather than as a missing lookup.
        # It spends no attempt: \`select\` is the only verb that counts.
        SLOT_CRYPT=""
        [ -n "\$SEL" ] && SLOT_CRYPT=\$(KDOS_BOOTSTATE=/esp/EFI/kdos/bootstate \
               /bin/kdos-bootctl crypt "\$SEL" 2>/dev/null)
        # The console map the passphrase prompt loads is read here too, for
        # the same reason: the ESP is not mounted again before the unlock.
        esp_keymap /esp
        # Unmounted immediately: the root filesystem mounts it again at
        # /boot/efi, and two mounts of one FAT filesystem is how a state file
        # gets written twice and read once.
        umount /esp 2>/dev/null

script/phases/70_image/090_initramfs.sh, lines 893–957

A boot is confirmed (kept as the slot to start from now on) by two marks, both files owned by root under /run/kdos/bless/. The end of rcS, after every service script has run, writes the first, userspace:

# THE FIRST OF THE TWO MARKERS THAT CONFIRM AN A/B SLOT: this boot started
# every service that was going to fail. It confirms nothing on its own.
# kdos-sysupdated runs `kdos-bootctl mark-good` only once the graphical marker
# beside it exists too, which it writes when a desktop session has answered
# for a minute — or the greeter has, on a machine nobody logs in to — so a
# slot whose services start and whose desktop does not still spends its
# attempt and is rolled back once its attempts are spent.
# Both markers are root's, under /run/kdos/bless, and /run is a tmpfs, so a
# boot starts with neither.
#
# LAST, deliberately: a boot that wedges before this line never writes it.
#
# AN IMAGE WITHOUT kdos-sysupdated CONFIRMS HERE, because nothing else would:
# the marker would wait for a reader that is not there, and every trial slot
# would roll back however well it booted. Silent when the machine has no boot
# state, which is every machine with a single root: there is nothing to
# confirm and that is not a failure.
mkdir -p /run/kdos/bless
chmod 0755 /run/kdos/bless
: > /run/kdos/bless/userspace
if [ ! -x /usr/sbin/kdos-sysupdated ] || [ -f "${DISABLED_DIR}/sysupdated" ]; then
    if command -v kdos-bootctl >/dev/null 2>&1; then
        kdos-bootctl mark-good >/dev/null 2>&1 || true
    fi
fi

fs/etc/init.d/rcS, lines 236–260

The second, graphical, is written by kdos-sysupdated once the desktop has been up for a minute:

With both marks present, kdos-sysupdated runs kdos-bootctl mark-good once and writes /run/kdos/bless/confirmed. Otherwise one mark alone confirms nothing: a slot whose services start but whose desktop does not still spends its attempt and is rolled back.

A mark-good in the same boot that armed a trial leaves the trial as it is: an update applied within the first minute of a boot has already called try, and the armed boot id is how mark-good tells.

Usage

Every kdos-bootctl command below that changes the state needs root, because the ESP is mounted with umask=0077. Run as an ordinary user, kdos-bootctl status and kdos-bootctl status --json print the copies kdos-bootctl publishes in /run/kdos (bootstate.txt and bootstate.json) each time it writes the state; with no copy there, status says the boot state is readable by root alone.

Reading the state

sudo kdos-bootctl status
sudo kdos-bootctl status --json

The text form prints, in order:

  1. One slot <x> line for each slot that has a root: the version it holds and its state, one of running, confirmed, armed, trial, visiting, incomplete, failed, abandoned or inactive. visiting, printed visiting (this boot only), is a slot picked at the boot menu when it is neither confirmed nor on trial.
  2. A line for each problem recorded:
    • failed when a trial ended without being confirmed;
    • abandoned <x>: set aside at the boot menu when a trial was left by picking the confirmed slot;
    • unfilled <x>: an update stopped while writing this slot. The next update writes it again; to write it at once, run kdos update apply --mount as root when an update began writing a slot and did not finish. That slot’s state is incomplete, whatever else is recorded for it.
  3. The active slot and its filesystem UUID, then the other slot. On a machine installed with one root, the other line reads other none: this machine has one root and no rollback.
  4. The LUKS (encrypted disk) container of each slot that has one.
  5. The kernel version each slot boots from the ESP.
  6. The trial in progress, if any. With none, the last line is trying nothing — this slot is confirmed good, or trying nothing — this boot was picked from the menu; the next boot starts <active> when the running slot is visiting.
kdos-bootctl list --json        # the boot entries, one per slot, in the shape `bootctl list --json` prints

The same state is on the System Versions page in System Settings, which lists both slots with the version, build date, tree commit and kernel each holds. The JSON form carries the same state as one object, starting {"configured": true, "active": "a", "trying": null, "attempts": 0, "bootnext": false, …}, with "failed", "abandoned" and "unfilled" each naming a slot or null; a machine installed with one root is "configured": true with "slot_b": "". With no boot state, the text form prints no boot state at /boot/efi/EFI/kdos/bootstate — this machine has one root and no rollback, the JSON form prints {"configured": false}, and both exit 1. With the ESP not mounted at /boot/efi, as in the emergency shell, the text form prints the ESP is not mounted at /boot/efi, so the boot state cannot be read; mount /boot/efi instead. On the live medium, where / is an overlay, the text form prints this is the live medium — it has no boot state and no slots; install KDOS for A/B updates and rollback and the JSON form {"configured": false, "live": true}.

Adding slot B to a machine installed with one root

The installer makes slot B itself on the A/B layout. A machine installed with one root can be given a second on another disk or partition by hand: make a filesystem, copy the system into it, record it.

  1. Make slot B’s filesystem, on a partition or logical volume at least the size of the running root, for example:

    sudo mkfs.ext4 /dev/<partition>
  2. Mount it, for example at /mnt/b, and copy the running system into it:

    sudo mkdir -p /mnt/b
    sudo mount /dev/<partition> /mnt/b
    sudo rsync -aHAX -x --numeric-ids / /mnt/b/

    These are the flags of the installer’s own copy into slot B (do_slotb in src/system/kinstall-core/install.c). -x keeps the copy on the root filesystem, so /boot/efi, /proc, /sys, /dev, /run, /tmp and /mnt/b itself stay out. A /home on a filesystem of its own stays out too, and both slots then mount it.

  3. The copy carries slot A’s /etc/fstab, whose root line names slot A’s filesystem by UUID and type. Edit /mnt/b/etc/fstab so that line names slot B’s filesystem, and its type if it differs.

  4. Read the UUIDs and record the slot. The second UUID is needed only when slot B is inside its own LUKS container; the first is always the filesystem’s:

    sudo blkid -s UUID -o value /dev/<partition>
    sudo kdos-bootctl set-slot b <filesystem-uuid> [<luks-uuid>]
  5. Put slot B’s kernel on the ESP: sudo kdos-bootctl deploy /mnt/b b.

set-slot with fewer arguments prints usage: kdos-bootctl set-slot <a|b> <uuid> [<luks-uuid>] and exits 2. It rewrites the slot’s container every time it runs, so running it again without the LUKS UUID records the slot as unencrypted. It also regenerates the menu, which gains a KDOS <version> (slot B) entry, commented The other version, for one boot; nothing changes, once slot B has a kernel and the release record deploy writes beside it on the ESP; deploy reports that kernel as slot b boots 7.2.11 from EFI/kdos/b. Until then, try b refuses with bootctl: slot b has no kernel on the ESP — run `kdos-bootctl deploy <its root> b` first.

This procedure is untested: no machine has been given its second slot by hand this way, and a second slot inside a LUKS container of its own has not been booted. Keep the live medium at hand the first time you try it.

Updating through the inactive slot

Discover shows a KDOS update beside the applications’ and installs it into the inactive slot; its Restart to update button reboots into it. The same from a terminal:

  1. Fetch and see what is offered: sudo kdos update fetch, then kdos update check.

  2. Run sudo kdos update apply --mount. --mount mounts the inactive slot at /run/kdos/slot-<x> for this run and unmounts it when the run ends, Ctrl-C included; without it, apply uses the slot where it is already mounted and refuses when it is not.

    apply fills the slot in one of three ways, called lanes:

    • the signed slot image of the newer release, when one is published;
    • otherwise the prebuilt packages of the signed binhost (the KDOS package server);
    • with --source, a build from source on this machine.

    It then checks the slot with kpkg check --all, carries this machine’s configuration into it (see below), records its version, runs kdos-bootctl deploy to put its kernel on the ESP and kdos-bootctl try to put the slot on trial. When nothing is out of date it prints nothing to take: everything installed matches the ports tree and puts nothing on trial.

    Before any lane writes the slot, apply cancels a trial armed on it and runs kdos-bootctl unfill <x>. A slot left half-written by a power cut or a cancel is then recorded as incomplete, loses its boot menu entry, and is refused by try until an update writes it again. When that mark cannot be written, apply stops with slot <x> could not be marked as being written and records build-failed.

    When nothing is out of date but the slot is still marked incomplete, apply finishes it without a trial. It prints slot <x> holds every package of <version> but was left incomplete; finishing it, checks the slot, carries the configuration, records the version and deploys its kernel (which clears the mark and brings back its boot menu entry), and ends with slot <x> is complete again and holds <version>, the version running; nothing is tried. In both lines <version> is the version the slot records, the name System Versions and kdos-bootctl status show.

    kdos update apply --dry-run --mount on an unmounted slot says what it would do without mounting it. When the boot state marks that slot unfilled, it says an update stopped while writing it and that --mount finishes it; a plain --dry-run refusal says the same.

  3. Reboot. The candidate boots; once the boot is confirmed, mark-good makes it the active slot.

  4. Check the outcome: sudo kdos-bootctl status.

What the slot receives from this machine. A slot is a whole root, and only /home (with the pack store bound from it onto /var/lib/kdos/packs) is shared. Before a slot is armed, apply carries the running root’s configuration into it, file by file under /etc:

The file in the running root What the slot gets
Installed by a package and never edited The slot’s own copy, which is the newer default
Edited, or owned by no package (hostname, machine ID, host keys, network profiles) The running root’s copy; a different copy the slot held is kept beside it as <file>.kdos-new, or as the hidden .<file>.kdos-new inside a directory whose name ends in .d, since a program that reads such a directory whole, as SDDM reads sddm.conf.d, would read a visible copy as configuration too
passwd, group, shadow, gshadow, subuid, subgid Merged by name: every running entry, then every entry only the slot has
fstab The running root’s, with the slot’s own root line; every absolute mount point it names, /boot/efi among them, is created in the slot where it is missing (mode 0755, owned by root), so the slot mounts the ESP and can confirm its boot
kdos-release, mtab, ld.so.cache, udev/hwdb.bin The slot’s own, never carried

Machine state under /var follows as whole trees: the world set, the origin of each package (/var/lib/kdos/origin), the installer’s records of boxed applications still to build and groups still to install (apps-pending, groups-pending), D-Bus’s machine ID, Bluetooth pairings, AccountsService, SDDM’s state, the ALSA mixer, NetworkManager’s leases, the users’ crontabs and /root. A carry = <path> line in /etc/kdos/update.conf adds a path of your own. After the switch, find /etc -name '*.kdos-new' lists every file where the new version’s default and this machine’s copy differ. The record of grafted data packs is not carried: it is pack-manifest in the shared pack store, and kdos-packd grafts what it names into the slot it starts in (see Packs).

kdos update apply --in-place updates the running root instead and gives up the rollback. The whole update procedure, its tree and its keys are on Updating. No published release’s update has yet been applied to an installed machine (Known gaps).

Putting a slot on trial by hand

sudo kdos-bootctl try b        # or: try b 2, on a menu-led trial

With UEFI variables available, try arms one boot through BootNext and prints will boot slot b once, through UEFI BootNext; any boot after that one that has not confirmed it rolls back to a. The firmware then starts a load option labelled KDOS update trial, which loads EFI/kdos/trial/BOOTX64.EFI and its trial menu, whose default_entry is KDOS <version> (slot B). The main menu’s default_entry stays on the confirmed slot, and its KDOS <version> (slot B) entry is commented The update, for one boot; then the confirmed version again when slot B is newer than the confirmed slot (a later TREE_TIME in its EFI/kdos/b/release, or, where either record has no tree time, a version that sorts above), and This version, for one boot; then the confirmed version again when it is older or equal. The candidate’s entry ends in panic=10, unless the command line already sets panic=, so a candidate whose kernel panics restarts on its own. While the trial is armed, status reads trying b once, through UEFI BootNext — any boot after that one starts a. When the candidate’s boot reaches mark-good, it becomes the active slot, EFI/kdos/trial/ is removed and the firmware is back on its usual boot order.

Without UEFI variables, try leads the trial from the menu. On a BIOS boot it prints one line, will boot slot b up to 3 time(s), then roll back to a; a kernel that dies before its initramfs is left by picking the slot A entry at the boot menu. On a UEFI boot whose firmware variables cannot be written, which includes one with efivarfs not mounted, that line follows bootctl: no UEFI BootNext — slot b is led by the menu instead; with efivarfs not mounted both are preceded by bootctl: cannot write Boot0000: No such file or directory. The menu’s first entry is then commented Try the update (slot B, KDOS <version>), or Try this version (slot B, KDOS <version>) for an older or equal slot, and status counts down trying b, 3 attempt(s) left.

try refuses the active slot (bootctl: slot a is already active), a slot with no root (bootctl: slot b has no root filesystem), a slot with no kernel on the ESP, and an incomplete slot (bootctl: slot b is incomplete — an update stopped while writing it; `kdos update apply` writes it again); each exits 1.

sudo kdos-bootctl cancel forgets a trial that has not had its boot yet, firmware one-shot first, so the next boot starts the confirmed slot. A trial the running boot is part of is not cancelled: it ends by its confirmation or its rollback.

The System Versions page’s Start This Version Next Time button arms the same one-boot trial of the other slot, through kdos-sysupdated and polkit (io.kdos.slots.try). Going back to an older or equal slot this way is no update, and the menu calls it this version.

Rolling back

A trial that does not confirm rolls itself back. On UEFI, the candidate gets one boot. When that boot is not confirmed (a panic, a hang and a reset, a service that wedges rcS, a desktop that never comes up), the next boot starts the confirmed slot, the initramfs drops the candidate, and the state records it as failed; the next session shows a notice that the update was rolled back. On a menu-led trial, the boot after the last attempt starts the confirmed slot.

To set a UEFI trial aside at its one boot, stop the trial menu’s countdown and pick its first entry, KDOS <version>, whose comment reads The confirmed version: picking it sets the update aside (… sets the trial aside when the candidate is older or equal). That entry and the two below it carry kdos_menu=trial, which tells the initramfs the person chose the confirmed slot: the state records the candidate as abandoned, not failed, and kdos-bootctl status and System Versions report it as in step 3 below.

To leave a menu-led trial before its attempts are spent:

  1. Reboot and stop the menu’s countdown.
  2. Pick KDOS <version> (slot <X>), where <X> is the confirmed slot. Its comment reads The confirmed version: picking it sets the update aside, or … sets the trial aside when the candidate is older or equal.
  3. After the boot, sudo kdos-bootctl status reports abandoned <x>: set aside at the boot menu and trying nothing — this slot is confirmed good. No notice says the update did not start, and System Versions shows the slot as “Set aside: you started the other version from the boot menu”, with no banner.

A candidate that has already confirmed is the active slot. To go back to the other one, put it on trial: sudo kdos-bootctl try a.

Booting the other slot once

Pick KDOS <version> (slot <X>) with no trial in progress; its title names the release that slot holds, and its comment reads The other version, for one boot; nothing changes. No attempt is spent and the active slot does not change. A slot recorded as unfilled has no such entry until an update writes it again.

Tips

Troubleshooting

kdos-bootctl status says there is no boot state. Run it with sudo. If root sees none either, check findmnt /boot/efi; a machine installed without an ESP has one root and no slots.

kdos update apply refuses: the slot is not mounted. Pass --mount, or mount the inactive slot’s filesystem (the UUID is in the message) and run it again, or pass --in-place.

kdos update apply refuses: this boot runs the slot on trial. While a trial is running, the other slot is the confirmed way back, and neither is written until the trial is confirmed or rolled back. Wait a minute into the session for the confirmation, or, on a machine SDDM does not log in automatically and before anyone has logged in, a minute at the login screen; or check ls /run/kdos/bless/: userspace and graphical both present and no confirmed means kdos-sysupdated has not run; see service status sysupdated.

A trial is rolled back although the system worked. The boot was not confirmed. The session must stay up for a minute with kdos-session-good.desktop in /etc/xdg/autostart, or, on a machine SDDM does not log in automatically and before any login in that boot, the login screen must; kdos-sysupdated must be running; /run/kdos/bless/ after a minute shows which mark is missing. The ESP must be mounted too: with bootstate= on the command line and no readable state, kdos-bootctl mark-good exits 1 with bootctl: the command line names a boot state and <path> cannot be read — is the ESP mounted?, and findmnt /boot/efi shows whether it is.

A slot reads incomplete. An update began writing it and did not finish. Run sudo kdos update apply --mount again; the next lane to write the slot clears the mark when it deploys the kernel.

try refuses: slot has no kernel on the ESP. Run sudo kdos-bootctl deploy <its root> <slot> with the slot’s root mounted, then try again.

An update was rolled back. sudo kdos-bootctl status shows trying nothing — this slot is confirmed good with the old slot active, and the candidate failed. kdos update notes then begins KDOS <old>, went back from <new>, and plasma-welcome --pages 90-WhatsNew.qml, which Release Notes in the application menu runs, says KDOS went back to <old>; <new>, in the other slot, did not start or was not kept. What’s New does not open by itself here: no login on was confirmed, so this account’s recorded version is still . Mount the candidate and read its logs from that boot only if it reached its own root: /run is a tmpfs, so the /run/kdos-init.<name>.log files of that boot are gone; its system log is in <mount>/var/log/messages. A boot that never reached the root left nothing on disk; boot the candidate’s KDOS <version> (slot <x>) entry and watch the splash, or use the verbose entry, to see where it stops.

A candidate kernel dies before its initramfs on a BIOS machine, and the menu keeps leading with it. Limine counts nothing, so no attempt is spent. Pick the confirmed slot’s KDOS <version> (slot <x>) entry by hand.

The boot stops at UNLOCKING after a switch of slot. The slot’s container is recorded in the state as crypt_a or crypt_b. Check it against blkid -t TYPE=crypto_LUKS from the rescue shell or the live medium, and record it again with both UUIDs: sudo kdos-bootctl set-slot <x> <filesystem-uuid> <luks-uuid>.

Known gaps

See also