booster
booster copied to clipboard
System Boot Failure After Unlocking LVM on LUKS
The system occasionally fails to boot after an LVM on LUKS volume is unlocked.
Debug messages:
udev event {Action:add KObj:/devices/virtual/workqueue/kcryptd_io-253:0-1 Env:map[ACTION:add DEVPATH:/devices/virtual/workqueue/kcryptd_10-253:0-1 SEQNUM:1246 SUBSYSTEM:workqueue]}
udev event {Action:add KObj:/devices/virtual/workqueue/kcryptd-253:0-1 Env:map[ACTION:add DEVPATH:/devices/virtual/workqueue/kcryptd-253:0-1 SEQNUM:1247 SUBSYSTEM:workqueue]}
udev event {Action:add KObj:/devices/virtual/bdi/253:0 Env:map[ACTION:add DEVPATH:/devices/virtual/bdi/253:0 SEQNUM:1248 SUBSYSTEM:bdi]}
udev event {Action:add KObj:/devices/virtual/block/dm-0 Env:map[ACTION:add DEVNAME:dm-0 DEVPATH:/devices/virtual/block/dm-0 DEVTYPE:disk DISKSEQ:18 MAJOR:253 MINOR:0 SEQNUM:1249 SUBSYSTEM:block]}
udev event does not contain DM_COOKIE
udev event {Action:change KObj:/devices/virtual/block/dm-0 Env:map[ACTION:change DEVNAME:dm-0 DEVPATH:/devices/virtual/block/dm-0 DEVTYPE:disk DISKSEQ:18 DM_COOKIE:4194304 MAJOR:253 MINOR:0 SEQNUM:1250 SUBSYSTEM:block]}
writing udev state to /run/udev/data/b253:0
found a new device /dev/dm-0
blkinfo for /dev/dm-0: type-lvm UUID=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx LABEL=
scanning lvm physical volume /dev/dm-0
pvscan[963] PV /dev/mapper/root online, VG vg0 is complete.
pvscan[963] VG vg0 run autoactivation.
udev event {Action:add KObj:/devices/virtual/bdi/253:1 Env:map[ACTION:add DEVPATH:/devices/virtual/bdi/253:1 SEQNUM:1251 SUBSYSTEM:bdi]}
udev event {Action:add KObj:/devices/virtual/block/dm-1 Env:map[ACTION:add DEVNAME:dm-1 DEVPATH:/devices/virtual/block/dm-1 DEVTYPE:disk DISKSEQ:19 MAJOR:253 MINOR:1 SEQNUM:1252 SUBSYSTEM:block]}
udev event does not contain DM_COOKIE
udev event {Action:change KObj:/devices/virtual/block/dm-1 Env:map[ACTION:change DEVNAME:dm-1 DEVPATH:/devices/virtual/block/dm-1 DEVTYPE:disk DISKSEQ:19 DM_COOKIE:4194304 MAJOR:253 MINOR:1 SEQNUM:1253 SUBSYSTEM:block]}
writing udev state to /run/udev/data/b253:1
found a new device /dev/dm-1
udev event {Action:add KObj:/devices/virtual/bdi/253:2 Env:map[ACTION:add DEVPATH:/devices/virtual/bdi/253:2 SEQNUM:1254 SUBSYSTEM:bdi]}
udev event {Action:add KObj:/devices/virtual/block/dm-2 Env:map[ACTION:add DEVNAME:dm-2 DEVPATH:/devices/virtual/block/dm-2 DEVTYPE:disk DISKSEQ:20 MAJOR:253 MINOR:2 SEQNUM:1255 SUBSYSTEM:block]}
udev event does not contain DM_COOKIE
blkinfo for /dev/dm-1: type=swap UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx LABEL=
udev event {Action:change KObj:/devices/virtual/block/dm-2 Env:map[ACTION:change DEVNAME:dm-2 DEVPATH:/devices/virtual/block/dm-2 DEVTYPE:disk DISKSEQ:20 DM_COOKIE:4194304 MAJOR:253 MINOR:2 SEQNUM:1256 SUBSYSTEM:block]}
writing udev state to /run/udev/data/b253:2
2 logical volume(s) in volume group "vg0" now active
symlink /dev/dm-2 /dev/mapper/vg0-lv_root: file exists
I have the same problem on Alpine LVM on LUKS, I tested a custom booster to remove the return err when symlink exist (https://github.com/anatol/booster/commit/793fe44e37f0ee0d51efd78f9ea494ea23bedd5c?diff=split only udev.go modification is useful) and I can boot correctly when ignored. Maybe, we could handle it as a warning without stopping boot.
I want to find the root cause before proposing a patch.