bcache-tools
bcache-tools copied to clipboard
Add bcache-export-cached helper to export CACHED_UUID and CACHED_LABEL
Linux kernel bcache driver does not always emit a uevent[1] for when a backing device is bound to a bcacheN device. When this happens, the udev rule for creating /dev/bcache/by-uuid or /dev/bcache/by-label symlinks does not fire and removes any persistent symlink to a specific backing device since the bcache minor numbers (bcache0, 1, 2) are not guaranteed across reboots[2][3].
This script reads the superblock of the bcache device slaves, ensuring the slave is a backing device via sb.version check, extracts the dev.uuid and dev.label values and exports them to udev for triggering the symlink rules in the existing rules file.
- https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1729145
- https://bugs.launchpad.net/bcache-tools/+bug/1728742
- https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=890446
@raharper If you still observe the issue with bcache-tools 1.0.8-4 on Groovy please submit the fix to Salsa instead and I'll merge it. This repo seems to be dead.
@rbalint I suppose this might be worth keeping; Ubuntu kernels have a sauce patch to emit the CACHED_UUID whenever a backing and cache device are joined; this has not been accepted upstream which means non-Ubuntu distros could see this; It will need some testing on both Ubuntu and non-Ubuntu kernels to ensure it's working in both cases.
Please close this PULL REQUEST as it is outdated. Latest version is in:
https://github.com/koverstreet/bcache-tools/pull/6
@raharper I amended your patch with the PATH change and will go from there. Keeping credits and all, just so you dont have to worry about following this closer. Doing the Debian & Ubuntu inner work now.