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 #1

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
@koverstreet
Copy link
Owner

koverstreet commented Feb 15, 2018 via email

@raharper
Copy link
Author

raharper commented Feb 15, 2018 via email

@basak
Copy link

basak commented Mar 27, 2018

dahefanteng pushed a commit to dahefanteng/bcache-tools that referenced this pull request Jun 2, 2020
From: Ryan Harper <[email protected]>
koverstreet/bcache-tools#1

Add bcache-export-cached helper to export CACHED_UUID and CACHED_LABEL 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

Signed-off-by: Shaoxiong Li <[email protected]>
@rafaeldtinoco
Copy link

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

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

dahefanteng pushed a commit to dahefanteng/bcache-tools that referenced this pull request Aug 19, 2020
koverstreet/bcache-tools#1

Add bcache-export-cached helper to export CACHED_UUID and CACHED_LABEL 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

Signed-off-by: Shaoxiong Li <[email protected]>
andreatomassetti pushed a commit to andreatomassetti/bcache-tools that referenced this pull request Mar 9, 2022
koverstreet/bcache-tools#1

Add bcache-export-cached helper to export CACHED_UUID and CACHED_LABEL 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

Signed-off-by: Shaoxiong Li <[email protected]>
Signed-off-by: Coly Li <[email protected]>
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.

4 participants