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-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 xid] 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

 SOLVED ! ! ! 

Hi all,

I just found out that
vnamespace -e [namespace of context xid] 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 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 xid] 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-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 xid] 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


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

2006-09-15 Thread Mehdi Bennani
Hello,
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
Here are basic examples of the scripts:
CREATIONusage:vcreate [name]
#!/bin/bashlvcreate -L5000 -n$1 vg0mkreiserfs -f /dev/vg0/$1mkdir /vservers/$1mount /dev/vg0/$1 /vservers/$1vserver $1 build -m skeleton 


DELETIONusage:vdelete [name]
#!/bin/bashvserver $1 stoplsof /vservers/$1umount -f /vservers/$1lvremove -f /dev/vg0/$1
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.
I have found a log chat at http://irc.13thfloor.at/LOG/2006-04/LOG_2006-04-22.txt
 where someone was experiencing exaclty the same problem but no solution was found at the moment. 
Thanks in advance for any help or ideas!
Regards,
Mehdi Bennani

=system info==
vserver:~# vserver-infoVersions: Kernel: 2.6.12lvs VS-API: 0x00020001 util-vserver: 0.30.210; Jun 11 2006, 14:57:10
Features: CC: gcc, gcc (GCC) 3.3.5 (Debian 1:3.3.5-13) CXX: g++, g++ (GCC) 3.3.5 (Debian 1:3.3.5-13) CPPFLAGS: '' CFLAGS: '-Wall -g -O2 -std=c99 -Wall -pedantic -W' 
 CXXFLAGS: '-g -O2 -ansi -Wall -pedantic -W -fmessage-length=0' build/host: i386-pc-linux-gnu/i386-pc-linux-gnu Use dietlibc: yes Build C++ programs: yes
 Build C99 programs: yes Available APIs: compat,v11,fscompat,v13,net,oldproc,olduts ext2fs Source: e2fsprogs syscall(2) invocation: alternative vserver(2) syscall#: 273/glibc 

Paths: prefix: /usr sysconf-Directory: /etc cfg-Directory: /etc/vservers initrd-Directory: $(sysconfdir)/init.d pkgstate-Directory: /var/run/vservers 
 vserver-Rootdir: /var/lib/vservers
___
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 xid] 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


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 xid] 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 Mehdi Bennani
Hi,


 Try to unmount your volume for each active name space: vnamespace -e [namespace of context xid] 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 Christian Affolter

  Try to unmount your volume for each active name space:
  vnamespace -e [namespace of context xid] 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 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 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