From: Dave Wysochanski <dwysocha@redhat.com>
To: lvm-devel@redhat.com
Subject: vgremove -f option add
Date: Fri, 24 Aug 2007 13:01:02 -0400 [thread overview]
Message-ID: <1187974862.4339.20.camel@linux-cxyg> (raw)
In-Reply-To: <1187902565.4547.15.camel@linux-cxyg>
On Thu, 2007-08-23 at 16:56 -0400, Dave Wysochanski wrote:
> I did some cleanup work first and I've attached an updated patch against
> the latest code. Patch was tested against a simple cluster as well as
> single node and seems to work fine. Some sample output in a clustered
> environment:
>
> # lvs
> LV VG Attr LSize Origin Snap% Move Log Copy%
> LogVol00 VolGroup00 -wi-ao 5.84G
> LogVol01 VolGroup00 -wi-ao 1.03G
> lv0 vg0 -wi-a- 96.00M
> # vgs
> VG #PV #LV #SN Attr VSize VFree
> VolGroup00 1 2 0 wz--n- 6.91G 32.00M
> vg0 5 1 0 wz--nc 240.00M 144.00M
> # vgremove vg0
> Do you really want to remove volume group "vg0" with active logical volumes? [y/n]: n
> Volume group "vg0" not removed
> # vgremove -f vg0
> Error locking on node rhel4u5-node1: Volume is busy on another node
> Can't get exclusive access to volume "lv0"
> # vgremove vg0
> Do you really want to remove volume group "vg0" with active logical volumes? [y/n]: y
> Do you really want to remove active logical volume "lv0"? [y/n]: y
> Error locking on node rhel4u5-node1: Volume is busy on another node
> Can't get exclusive access to volume "lv0"
Updated patch attached that fixes the above case. Now we can remove LVs
that may be active on other nodes in the cluster:
[root at rhel4u5-node1 LVM2]# ./tools/lvm vgremove vg0
Do you really want to remove volume group "vg0" containing 1 logical
volumes? [y/n]: y
Error locking on node rhel4u5-node1: Volume is busy on another node
Logical volume "lv0" is active on other cluster nodes. Really remove?
[y/n]: y
Logical volume "lv0" successfully removed
Volume group "vg0" successfully removed
The new check seems ok even when another node has the LV open (e.g.
mounted) - the remove just fails at the deactivate_lv() call for the
node(s) that have it open:
[root at rhel4u5-node1 LVM2]# ./tools/lvm vgremove vg0
Do you really want to remove volume group "vg0" containing 1 logical
volumes? [y/n]: y
Error locking on node rhel4u5-node1: Volume is busy on another node
Logical volume "lv0" is active on other cluster nodes. Really remove?
[y/n]: y
Error locking on node rhel4u5-node3: LV vg0/lv0 in use: not
deactivating
Unable to deactivate logical volume "lv0"
Also cleaned up the first message "Do you really want to remove..." -
got rid of "active" word (at that point, we don't know any LVs are
active) and printed the number of LVs in the VG.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vgremove-f-current.patch
Type: text/x-patch
Size: 5824 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/lvm-devel/attachments/20070824/eb3a4079/attachment.bin>
prev parent reply other threads:[~2007-08-24 17:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-09 20:44 vgremove -f option add jorge alberto garcia gonzalez
2007-08-23 20:56 ` Dave Wysochanski
2007-08-24 17:01 ` Dave Wysochanski [this message]
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=1187974862.4339.20.camel@linux-cxyg \
--to=dwysocha@redhat.com \
--cc=lvm-devel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.