I wiped (erased from device) all partitions from a logical volume (lv in LVM). Then I did partprobe -s (and other similar commands: partprobe returned no output, partx said partition: none & failed to read partition table). The problem I had is that I could neither do:
mkfs /dev/vg/lvbecause/dev/vg/lv is apparently in use by the system; will not make a filesystem here!lvremove /dev/vg/lvthe device becauseLogical volume vg/lv is used by another device.
This is because the kernel still sees a partition within the lv block device:
# grep dm /proc/partitions
254 0 85852160 dm-0
254 1 84850688 dm-1
and
# ls -lh /dev/dm-*
brw-rw---T 1 root disk 254, 0 May 23 14:32 /dev/dm-0
brw-rw---T 1 root disk 254, 1 May 23 14:08 /dev/dm-1
I finally rebooted the machine, which resolved my problem (kernel did not see non-existent partition anymore).
Do you know a way to solve this without having to reboot?
Tested on a 3.2 kernel.