BOOTC-DESTR...ANUP.SERVICE(5)

πŸ’– NAME πŸ’–

bootc-destructive-cleanup.service β€” bestie, this is the lil systemd glow-up that tidies up your old OS after you move in next to it 🧹✨


🌸 DESCRIPTION 🌸

okay so picture this: this systemd service shows up on first boot right after an "alongside" installation that you did with bootc install to-existing-root --cleanup. Its whole job? Clean up the files from the previous operating system. it's giving ✨spring cleaning✨ but for an entire OS πŸ’…

The service is a oneshot unit, and it runs a distribution-specific cleanup script that lives at /usr/lib/bootc/fedora-bootc-destructive-cleanup β€” that's the path for Fedora derivatives, iykyk 🐧

πŸ¦‹ How it works πŸ¦‹

  1. While you're doing bootc install to-existing-root --cleanup, a stamp file gets created at /sysroot/etc/bootc-destructive-cleanup πŸ“Œ
  2. Then a systemd generator, bootc-systemd-generator, spots that stamp file at boot time and enables the bootc-destructive-cleanup.service unit. like. it literally goes "oh? πŸ‘€ stamp? guess we're doing this"
  3. And then the service runs the cleanup script on first boot. slay, that's the whole pipeline πŸ”₯

🌈 What the cleanup script does 🌈

On Fedora derivatives, bestie, the cleanup script does all of this:

  • Remounts /sysroot as read-write πŸ“
  • Removes all RPM packages installed in the physical root (aka the previous OS) β€” yes, ALL of them, no crumbs left 😭
  • Removes all container images from /sysroot/var/lib/containers using podman system prune --all -f πŸ—‘οΈβœ¨
Note: the cleanup script does not remove stopped containers, so some storage may remain. Lowkey annoying, but that's how it is right now β€” this behavior may change in the future πŸ‘€

πŸŽ€ CUSTOMIZING THE CLEANUP SCRIPT πŸŽ€

Right now the implementation ships with a Fedora-specific cleanup script. But other distributions?? they can absolutely bring their own ✨ β€” either by creating an executable at /usr/lib/bootc/fedora-bootc-destructive-cleanup, or by editing the systemd unit file so it points at a different path. main character energy, do your own thing 🫢

Want an example implementation to peek at? Go see the Fedora cleanup script: https://github.com/bootc-dev/bootc/blob/main/contrib/scripts/fedora-bootc-destructive-cleanup πŸ“–


🌟 PREVIOUS FILESYSTEM DATA 🌟

So after an alongside installation, all your previous root filesystem data is still chillin' at /sysroot (everyone calls it the "physical root" πŸ’œ).

But ngl, here's the tea: previous mount points or subvolumes will not be automatically mounted in the new system. For example, a btrfs subvolume for /home will not be automatically mounted to /sysroot/home. πŸ™ˆ

These filesystems do persist though β€” so you can handle them manually, or define them as mount points in the bootc image. your call, you got this πŸ‘‘


πŸ‘‘ SEE ALSO πŸ‘‘


⭐ VERSION ⭐

v1.17.1


okay that's the whole page bestie, no cap πŸ’– this was the BOOTC-DESTR...ANUP.SERVICE(5) page from the File Formats Manual, brought to you by version v1.17.1. go forth and clean up that old OS, you're literally iconic πŸ¦‹βœ¨

πŸ“¦ where this page comes from
  • fedora 43: bootc 1.17.1-1.fc43 Β· Apache-2.0 AND BSD-3-Clause AND MIT AND (Apache-2.0 OR BSL-1.0) AND (Apache-2.0 OR MIT) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND (Unlicense OR MIT)
  • fedora 44: bootc 1.17.1-1.fc44 Β· Apache-2.0 AND BSD-3-Clause AND MIT AND (Apache-2.0 OR BSL-1.0) AND (Apache-2.0 OR MIT) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND (Unlicense OR MIT)
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms