[linux-lvm] Unable to remove LVs

Bryn M. Reeves bmr at redhat.com
Tue Nov 15 11:16:34 UTC 2011


On 11/15/2011 11:07 AM, Bryn M. Reeves wrote:
> On 11/15/2011 06:44 AM, Jan Bakuwel wrote:
>> Hi Bryn,
>>
>>> The partition map has a 'p' separator - d-pdc.oa.cp1 - the correct
>>> command is:
>>>
>>> kpartx -d /dev/mapper/d-pdc.oa.c
>>
>> # kpartx -d /dev/mapper/d-pdc.oa.c
>
> It's possible kpartx is getting confused and is refusing to remove the
> maps if they still exist after running this command.

That seems to be the case:

# vgcreate d /dev/loop0
   Volume group "d" successfully created
# lvcreate -n pdc.oa.c -L 4m d
   Logical volume "pdc.oa.c" created
# fdisk /dev/d/pdc.oa.c
[...]
# kpartx -l /dev/mapper/d-pdc.oa.c
d-pdc.oa.c1 : 0 8191 /dev/mapper/d-pdc.oa.c 1
# ls /dev/mapper/d-pdc.oa.c*
/dev/mapper/d-pdc.oa.c  /dev/mapper/d-pdc.oa.cp1
# kpartx -d /dev/mapper/d-pdc.oa.c
# kpartx -l /dev/mapper/d-pdc.oa.c
d-pdc.oa.c1 : 0 8191 /dev/mapper/d-pdc.oa.c 1
# ls /dev/mapper/d-pdc.oa.c*
/dev/mapper/d-pdc.oa.c  /dev/mapper/d-pdc.oa.cp1

It does the right thing if you specify the partition separator on the 
command line:

# kpartx -d -pp /dev/mapper/d-pdc.oa.c
# ls /dev/mapper/d-pdc.oa.c
/dev/mapper/d-pdc.oa.c

Regards,
Bryn.




More information about the linux-lvm mailing list