* [linux-lvm] lvm2 vgchange -a n problem
@ 2004-03-05 18:58 Michael Ossmann
2004-03-08 4:36 ` Joe Thornber
0 siblings, 1 reply; 3+ messages in thread
From: Michael Ossmann @ 2004-03-05 18:58 UTC (permalink / raw)
To: linux-lvm
I'm using lvm2 with linux 2.6.4-rc1. When I try to
deactivate lvm with 'vgchange -a n' it always tells me:
LV vgfoo/lvbar in use: not removing
even when the lv is not mounted at all. So I try to
'lvchange -a n' the lv, but it tells me the same thing.
My workaround is to do 'dmsetup remove vgfoo-lvbar' for each
lv prior to deactivation. Then 'vgchange -a n' and
'lvchange -a n' work. My shutdown script includes:
for lv in $(lvs --noheadings | awk '{print $2 "-" $1}'); do
dmsetup remove $lv
done
/sbin/vgchange -a n
Is this how I'm supposed to do this? Am I missing
something?
Thanks,
mossmann
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [linux-lvm] lvm2 vgchange -a n problem
2004-03-05 18:58 [linux-lvm] lvm2 vgchange -a n problem Michael Ossmann
@ 2004-03-08 4:36 ` Joe Thornber
2004-03-10 16:14 ` Michael Ossmann
0 siblings, 1 reply; 3+ messages in thread
From: Joe Thornber @ 2004-03-08 4:36 UTC (permalink / raw)
To: linux-lvm
On Fri, Mar 05, 2004 at 04:59:58PM -0700, Michael Ossmann wrote:
> Is this how I'm supposed to do this?
No. There's a couple of things you could try:
i) do a 'dmsetup info <dev>' and confirm that the 'open count' is 0
ii) use 'lsof' to find out who has opened the device.
Device mapper uses reference counting on the devices, so you will
always be able to remove the device successfully, but it wont really
be destroyed until the last opener closes it.
- Joe
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [linux-lvm] lvm2 vgchange -a n problem
2004-03-08 4:36 ` Joe Thornber
@ 2004-03-10 16:14 ` Michael Ossmann
0 siblings, 0 replies; 3+ messages in thread
From: Michael Ossmann @ 2004-03-10 16:14 UTC (permalink / raw)
To: linux-lvm
On Mon, Mar 08, 2004 at 09:39:19AM +0000, Joe Thornber wrote:
>
> i) do a 'dmsetup info <dev>' and confirm that the 'open count' is 0
# dmsetup info
Name: pvfoo
State: ACTIVE
Tables present: LIVE
Open count: 3
Event number: 0
Major, minor: 254, 1
Number of targets: 1
Name: vgfoo-lvfoo
State: ACTIVE
Tables present: LIVE
Open count: 0
Event number: 0
Major, minor: 254, 3
Number of targets: 1
UUID: [snipped]
Name: vgfoo-lvbar
State: ACTIVE
Tables present: LIVE
Open count: 1
Event number: 0
Major, minor: 254, 2
Number of targets: 1
UUID: [snipped]
> ii) use 'lsof' to find out who has opened the device.
# lsof /dev/mapper/vgfoo-lvfoo
# lsof /dev/mapper/vgfoo-lvbar
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
[snipped many lines of output]
# lvchange -a n vgfoo/lvfoo
LV vgfoo/lvfoo in use: not removing
Hmmmm. Looks to me like it shouldn't be complaining. I
don't know if this would affect anything at the lv layer,
but the only unusual thing here is that my pv happens to be
built on top of device mapper (dm-crypt). Everything has
been working fine except for lv and vg deactivation.
mossmann
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-03-10 21:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-05 18:58 [linux-lvm] lvm2 vgchange -a n problem Michael Ossmann
2004-03-08 4:36 ` Joe Thornber
2004-03-10 16:14 ` Michael Ossmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox