bcache-tools icon indicating copy to clipboard operation
bcache-tools copied to clipboard

Add bcache-export-cached helper to export CACHED_UUID and CACHED_LABEL

Open raharper opened this issue 7 years ago • 4 comments
trafficstars

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.

  1. https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1729145
  2. https://bugs.launchpad.net/bcache-tools/+bug/1728742
  3. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=890446

raharper avatar Feb 15 '18 03:02 raharper

@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 avatar May 20 '20 12:05 rbalint

@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.

raharper avatar May 20 '20 14:05 raharper

Please close this PULL REQUEST as it is outdated. Latest version is in:

https://github.com/koverstreet/bcache-tools/pull/6

rafaeldtinoco avatar Jul 22 '20 20:07 rafaeldtinoco

@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.

rafaeldtinoco avatar Jul 22 '20 20:07 rafaeldtinoco