Re: [Vserver] lvremove: "Can't remove open logical volume"

2006-09-19 Thread Herbert Poetzl
On Tue, Sep 19, 2006 at 01:29:26PM +0200, Mehdi Bennani wrote:
>  SOLVED ! ! ! 
> 
> Hi all,
> 
> I just found out that
> vnamespace -e [namespace of context ] umount /your/lvm/volume
> must be performed TWO times in each namespace:
> 
> -with /your/lvm/volume as the mountpoint, i.e /vservers/vs01
> -with /your/lvm/volume as the lvm device, i.e /dev/volume1/vs01
> 
> Then I have to umount BOTH mountpoint and lvm device on the host
> system for the lvremove command to work.

hmm, somehow I doubt that. if possible, double check
with 'cat /proc/mounts' inside the guest that the 
first one is the correct path, IMHO the second one
should be sufficient ...

> Again, thank you so much for your help and for your work on the
> vserver project!

you're welcome!

> Best regards,

best,
Herbert

> Mehdi Bennani
> ___
> Vserver mailing list
> Vserver@list.linux-vserver.org
> http://list.linux-vserver.org/mailman/listinfo/vserver
___
Vserver mailing list
Vserver@list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver


Re: [Vserver] lvremove: "Can't remove open logical volume"

2006-09-19 Thread Mehdi Bennani

 SOLVED ! ! ! 

Hi all,

I just found out that
vnamespace -e [namespace of context ] umount /your/lvm/volume
must be performed TWO times in each namespace:

-with /your/lvm/volume as the mountpoint, i.e /vservers/vs01
-with /your/lvm/volume as the lvm device, i.e /dev/volume1/vs01

Then I have to umount BOTH mountpoint and lvm device on the host
system for the lvremove command to work.

Again, thank you so much for your help and for your work on the vserver project!


Best regards,



Mehdi Bennani
___
Vserver mailing list
Vserver@list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver


Re: [Vserver] lvremove: "Can't remove open logical volume"

2006-09-19 Thread Mehdi Bennani
Hi Christian and Rik,
 
Thank you for the "umounting in all namespaces" solution,  it seems to partially solve the problem. But, for a reason I can't understand, some logical volunes still remain open even after performing vnamespace -e [xid] umount for each running context.

 
Best regards,Mehdi 
2006/9/15, Christian Affolter <[EMAIL PROTECTED]>:
>  > Try to unmount your volume for each active name space:>  > vnamespace -e [namespace of context ] umount /your/lvm/volume
>>> Thanks a lot, but my lv's are the root of each vserver so I have to stop> them before umounting, then the namespace is no longer in use and I get:> vnamespace: vc_enter_namespace(): No such process
You will have to unmount the lvms in all the _remaining_ name spaces...Use vserver-stat to list all running vservers (active name spaces) andperform vnamespace -e [xid] umount for each one.___
Vserver mailing listVserver@list.linux-vserver.orghttp://list.linux-vserver.org/mailman/listinfo/vserver

___
Vserver mailing list
Vserver@list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver


Re: [Vserver] lvremove: "Can't remove open logical volume"

2006-09-19 Thread Mehdi Bennani

Hello, thanks a lot for your answer.


You can see this message posted by Daniel Hokka Zakrisson :
http://archives.linux-vserver.org/200607/0139.html . His web site has this
patch and some others. The debian package integrates it with others.



I tried to apply the patch over 0.30.210 source and recompile, but the
problem is still here.
___
Vserver mailing list
Vserver@list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver


Re: [Vserver] lvremove: "Can't remove open logical volume"

2006-09-17 Thread Herbert Poetzl
On Fri, Sep 15, 2006 at 11:25:46AM +0200, Mehdi Bennani wrote:
> Hi,
> 
> 
> >Try to unmount your volume for each active name space:
> >vnamespace -e [namespace of context ] umount /your/lvm/volume
> 
> Thanks a lot, but my lv's are the root of each vserver so I have to stop
> them before umounting, then the namespace is no longer in use and I get:
> vnamespace: vc_enter_namespace(): No such process
> 
> Obviously if I try it before stopping the vserver, I get:
> umount: /vservers/vtest3: device is busy
> 

probably the best way to get this right is by
_not_ mounting the volume yourself, but letting
the tools mount it from the fstab (in the guest
configuration)

HTH,
Herbert

> Regards,
> 
> Mehdi

> ___
> Vserver mailing list
> Vserver@list.linux-vserver.org
> http://list.linux-vserver.org/mailman/listinfo/vserver

___
Vserver mailing list
Vserver@list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver


Re: [Vserver] lvremove: "Can't remove open logical volume"

2006-09-15 Thread Xavier Montagutelli
On Friday 15 September 2006 11:38, Rik Bobbaers wrote:
> Mehdi Bennani wrote:
> > Hi,
> > Thanks a lot, but my lv's are the root of each vserver so I have to stop
> > them before umounting, then the namespace is no longer in use and I get:
> > vnamespace: vc_enter_namespace(): No such process
> >
> >
> > Obviously if I try it before stopping the vserver, I get:
> > umount: /vservers/vtest3: device is busy
>
> if you stop a vserver, the namespace is gone. so that's never the
> problem. but the OTHER running virtual servers still have the dir
> mounted in its namespace. that's why my script loops over all the
> running namespaces, and unmounts them there.
[..]

The first time I encountered this, it took me hours to find the trick ... To 
avoid this sort of problem, there's a patch against util-vserver, called 
"namespace cleanup".

