blkid can not list FS types if there are multiple of them in there. It gets all confused. wipefs finds all of them, and so does a low level probe which the UDEV rules for bcache don't do. # /sbin/blkid /dev/sdg1 # wipefs /dev/sdg1 offset type ---------------------------------------------------------------- 0x25000 zfs_member [raid] 0x1018 bcache [other] UUID: 2d4c7ca4-9e38-4364-be14-b517c83b1d6f # /sbin/blkid -p -u other -o udev /dev/sdg1 ID_FS_UUID=2d4c7ca4-9e38-4364-be14-b517c83b1d6f ID_FS_UUID_ENC=2d4c7ca4-9e38-4364-be14-b517c83b1d6f ID_FS_TYPE=bcache ID_FS_USAGE=other ID_PART_ENTRY_SCHEME=dos ID_PART_ENTRY_UUID=000b2d00-01 ID_PART_ENTRY_TYPE=0x83 ID_PART_ENTRY_NUMBER=1 ID_PART_ENTRY_OFFSET=2048 ID_PART_ENTRY_SIZE=1953523120 ID_PART_ENTRY_DISK=8:96 The following patch to the UDEV rules file (/lib/udev/rules.d/69-bcache*) fixes the detection issue and creation of /dev/bcache0 but it does not create the UUID based symlink in /dev/bcache/by-uuid. I am not sure how to do that. @@ -7,6 +7,7 @@ # blkid was run by the standard udev rules # It recognised bcache (util-linux 2.24+) +IMPORT{program}="/sbin/blkid -p -u other -o udev $tempnode" ENV{ID_FS_TYPE}=="bcache", GOTO="bcache_backing_found" # It recognised something else; bail ENV{ID_FS_TYPE}=="?*", GOTO="bcache_backing_end" Reproducible: Always Steps to Reproduce: 1. Format cache and backing device 2. Use the bcache device for ZFS 3. Reboot Actual Results: The bcache device device is not recreated. Expected Results: The bcache device should be recreated by udev because it still has bcache formatting.
The second part of the issue seems to be because probe-bcache -o udev is not returning anything. Can we fix it by having this code: # Cached devices: symlink DRIVER=="bcache", ENV{CACHED_UUID}=="?*", \ SYMLINK+="bcache/by-uuid/$env{CACHED_UUID}" DRIVER=="bcache", ENV{CACHED_LABEL}=="?*", \ SYMLINK+="bcache/by-label/$env{CACHED_LABEL}" replaced with: # Cached devices: symlink DRIVER=="bcache", ENV{ID_FS_UUID}=="?*", \ SYMLINK+="bcache/by-uuid/$env{ID_FS_UUID}" DRIVER=="bcache", ENV{ID_FS_LABEL}=="?*", \ SYMLINK+="bcache/by-label/$env{ID_FS_LABEL}"
Thanks for report and tracking it down. I will see what upstream is working on.
Could you please file a bug for this upstream(https://github.com/g2p/bcache-tools) and add the link here?
I gave up on bcache. It just doesn't work for my use case. See https://bugzilla.kernel.org/show_bug.cgi?id=71441. Not getting much help from upstream kernel developer on the kernel issue didn't increase chances of my following up...:-)
https://bugzilla.kernel.org/show_bug.cgi?id=71441#c3 "Does this problem still show up in Linux v5.5 or v5.6-rc ?" Please report there and here.
Closing this 7 year old bug. Not using bcache.