summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUday Shankar <ushankar@purestorage.com>2024-10-10 22:29:10 +0200
committerDaan De Meyer <daan.j.demeyer@gmail.com>2024-10-11 10:29:26 +0200
commit225ddc4a72a425e4fdbfd26c887a8bf1d9b9c8ef (patch)
tree46c28827109722ac2dd8b6fee9ab196b7dbf9d53
parentdocs/DESKTOP_ENVIRONMENTS: fix formatting (diff)
downloadsystemd-225ddc4a72a425e4fdbfd26c887a8bf1d9b9c8ef.tar.xz
systemd-225ddc4a72a425e4fdbfd26c887a8bf1d9b9c8ef.zip
udev: allow persistent storage rules for ublk devices
Tools such as lsblk which query the udev database instead of probing devices directly fail when run on ublk devices. For instance, in the following commands, the partition type is missing, despite the fact that /dev/ublkb0 was just partitioned with a single Linux filesystem type partition. $ lsblk /dev/ublkb0 NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS ublkb0 259:0 0 31.3G 0 disk └─ublkb0p1 259:1 0 31.2G 0 part $ lsblk -o pkname,parttype /dev/ublkb0 PKNAME PARTTYPE ublkb0 This happens because ublk devices are missing from a couple of whitelists in the udev rules which are responsible for populating the database with the data lsblk is looking for. Add the ublk devices to these whitelists.
-rw-r--r--rules.d/60-block.rules2
-rw-r--r--rules.d/60-persistent-storage.rules.in2
2 files changed, 2 insertions, 2 deletions
diff --git a/rules.d/60-block.rules b/rules.d/60-block.rules
index 40c26a9ed6..c3bf32eb83 100644
--- a/rules.d/60-block.rules
+++ b/rules.d/60-block.rules
@@ -9,5 +9,5 @@ ACTION=="change", SUBSYSTEM=="scsi", ENV{DEVTYPE}=="scsi_device", TEST=="block",
# watch metadata changes, caused by tools closing the device node which was opened for writing
ACTION!="remove", SUBSYSTEM=="block", \
- KERNEL=="loop*|mmcblk*[0-9]|msblk*[0-9]|mspblk*[0-9]|nvme*|sd*|vd*|xvd*|bcache*|cciss*|dasd*|ubd*|ubi*|scm*|pmem*|nbd*|zd*|rbd*|zram*", \
+ KERNEL=="loop*|mmcblk*[0-9]|msblk*[0-9]|mspblk*[0-9]|nvme*|sd*|vd*|xvd*|bcache*|cciss*|dasd*|ubd*|ubi*|scm*|pmem*|nbd*|zd*|rbd*|zram*|ublkb*", \
OPTIONS+="watch"
diff --git a/rules.d/60-persistent-storage.rules.in b/rules.d/60-persistent-storage.rules.in
index de6d4837cd..1e5e2b3352 100644
--- a/rules.d/60-persistent-storage.rules.in
+++ b/rules.d/60-persistent-storage.rules.in
@@ -7,7 +7,7 @@ ACTION=="remove", GOTO="persistent_storage_end"
ENV{UDEV_DISABLE_PERSISTENT_STORAGE_RULES_FLAG}=="1", GOTO="persistent_storage_end"
SUBSYSTEM!="block|ubi", GOTO="persistent_storage_end"
-KERNEL!="loop*|mmcblk*[0-9]|msblk*[0-9]|mspblk*[0-9]|nvme*|sd*|sr*|vd*|xvd*|bcache*|cciss*|dasd*|ubd*|ubi*|scm*|pmem*|nbd*|zd*|rbd*|zram*", GOTO="persistent_storage_end"
+KERNEL!="loop*|mmcblk*[0-9]|msblk*[0-9]|mspblk*[0-9]|nvme*|sd*|sr*|vd*|xvd*|bcache*|cciss*|dasd*|ubd*|ubi*|scm*|pmem*|nbd*|zd*|rbd*|zram*|ublkb*", GOTO="persistent_storage_end"
# ignore partitions that span the entire disk
TEST=="whole_disk", GOTO="persistent_storage_end"