You can see this message posted by Daniel Hokka Zakrisson : 
http://archives.linux-vserver.org/200607/0139.html . His web site has this 
patch and some others. The debian package integrates it with others.

Is there any plan to integrate it into the next "official" version of 
util-vserver ? IMHO, it would be usefull.

PS : thanks to the team who took time to renew the web site !

-- 
Xavier Montagutelli  Tel : +33 (0)5 55 45 77 20
Service Commun Informatique  Fax : +33 (0)5 55 45 75 95
Universite de Limoges
123, avenue Albert Thomas
87060 Limoges cedex
___
Vserver mailing list
Vserver@list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver


Re: [Vserver] lvremove: "Can't remove open logical volume"

2006-09-15 Thread Rik Bobbaers

Mehdi Bennani wrote:


Hi,
Thanks a lot, but my lv's are the root of each vserver so I have to stop 
them before umounting, then the namespace is no longer in use and I get:

vnamespace: vc_enter_namespace(): No such process
 
 
Obviously if I try it before stopping the vserver, I get:

umount: /vservers/vtest3: device is busy


if you stop a vserver, the namespace is gone. so that's never the 
problem. but the OTHER running virtual servers still have the dir 
mounted in its namespace. that's why my script loops over all the 
running namespaces, and unmounts them there.


i just adapted my script to:
gandalf:/var/log# cat /usr/local/bin/unmount_vserver
#!/bin/sh
if [ -n "$1" ]
then
  for i in `ls -1 /proc/virtual | egrep -v 'info|status'`; do 
vnamespace -e $i umount $1; done

  umount $1
  exit 0;
fi
exit 1;
EOF

if you use this, you can safely remove the logical volume without having 
that problem.

ps. i have the same setup as you... 1 LV per vserver :)

greetz

--
harry
aka Rik Bobbaers

K.U.Leuven - LUDIT  -=- Tel: +32 485 52 71 50
[EMAIL PROTECTED] -=- http://harry.ulyssis.org

"Work hard and do your best, it'll make it easier for the rest"
-- Garfield

Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm

___
Vserver mailing list
Vserver@list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver


Re: [Vserver] lvremove: "Can't remove open logical volume"

2006-09-15 Thread Christian Affolter

 > Try to unmount your volume for each active name space:
 > vnamespace -e [namespace of context ] umount /your/lvm/volume
 
 
Thanks a lot, but my lv's are the root of each vserver so I have to stop 
them before umounting, then the namespace is no longer in use and I get:

vnamespace: vc_enter_namespace(): No such process

You will have to unmount the lvms in all the _remaining_ name spaces...

Use vserver-stat to list all running vservers (active name spaces) and 
perform vnamespace -e [xid] umount for each one.


___
Vserver mailing list
Vserver@list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver


Re: [Vserver] lvremove: "Can't remove open logical volume"

2006-09-15 Thread Mehdi Bennani
Hi,
 
 
> Try to unmount your volume for each active name space:> vnamespace -e [namespace of context ] umount /your/lvm/volume
 
 
Thanks a lot, but my lv's are the root of each vserver so I have to stop them before umounting, then the namespace is no longer in use and I get:
vnamespace: vc_enter_namespace(): No such process
 
 
Obviously if I try it before stopping the vserver, I get:umount: /vservers/vtest3: device is busy
 
Regards,
 
 
Mehdi
 
___
Vserver mailing list
Vserver@list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver


Re: [Vserver] lvremove: "Can't remove open logical volume"

2006-09-15 Thread Rik Bobbaers

> Try to unmount your volume for each active name space:
> vnamespace -e [namespace of context ] umount /your/lvm/volume

i "scripted" it like this:
gandalf:~# cat /usr/local/bin/unmount_vserver
#!/bin/sh
if [ -n "$1" ]
then
  for i in `ls -1 /proc/virtual | egrep -v 'info|status'`; do 
vnamespace -e $i umount $1; done

  exit 0;
fi
exit 1;

you just do unmount_vserver /vservers/bleh
and it makes sure it's unmounted in all namespaces.

it doesn't do much checking, but you get the picture, feel free to add 
more sanity/safety checks ;)


greetz,

--
harry
aka Rik Bobbaers

K.U.Leuven - LUDIT  -=- Tel: +32 485 52 71 50
[EMAIL PROTECTED] -=- http://harry.ulyssis.org

"Work hard and do your best, it'll make it easier for the rest"
-- Garfield

Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm

___
Vserver mailing list
Vserver@list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver


Re: [Vserver] lvremove: "Can't remove open logical volume"

2006-09-15 Thread Christian Affolter

Hi!


I am setting up a host with LVM volumes for each vserver.

I made scripts for vserver creation which include on-the-fly Logical 
Volume creation, formating and mount, that works pretty well.


Things are getting worse when I try to delete a Logical Volume after 
having the vserver stopped and its partition umounted:


I randomly get this error:

"Can't remove open logical volume"

Because it's probably still mounted in your other active namespaces...



The Logical Volume seems actually umounted because cat /proc/mounts 
doesn't mention it, but *something* is still using it and I cannot 
figure out what.


A reboot of the host corrects the problem but I can't reboot the whole 
system each time I need to delete a vserver.

Try to unmount your volume for each active name space:
vnamespace -e [namespace of context ] umount /your/lvm/volume


Hope this helps.

regards,
Chris


___
Vserver mailing list
Vserver@list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver