Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

raharper
Copy link

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

…L always

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.

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
@rbalint
Copy link

rbalint commented May 20, 2020

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

@raharper
Copy link
Author

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

@rafaeldtinoco
Copy link

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

koverstreet/bcache-tools#6

@rafaeldtinoco
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants