[linux-lvm] Cannot delete lv

James B. Byrne byrnejb at harte-lyne.ca
Mon Jan 30 17:34:56 UTC 2012


On Mon, January 30, 2012 12:03, Bryn M. Reeves wrote:

>
> The partition maps were apparently created with kpartx's
> "-p p" option
> to force a partition separator of 'p' (the default is to
> use a 'p' if
> the device name ends with a numeral but no separator
> otherwise).
>
> If the maps were created with -pp kpartx will refuse to
> remove them if
> the option is not given (but helpfully doesn't report any
> error.. :-/):
>
> # ls /dev/mapper/vg_mother-lv_base*
> /dev/mapper/vg_mother-lv_base
> /dev/mapper/vg_mother-lv_basep1
> # kpartx -d /dev/mapper/vg_mother-lv_base
> # ls /dev/mapper/vg_mother-lv_base*
> /dev/mapper/vg_mother-lv_base
> /dev/mapper/vg_mother-lv_basep1
> # kpartx -d -pp /dev/mapper/vg_mother-lv_base
> # ls /dev/mapper/vg_mother-lv_base*
> /dev/mapper/vg_mother-lv_base
>
> Just add the -pp to your kpartx command lines and it
> should remove the
> devices.
>

[root at vhost01 ~]# kpartx -d -pp
/dev/mapper/vg_vhost01-lv_vm_base
[root at vhost01 ~]# kpartx -d -pp
/dev/mapper/vg_vhost01-lv_vm_basep1
failed to stat() /dev/mapper/vg_vhost01-lv_vm_basep1
[root at vhost01 ~]# /sbin/lvremove -f
/dev/vg_vhost01/lv_vm_base
  Logical volume "lv_vm_base" successfully removed

And repeated as required.

Success!  Thank you so very much. I would never have
discovered this on my own. Never.

[root at vhost01 ~]# dmsetup ls --tree
vg_vhost01-lv_swap (253:1)
 └─ (8:2)
vg_vhost01-lv_root (253:0)
 └─ (8:2)
vg_vhost01-lv_centos_repos (253:8)
 └─ (8:2)
vg_vhost01-lv_tmp (253:2)
 └─ (8:2)
vg_vhost01-lv_vm_inet02.harte--lyne.ca_00 (253:21)
 └─ (8:2)
vg_vhost01-lv_vm_inet03.harte--lyne.ca_00 (253:23)
 └─ (8:2)
vg_vhost01-lv_log (253:4)
 └─ (8:2)
vg_vhost01-lv_vm_inet04.harte--lyne.ca_00 (253:25)
 └─ (8:2)
vg_vhost01-lv_spool (253:3)
 └─ (8:2)
vg_vhost01-lv_vm_inet08.harte--lyne.ca_00 (253:24)
 └─ (8:2)
vg_vhost01-lv_vm_inet09.harte--lyne.ca_00 (253:22)
 └─ (8:2)

Everything appears clean now and I have confirmed that the
disk space has been returned to the virt-manager storage
pool.

Again, thank you.

-- 
***          E-Mail is NOT a SECURE channel          ***
James B. Byrne                mailto:ByrneJB at Harte-Lyne.ca
Harte & Lyne Limited          http://www.harte-lyne.ca
9 Brockley Drive              vox: +1 905 561 1241
Hamilton, Ontario             fax: +1 905 561 0757
Canada  L8E 3C3




More information about the linux-lvm mailing list