linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
From: "James B. Byrne" <byrnejb@harte-lyne.ca>
To: linux-lvm@redhat.com
Subject: [linux-lvm] Cannot delete lv
Date: Mon, 30 Jan 2012 10:44:19 -0500	[thread overview]
Message-ID: <c7cbb6bbd7b1bb221f1939dc180f29cd.squirrel@webmail.harte-lyne.ca> (raw)

CentOS-6.2

lvm2-2.02.87-6.el6

qemu-kvm-0.12.1.2-2.209.el6_2.1

I have encountered a problem deleting logical volumes
associated with kvm guests that have been removed.  These
guest virtual machines were deleted because somehow each
had become able to see some of the VirtIO disks assigned
as physical volumes to the others.

It was suggested to me that this may have been caused by
attempting to add a new VirtIO disk created through
virt-manager as a physical device before it was initially
partitioned.  Surprisingly, if this is indeed the case,
virt-manager does not initially partition VirtIO disks, as
it does IDE virtual disks.

However, whatever the proximate or root causes are, when
the damaged guests were removed via virt-manager, together
with their storage, the guest vms were removed but the
lvremove command failed to remove the assigned storage:

 /sbin/lvremove -f /dev/vg_vhost01/lv_vm_base
    Can't remove open logical volume "lv_vm_base"

This pattern of failure repeated because the device showed
that was opened by two processes.

[root@vhost01 ~]#  dmsetup info -c vg_vhost01-lv_vm_base
Name                  Maj Min Stat Open Targ Event  UUID
vg_vhost01-lv_vm_base 253   5 L--w    2    1      0
LVM-gXMt00E1RDjpSX3INLZ35Prtg66aX36BeAOlKIkmfSNQRNol3Hni920R4YVaZr52

However, these processes seem to be invisible to me:

[root@vhost01 ~]#
[root@vhost01 ~]# fuser /dev/vg_vhost01/lv_vm_base
[root@vhost01 ~]#
[root@vhost01 ~]# lsof /dev/vg_vhost01/lv_vm_base
[root@vhost01 ~]#
[root@vhost01 ~]# umount /dev/vg_vhost01/lv_vm_base
umount: /dev/vg_vhost01/lv_vm_base: not mounted
[root@vhost01 ~]#
[root@vhost01 ~]# /sbin/lvremove -f
/dev/vg_vhost01/lv_vm_base
  Can't remove open logical volume "lv_vm_base"
[root@vhost01 ~]#

It was suggested on the centos-virt mailing list that I
try using dmsetup to suspend this device:

[root@vhost01 ~]# dmsetup suspend vg_vhost01-lv_vm_base
[root@vhost01 ~]#
[root@vhost01 ~]# dmsetup info -c vg_vhost01-lv_vm_base
Name                  Maj Min Stat Open Targ Event  UUID
vg_vhost01-lv_vm_base 253   5 L-sw    2    1      0
LVM-gXMt00E1RDjpSX3INLZ35Prtg66aX36BeAOlKIkmfSNQRNol3Hni920R4YVaZr52
[root@vhost01 ~]#

Which apparently had no effect:

[root@vhost01 ~]#  dmsetup info -c vg_vhost01-lv_vm_base
Name                  Maj Min Stat Open Targ Event  UUID
vg_vhost01-lv_vm_base 253   5 L-sw    2    1      0
LVM-gXMt00E1RDjpSX3INLZ35Prtg66aX36BeAOlKIkmfSNQRNol3Hni920R4YVaZr52

However, now when I run lvremove, the command simply
becomes unresponsive and does not return, even when a ^C
interrupt is attempted.

[root@vhost01 ~]#  /sbin/lvremove -f
/dev/vg_vhost01/lv_vm_base

^C
^C


On another terminal, after some 15 minutes of waiting, I
see this:

[root@vhost01 ~]# ps -ef | grep remove
root      1460   307  0 10:07 pts/0    00:00:00
/sbin/lvremove -f /dev/vg_vhost01/lv_vm_base


How do I delete these logical volumes, for there are three
of them?

-- 
***          E-Mail is NOT a SECURE channel          ***
James B. Byrne                mailto:ByrneJB@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

             reply	other threads:[~2012-01-30 15:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-30 15:44 James B. Byrne [this message]
2012-01-30 15:57 ` [linux-lvm] Cannot delete lv James B. Byrne
2012-01-30 16:00   ` Bryn M. Reeves
2012-01-30 16:00 ` Bryn M. Reeves
2012-01-30 16:25   ` James B. Byrne
2012-01-30 16:30     ` Bryn M. Reeves
2012-01-30 16:50       ` James B. Byrne
2012-01-30 17:03         ` Bryn M. Reeves
2012-01-30 17:34           ` James B. Byrne

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c7cbb6bbd7b1bb221f1939dc180f29cd.squirrel@webmail.harte-lyne.ca \
    --to=byrnejb@harte-lyne.ca \
    --cc=linux-lvm@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).