Skip to content

composefs backend lacks garbage collection for /boot and sysroot #1808

Closed

Description

@bketelsen

Observed:
After running a few updates, /boot/EFI/Linux fills up and prevents bootc update from finishing, which leaves the system in a bad state.

/sysroot/composefs/images also doesn't appear to be pruned after updates.

Expected:
After an update, any un-reachable kernels and composefs images would be removed, freeing disk space. Un-reachable probably means that it's not listed in a boot loader entry somewhere, but there may be more nuance.

Thanks for making the composefs backend, we're having tons of fun with Debian :)

Activity

  1. added
    area/composefs
    on Nov 25, 2025
  2. added theissue type on Nov 25, 2025
  3. cgwalters commented on Nov 25, 2025

    @cgwalters
    Member
  4. gerblesh commented on Dec 6, 2025

    @gerblesh

    Would it make sense to first start GCing boot entries here in bootc and then hooking up the relevant areas in composefs to clean up the images where the boot entry no longer exists? Or is there another plan for GC in the composefs backend?

  5. Johan-Liebert1 commented on Dec 8, 2025

    @Johan-Liebert1
    Member

    Currently bootc doesn't have automatic gc for composefs backend, but it does have a GC command which should clean up boot entries and dangling objects in the composefs repository. There'll be some substantial changes in the composefs repository when composefs/composefs-rs#185 lands

  6. bketelsen commented on Dec 8, 2025

    @bketelsen
    Author

    thanks for your response @Johan-Liebert1. I see bootc internals cfs gc which seems to work on the composefs repo, but what is the command to gc the boot entries? Is there anything that specifically cleans up \EFI\Linux?

  7. chaserhkj commented on Jan 3, 2026

    @chaserhkj
    Contributor

    @bketelsen Be aware that bootc internals cfs gc currently is broken, as I tested it it just marked everything for deletion. See composefs/composefs-rs#200 . The command @Johan-Liebert1 mentioned and you are asking for is delete-deployment, this command is hidden from the help text (probly cuz it's not too stable) but can be looked up in the source code

  8. chaserhkj commented on Jan 5, 2026

    @chaserhkj
    Contributor

    Also, it might take some time before the above-mentioned fix could be merged so if you want to try it out you can look at my branch which includes some yet-to-be-merged quality-of-life improvements to cfsctl as well.

    If anyone is interested I also have a shell script that interfaces with bootc and my forked cfsctl to do the full GC. But the script is NOT thoroughly tested and should REALLY NOT be used on production systems.

  9. vaskozl commented on May 3, 2026

    @vaskozl

    I'm finding that bootc internals cfs gc still deletes everything and breaks the deployment on bootc 1.15.2. Is there any alternative recommended way to perform system maintenance?

  10. cgwalters commented on May 4, 2026

    @cgwalters
    Member

    Hi @vaskozl this one should be fixed by #2044 !

  11. cgwalters commented on May 4, 2026

    @cgwalters
    Member

    This one was actually fixed by #2040 - gc happens automatically as you use bootc upgrade/switch etc.

    However, #2044 will close a gap in that directly invoking the underlying cfsctl GC would break things. But running that internals command is

    1. Not necessary today
    2. Not a "supported" operation (all internals are subject to change at any time)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/composefs

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions