Web lists-archives.com

Help with udev trigger




Hi,

 Version: buster
 I do a manual cryptsetup to create my home directory after system boots up
 I want to run fsck every time the device node is created from luks

 I added this udev rule

ACTION="change",DEVTYPE="disk",ID_FS_UUID="cf1b64cf-7a62-4a43-ad44-6c68f2bbdec5"
RUN+="/bin/btrfsck /dev/mapper/home"

But this rule is not getting triggered. Could someone help please to
point out what mistake I am doing ?

The following is what I get when the device is added from which I
deduced the above trigger line

UDEV  [3110.764972] change   /devices/virtual/block/dm-12 (block)
.ID_FS_TYPE_NEW=btrfs
ACTION=change
DEVLINKS=/dev/disk/by-id/dm-uuid-CRYPT-LUKS1-f064023b1b2d41639634f5bdf2430794-home
/dev/disk/by-id/dm-name-home
/dev/disk/by-uuid/cf1b64cf-7a62-4a43-ad44-6c68f2bbdec5
/dev/mapper/home
DEVNAME=/dev/dm-12
DEVPATH=/devices/virtual/block/dm-12
DEVTYPE=disk
DM_ACTIVATION=1
DM_COOKIE=6306419
DM_NAME=home
DM_STATE=ACTIVE
DM_SUSPENDED=0
DM_TABLE_STATE=LIVE
DM_UDEV_DISABLE_LIBRARY_FALLBACK_FLAG=1
DM_UDEV_PRIMARY_SOURCE_FLAG=1
DM_UDEV_RULES=1
DM_UDEV_RULES_VSN=2
DM_UUID=CRYPT-LUKS1-f064023b1b2d41639634f5bdf2430794-home
ID_BTRFS_READY=1
ID_FS_TYPE=btrfs
ID_FS_USAGE=filesystem
ID_FS_UUID=cf1b64cf-7a62-4a43-ad44-6c68f2bbdec5
ID_FS_UUID_ENC=cf1b64cf-7a62-4a43-ad44-6c68f2bbdec5
ID_FS_UUID_SUB=6e20311a-a369-4929-9e40-44b63e3eb563
ID_FS_UUID_SUB_ENC=6e20311a-a369-4929-9e40-44b63e3eb563
MAJOR=253
MINOR=12
SEQNUM=2242
SUBSYSTEM=block
TAGS=:systemd:
USEC_INITIALIZED=3110669103