Package: kpartx
Version: 0.5.0-5
Severity: normal

Items loop0p1 and nbd0p1 existing in /dev/mapper, when issuing kpartx -d /dev/nbd0, loop0p1 disappears

Expected result is the command should only remove nbd0 mappings and not loop0p1

..
There's generally three ways I make mappings with kpartx when working with raw image files.
[attaching]
1- Use qemu-nbd, then apply kpartx on an /dev/nbdN device
2- Use losetup on a raw image, then apply kpartx on an /dev/loopN device
3- Use kpartx directly on a raw image file

There's a related concern if "kpart -d <>" should perform losetup after creating a mapping in 3- situation.

I've noticed the following when applying kpartx -d for each of the above scenarios

[detaching]
1- qemu-nbd -d /dev/nbdN would need to applied to fully remove the mapping (normal) 2- losetup -d /dev/loopN would need to be applied to fully remove the mapping (normal)

3- kpartx -d fully removes /dev/loopN and any /dev/mapper/loopNpM entries, so losetup -d is not needed

..
If testing this, in the way I set things up is as follows,

Use losetup on a raw image file containing a partition table
Use qemu-nbd on a separate image with a partition table

Issue kpartx -a /dev/nbd0
followed by kpartx -a /dev/loop0

Verify there are entries in /dev/mapper (nbd0pN, loop0pN ...)

Now issue kpartx -d /dev/nbd0, and notice /dev/mapper/loop0pN entries would also be removed(which shouldn't)


thanks


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to