I tried to follow How to mount LVM images — Qubes OS Documentation but run into cleanup issues.
Reproducible example on QOs4.3:
#@dom0
# `A` (shut down) an `B` (running) are AppVMs. We want to mount A's private volume in B.
set -eux
SOURCE_VM="A"
DEST_VM="B"
YOUR_LVM_VG="qubes_dom0"
YOUR_LVM_IMAGE="vm-${SOURCE_VM}-private"
dev=$(basename $(readlink /dev/$YOUR_LVM_VG/$YOUR_LVM_IMAGE))
qubesdb-write /qubes-block-devices/$dev/desc "$YOUR_LVM_IMAGE"
qvm-block attach $DEST_VM dom0:$dev
qvm-block detach $DEST_VM dom0:$dev
qubesdb-rm /qubes-block-devices/$dev/
This works “fine” from a functional POV, but afterwards in the devices GUI under “Block Storage” there remains an entry Block_storage: hosted by dom0 vm-TMP A-private which was not there before.
How should I properly cleanup this state ?
Thank you.