Open
Conversation
820dd7d to
3234728
Compare
Add three new disko types for Linux bcache block-layer caching: - bcache_cache: partition content type for cache devices (SSD/eMMC) - bcache_backing: partition content type for backing devices (HDD/SD) - bcache: top-level aggregator that creates the bcache set, attaches cache to backing, and manages nested content This enables declarative bcache configurations where a fast device (SSD, eMMC) caches a slower device (HDD, SD card), significantly improving I/O performance for the backing device.
3234728 to
028b6d3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds Linux bcache (block-layer cache) support to disko via three new types:
bcache_cache— partition content type for cache devices (SSD, eMMC)bcache_backing— partition content type for backing devices (HDD, SD card)bcache— top-level aggregator (likemdadm) that runsmake-bcache, attaches cache to backing, sets cache mode, and delegates to nested content for filesystem creationMotivation
bcache lets a fast device (SSD/eMMC) act as a transparent block-layer cache for a slower device (HDD/SD card). This is useful for:
Design
Follows the established disko multi-device patterns:
bcache_cacheandbcache_backingregister devices to$disko_devices_dir(likemdraid/bcachefsbacking types)bcacheaggregator reads from temp dir, creates the bcache set, and manages content (likemdadm/lvm_vg)backing_dev_namematching for robustnessboot.bcache.enable = truein NixOS configExample usage
Limitations (can be addressed in follow-up PRs)
/dev/bcache0— users with multiple bcache sets need to specify explicitlyTest plan
nix flake check --no-buildpasses (packages, modules, doc generation evaluate cleanly)nix build .#tests.bcache— NixOS VM test that verifies bcache device creation, mount, and cache mode