<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<style>
<!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:Arial;
        color:windowtext;}
@page Section1
        {size:595.3pt 841.9pt;
        margin:70.85pt 3.0cm 70.85pt 3.0cm;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

<body lang=ES link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>Yesterday I send this mail, but nobody has answer me:
<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>

<p class=MsoNormal><span class=q><font size=3 face="Times New Roman"><span
lang=EN-US style='font-size:12.0pt'>hello,  i write a little patch to add
a force (or recursive ?) option to vgremove </span></font></span><span
lang=EN-US><br>
<span class=q>i think  the semantic is better if you call vgremove -f
<vg>  than </span><br>
<span class=q>call lvremove <vg> and then vgremove <vg> </span><br>
<br>
<span class=q>Example:</span><br>
<br>
<o:p></o:p></span></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=EN-US
style='font-size:12.0pt'>(list lv’s)<br>
<span class=q>root@cobalto:/usr/local/src/LVM2/tools# lvm lvs</span><br>
<span class=q>  LV       
VG     Attr   LSize   Origin
Snap%  Move Log Copy% </span><br>
<span class=q>  lvprueba1 prueba -wi-a-
128.00M                             
</span><br>
<span class=q>  lvprueba2 prueba -wi-a-
128.00M                             
</span><br>
<span class=q>  lvprueba3 prueba -wi-a-
128.00M                             
</span><br>
<span class=q>  lvprueba4 prueba -wi-a-
128.00M                             
</span><br>
<br>
<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=EN-US
style='font-size:12.0pt'>(delete vg prueba: here is the point )<br>
<span class=q>root@cobalto:/usr/local/src/LVM2/tools# ./lvm vgremove -f prueba </span><br>
<span class=q>  Logical volume "lvprueba1" successfully removed</span><br>
<span class=q>  Logical volume "lvprueba2" successfully removed</span><br>
<span class=q>  Logical volume "lvprueba3" successfully removed</span><br>
<span class=q>  Logical volume "lvprueba4" successfully removed </span><br>
<span class=q>  Volume group "prueba" successfully removed</span><br>
<br>
<br>
root@cobalto:/usr/local/src/LVM2/tools# ./lvm lvs <br>
<span class=q>root@cobalto:/usr/local/src/LVM2/tools# </span><br>
root@cobalto:/usr/local/src/LVM2/tools# ./lvm vgdisplay prueba <br>
  Volume group "prueba" not found<br>
<br>
<br clear=all>
Sorry i dont know the procedure to submit a patch, this is my firt time ever a
send a patch to any gnu project. <br>
<br>
Thanks!<br>
<br>
Saludos<br>
-------------------------------------- <br>
Index: commands.h<br>
===================================================================<br>
RCS file: /cvs/lvm2/LVM2/tools/commands.h,v<br>
retrieving revision 1.98<br>
diff -u -r1.98 commands.h<br>
--- commands.h  1 Aug 2007 21:01:06 -0000      
1.98<br>
+++ commands.h  9 Aug 2007 02:28:01 -0000<br>
@@ -806,6 +806,7 @@<br>
 xx(vgremove,<br>
    "Remove volume group(s)",<br>
    "vgremove\n"<br>
+   "\t[-f|--force]\n"<br>
    "\t[-d|--debug]\n" <br>
    "\t[-h|--help]\n"<br>
    "\t[-t|--test]\n"<br>
@@ -813,7 +814,7 @@<br>
    "\t[--version]" "\n"<br>
    "\tVolumeGroupName [VolumeGroupName...]\n",<br>
 <br>
-   test_ARG) <br>
+   force_ARG,test_ARG)<br>
 <br>
 xx(vgrename,<br>
    "Rename a volume group",<br>
@@ -827,7 +828,7 @@<br>
    "\tOldVolumeGroupPath NewVolumeGroupPath |\n"<br>
    "\tOldVolumeGroupName NewVolumeGroupName\n", <br>
 <br>
-   autobackup_ARG, force_ARG, test_ARG)<br>
+   autobackup_ARG, test_ARG)<br>
 <br>
 xx(vgs,<br>
    "Display information about volume groups",<br>
Index: lvm.c<br>
<br>
Index: vgremove.c<br>
=================================================================== <br>
RCS file: /cvs/lvm2/LVM2/tools/vgremove.c,v<br>
retrieving revision 1.41<br>
diff -u -r1.41 vgremove.c<br>
--- vgremove.c  19 Jun 2007 04:36:12 -0000     
1.41<br>
+++ vgremove.c  9 Aug 2007 02:28:04 -0000<br>
@@ -34,9 +34,13 @@ <br>
        if (!vg_check_status(vg,
EXPORTED_VG))<br>
               
return ECMD_FAILED;<br>
 <br>
+       /* <br>
+        * If there is 1 or more lv print a
error<br>
+        * */<br>
        if (vg->lv_count) {<br>
               
log_error("Volume group \"%s\" still contains %d " <br>
                         
"logical volume(s)", vg_name, vg->lv_count);<br>
+<br>
               
return ECMD_FAILED;<br>
        }<br>
 <br>
@@ -84,21 +88,39 @@<br>
 int vgremove(struct cmd_context *cmd, int argc, char **argv) <br>
 {<br>
        int ret;<br>
-<br>
+    <br>
+<br>
        if (!argc) {<br>
               
log_error("Please enter one or more volume group paths");<br>
               
return EINVALID_CMD_LINE;<br>
        }<br>
-<br>
+    //printf("argv= %s \n", argv[0]);<br>
+    <br>
+       //printf("hostname = %s \n" ,
cmd->cmd_line);<br>
+<br>
+<br>
+<br>
+<br>
        if (!lock_vol(cmd, ORPHAN,
LCK_VG_WRITE)) {<br>
               
log_error("Can't get lock for orphan PVs"); <br>
               
return ECMD_FAILED;<br>
        }<br>
-<br>
+/* check  -f argument  */<br>
+       if( arg_count(cmd,force_ARG ) ) {<br>
+              
ret=lvremove(cmd,  argc, argv);<br>
+              
if( ret==1 ){<br>
+              
ret = process_each_vg(cmd, argc, argv, <br>
+                                                
<br>
+                                                
LCK_VG_WRITE | LCK_NONBLOCK,1,<br>
+                                                
NULL, & vgremove_single); <br>
+              
}<br>
+<br>
+       }<br>
+       else{<br>
        ret = process_each_vg(cmd, argc,
argv,<br>
                             
LCK_VG_WRITE | LCK_NONBLOCK, 1, <br>
                             
NULL, &vgremove_single); <br>
-<br>
+       }<br>
        unlock_vg(cmd, ORPHAN);<br>
 <br>
        return ret; <o:p></o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=EN-US
style='font-size:12.0pt'><br>
<br>
<span id="q_114488a032b965da_5"><span class=e>-- </span><br>
<span class=e>No vivas solo por que respiras, vive para cumplir tus sue~os </span></span><o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>

</div>

</body>

</html>

<table><tr><td bgcolor=#ffffff><font color=#000000>Este mensaje es exclusivamente para el uso de la persona o entidad a quien esta dirigido; contiene informacion estrictamente confidencial y legalmente protegida, cuya divulgacion es sancionada por la ley. Si el lector de este mensaje no es a quien esta dirigido, ni se trata del empleado o agente responsable de esta informacion, se le notifica por medio del presente, que su reproduccion y distribucion, esta estrictamente prohibida. Si Usted recibio este comunicado por error, favor de notificarlo inmediatamente al remitente y destruir el mensaje. Todas las opiniones contenidas en este mail son propias del autor del mensaje y no necesariamente coinciden con las de Radiomovil Dipsa, S.A. de C.V. o alguna de sus empresas controladas, controladoras, afiliadas y subsidiarias. Este mensaje intencionalmente no contiene acentos.<br>
</font></td></tr></table>
<table><tr><td bgcolor=#ffffff><font color=#000000>This message is for the sole use of the person or entity to whom it is being sent.  Therefore, it contains strictly confidential and legally protected material whose disclosure is subject to penalty by law.  If the person reading this message is not the one to whom it is being sent and/or is not an employee or the responsible agent for this information, this person is herein notified that any unauthorized dissemination, distribution or copying of the materials included in this facsimile is strictly prohibited.  If you received this document by mistake please notify  immediately to the subscriber and destroy the message. Any opinions contained in this e-mail are those of the author of the message and do not necessarily coincide with those of Radiomovil Dipsa, S.A. de C.V. or any of its control, controlled, affiliates and subsidiaries companies. No part of this message or attachments may be used or reproduced in any manner wha!
 tsoever.<
</font></td></tr></table>