linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
* [linux-lvm] problems with vgscan
@ 2000-03-24 19:00 jorg de jong
  2000-03-25 14:03 ` Heinz Mauelshagen
  0 siblings, 1 reply; 7+ messages in thread
From: jorg de jong @ 2000-03-24 19:00 UTC (permalink / raw)
  To: linux-lvm

[-- Attachment #1: Type: text/plain, Size: 1258 bytes --]

Hello,

I am experiencing problems while doing a vgscan, attached I have
included a debug trace for
details.

In short this is what I get :

vgscan -- ERROR "parameter error" with special file /dev/vg01/usr
vgscan -- ERROR "parameter error" creating volume group directory and
special files
vgscan -- ERROR "parameter error" creating "/etc/lvmtab" and
"/etc/lvmtab.d"

and I am not able to activate my vg's :-((((.


My config is:
2 disk, complete pv's 
1 disk, with 9 linux and dos partitions and 2 pv partitions.

3 volume groups 
	vg00 complete disk 1
	vg02 complete disk 2
	vg01 with the two partitions from the remaining disk

vg00 has one logical volume(home)
vg01 has two logical volume's(usr and tmp)
vg02 has one logical volume(lv00)


When I change the partition ID;s from the pv partitions in vg01, from 8e
to 83,
(making then invisible to LVM) vgscan completes normal.

During the creation of vg01 I renamed one of the lv's but other than
that I did nothing
special to it.


During the creation of vg01 I was able to access the lv but as soon as I
rebooted 
the problems began.

The kernel I am using it 2.3.99.pre2 but found the same problem when
using 2.3.49.

If I need to provide more info i'll be more than happy to.

regards,

Jorg de Jong.

[-- Attachment #2: vgscan.trace.gz --]
[-- Type: application/x-gzip, Size: 14078 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [linux-lvm] problems with vgscan
  2000-03-24 19:00 [linux-lvm] problems " jorg de jong
@ 2000-03-25 14:03 ` Heinz Mauelshagen
  0 siblings, 0 replies; 7+ messages in thread
From: Heinz Mauelshagen @ 2000-03-25 14:03 UTC (permalink / raw)
  To: jorg de jong; +Cc: mge, linux-lvm


Hi Jorg,

thanks for profiding the "vgscan -d" output.

In line 10588 of the trace i was able to see that lv_check_consistency()
finds an inconsistency of the access parameter of logical volume /dev/vg01/usr.

This parameter is almost checked first in lv_check_consistency() so it
could be possible, that your VGDA on disk was accidently destroyed.

To check this assumption could you please provide a "pvdata -a" of all
PVs of vg01?

Please keep the intact backups of the VGDA in /etc/lvmconf/!

Thanks,
Heinz

> Hello,
> 
> I am experiencing problems while doing a vgscan, attached I have
> included a debug trace for
> details.
> 
> In short this is what I get :
> 
> vgscan -- ERROR "parameter error" with special file /dev/vg01/usr
> vgscan -- ERROR "parameter error" creating volume group directory and
> special files
> vgscan -- ERROR "parameter error" creating "/etc/lvmtab" and
> "/etc/lvmtab.d"
> 
> and I am not able to activate my vg's :-((((.
> 
> 
> My config is:
> 2 disk, complete pv's 
> 1 disk, with 9 linux and dos partitions and 2 pv partitions.
> 
> 3 volume groups 
> 	vg00 complete disk 1
> 	vg02 complete disk 2
> 	vg01 with the two partitions from the remaining disk
> 
> vg00 has one logical volume(home)
> vg01 has two logical volume's(usr and tmp)
> vg02 has one logical volume(lv00)
> 
> 
> When I change the partition ID;s from the pv partitions in vg01, from 8e
> to 83,
> (making then invisible to LVM) vgscan completes normal.
> 
> During the creation of vg01 I renamed one of the lv's but other than
> that I did nothing
> special to it.
> 
> 
> During the creation of vg01 I was able to access the lv but as soon as I
> rebooted 
> the problems began.
> 
> The kernel I am using it 2.3.99.pre2 but found the same problem when
> using 2.3.49.
> 
> If I need to provide more info i'll be more than happy to.
> 
> regards,
> 
> Jorg de Jong.

[application/x-gzip is not supported, skipping...]


-- 

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Systemmanagement TS                              T-Nova
                                                 Entwicklungszentrum Darmstadt
Heinz Mauelshagen                                Otto-Roehm-Strasse 71c
Senior Systems Engineer                          Postfach 10 05 41
                                                 64205 Darmstadt
mge@EZ-Darmstadt.Telekom.de                      Germany
                                                 +49 6151 886-425
                                                          FAX-386
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [linux-lvm] Problems with vgscan
@ 2001-03-09 23:31 Lukasz Trabinski
  2001-03-10  0:04 ` Andreas Dilger
  0 siblings, 1 reply; 7+ messages in thread
From: Lukasz Trabinski @ 2001-03-09 23:31 UTC (permalink / raw)
  To: linux-lvm

Hello

I have problems with the vgscan ( Linux, kernel 2.4.2 and 2.4.1)

[root@xxx tools]# vgscan
vgscan -- reading all physical volumes (this may take a while...)
vgscan -- found inactive volume group "test"
vgscan -- ERROR "vg_read_with_pv_and_lv(): allocated LE of LV" can't get
data of volume group "test" from physical volume(s)
vgscan -- ERROR "vg_read_with_pv_and_lv(): allocated LE of LV" creating
"/etc/lvmtab" and "/etc/lvmtab.d"

I have appled patch from posted to this list (diff -u -r1.3.2.3
tools/lib/pv_read_all_pv_of_vg.c)

Comments line from the

#if 0
 /* in case this PV already holds a uuid list: check against this  list */

to line:

#endif
      /* avoid multiple access pathes */


Recompiled all tools from LVM (0.9 version), and I have done

[root@xxx /root]# vgcfgrestore /dev/hdh1 -n test
vgcfgrestore -- VGDA for "mp3" successfully restored to physical volume
"/dev/hdh1"

[root@xxx /root]# vgcfgrestore /dev/hdg1 -n test
vgcfgrestore -- VGDA for "mp3" successfully restored to physical volume
"/dev/hdg1"

And I have still problems with the vgscan:

[root@xxx tools]# vgscan
vgscan -- reading all physical volumes (this may take a while...)
vgscan -- found inactive volume group "test"
vgscan -- ERROR "vg_read_with_pv_and_lv(): allocated LE of LV" can't get
data of volume group "test" from physical volume(s)
vgscan -- ERROR "vg_read_with_pv_and_lv(): allocated LE of LV" creating
"/etc/lvmtab" and "/etc/lvmtab.d"

[root@xxx tools]# vgdisplay
vgdisplay -- ERROR: "/etc/lvmtab" doesn't exist; please run vgscan

[root@xxx tools]# pvscan
pvscan -- reading all physical volumes (this may take a while...)
pvscan -- inactive PV "/dev/hdg1"  is associated to an unknown VG (run
vgscan)
pvscan -- inactive PV "/dev/hdh1"  is associated to an unknown VG (run
vgscan)
pvscan -- total: 2 [65.89 GB] / in use: 2 [65.89 GB] / in no VG: 0 [0]


Any sugestions? Have I lost my all data from 65.89 GB?!



--
*[ �ukasz Tr�bi�ski ]*
SysAdmin @polvoice.com

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [linux-lvm] Problems with vgscan
  2001-03-09 23:31 [linux-lvm] Problems with vgscan Lukasz Trabinski
@ 2001-03-10  0:04 ` Andreas Dilger
  2001-03-10  0:36   ` Lukasz Trabinski
  0 siblings, 1 reply; 7+ messages in thread
From: Andreas Dilger @ 2001-03-10  0:04 UTC (permalink / raw)
  To: linux-lvm

£ukasz Tr±biñski writes:
> I have problems with the vgscan ( Linux, kernel 2.4.2 and 2.4.1)
> 
> [root@xxx tools]# vgscan
> vgscan -- reading all physical volumes (this may take a while...)
> vgscan -- found inactive volume group "test"
> vgscan -- ERROR "vg_read_with_pv_and_lv(): allocated LE of LV" can't get
> data of volume group "test" from physical volume(s)
> vgscan -- ERROR "vg_read_with_pv_and_lv(): allocated LE of LV" creating
> "/etc/lvmtab" and "/etc/lvmtab.d"

Please run "vgscan -v -d" and post the output (compressed if very long).

> I have appled patch from posted to this list (diff -u -r1.3.2.3
> tools/lib/pv_read_all_pv_of_vg.c)

Not related to this problem.

Cheers, Andreas
-- 
Andreas Dilger  \ "If a man ate a pound of pasta and a pound of antipasto,
                 \  would they cancel out, leaving him still hungry?"
http://www-mddsp.enel.ucalgary.ca/People/adilger/               -- Dogbert

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [linux-lvm] Problems with vgscan
  2001-03-10  0:04 ` Andreas Dilger
@ 2001-03-10  0:36   ` Lukasz Trabinski
  2001-03-12 14:16     ` Lukasz Trabinski
  2001-03-12 18:25     ` Andreas Dilger
  0 siblings, 2 replies; 7+ messages in thread
From: Lukasz Trabinski @ 2001-03-10  0:36 UTC (permalink / raw)
  To: linux-lvm

[-- Attachment #1: Type: TEXT/PLAIN, Size: 296 bytes --]

On Fri, 9 Mar 2001, Andreas Dilger wrote:
>
> Please run "vgscan -v -d" and post the output (compressed if very long).

OK. There is gzipped output from vgscan -v -d
I'm posting patched pv_read_all_pv_of_vg.c, too verify it.


-- 
*[ �ukasz Tr�bi�ski ]*
SysAdmin @polvoice.com


[-- Attachment #2: Type: TEXT/PLAIN, Size: 6406 bytes --]

/*
 * tools/lib/pv_read_all_pv_of_vg.c
 *
 * Copyright (C) 1997 - 2000  Heinz Mauelshagen, Sistina Software
 *
 * March-May,October-November 1997
 * May,August,November 1998
 * January,March,April,September,October 2000
 *
 *
 * This LVM library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This LVM library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this LVM library; if not, write to the Free
 * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
 * MA 02111-1307, USA
 *
 */

/*
 * Changelog
 *
 *    03/02/2000 - use debug_enter()/debug_leave()
 *    04/04/2000 - enhanced to find physical volumes on UUID base
 *                 rather than on device special name
 *    20/09/2000 - WORKAROUND: avoid dual access pathes for now (2.4.0-test8)
 *    30/10/2000 - reworked to fix UUID related bug
 *
 */

#include <liblvm.h>


int pv_read_all_pv_of_vg ( char *vg_name, pv_t ***pv, int reread) {
   int i = 0;
   int id = 0;
   int p = 0;
   int pp = 0;
   int np = 0;
   int pv_number = 0;
   int ret = 0;
   int uuids = 0;
   static int first = 0;
   char *pv_uuid_list = NULL;
   static char vg_name_sav[NAME_LEN] = { 0, };
   pv_t **pv_tmp = NULL;
   static pv_t **pv_this = NULL;
   pv_t **pv_this_sav = NULL;
   
#ifdef DEBUG
   debug_enter ( "pv_read_all_pv_of_vg -- CALLED with vg_name: \"%s\"\n",
                 vg_name);
#endif

   if ( pv == NULL || vg_name == NULL ||
        ( reread != TRUE && reread != FALSE) ||
        vg_check_name ( vg_name) < 0) {
      ret = -LVM_EPARAM;
      goto pv_read_all_pv_of_vg_end;
   }

   *pv = NULL;

   if ( strcmp ( vg_name_sav, vg_name) != 0) {
      strcpy ( vg_name_sav, vg_name);
      reread = TRUE;
   }

   if ( reread == TRUE) {
      if ( pv_this != NULL) {
         free ( pv_this);
         pv_this = NULL;
      }
      first = 0;
   }

   if ( first == 0) {
      if ( ( ret = pv_read_all_pv ( &pv_tmp, FALSE)) < 0)
         goto pv_read_all_pv_of_vg_end;
   
      /* first physical volume who's volume group name fits
         starts work on PV UUID list */
      for ( p = 0; pv_tmp[p] != NULL; p++) {
         if ( strcmp ( pv_tmp[p]->vg_name, vg_name) == 0 &&
              pv_check_consistency ( pv_tmp[p]) == 0) {
            uuids = pv_read_uuidlist ( pv_tmp[p]->pv_name, &pv_uuid_list);
            break;
         }
      }

      /* pass to find the number of PVs in this group  anid
         to prefil the pointer array */
      for ( p = 0; pv_tmp[p] != NULL; p++) {
         if ( strncmp ( pv_tmp[p]->vg_name, vg_name, NAME_LEN) == 0) {
            pv_this_sav = pv_this;
            if ( ( pv_this = realloc ( pv_this,
                                       ( np + 2) * sizeof ( pv_t*))) == NULL) {
               fprintf ( stderr, "realloc error in %s [line %d]\n",
                                 __FILE__, __LINE__);
               ret = -LVM_EPV_READ_ALL_PV_OF_VG_MALLOC;
               if ( pv_this_sav != NULL) free ( pv_this_sav);
               goto pv_read_all_pv_of_vg_end;
            }
            pv_this[np] = pv_tmp[p];
            pv_this[np+1] = NULL;
            np++;
         }
      }
#if 0
      /* in case this PV already holds a uuid list: check against this list */
      if ( uuids > 0) {
         for ( p = 0; pv_this[p] != NULL; p++) {
            for ( id = 0; id < uuids; id++) {
               if ( memcmp ( pv_this[p]->pv_uuid,
                             &pv_uuid_list[id*NAME_LEN],
                             UUID_LEN) == 0) goto uuid_check_end;
            }
            pv_this[p] = NULL;
uuid_check_end:
         }
         for ( pp = 0; pp < p - 2; pp++) {
            if ( pv_this[pp] == NULL) {
               pv_this[pp] = pv_this[pp+1];
               pv_this[pp+1] = NULL;
            }
         }
         np = 0;
         while ( pv_this[np] != NULL) np++;
      }
#endif
      /* avoid multiple access pathes */
      for ( p = 0; pv_this[p] != NULL; p++) {
            /* avoid multiple access pathes for now (2.4.0-test8)
               and MD covered pathes as well */
         for ( i = 0; i < np; i++) {
            if ( p != i &&
                 strncmp ( pv_this[p]->vg_name, vg_name, NAME_LEN) == 0) {
               if ( pv_this[i]->pv_number == pv_this[p]->pv_number &&
                    memcmp ( pv_this[i]->pv_uuid, pv_this[p]->pv_uuid,
                             UUID_LEN) == 0) {
                  if ( MAJOR ( pv_this[p]->pv_dev) == MD_MAJOR) pp = i;
                  pv_this[pp] = NULL;
               }
            }
         }
         for ( pp = 0; pp < p - 2; pp++) {
            if ( pv_this[pp] == NULL) {
               pv_this[pp] = pv_this[pp+1];
               pv_this[pp+1] = NULL;
            }
         }
         np = 0;
         while ( pv_this[np] != NULL) np++;
      }

      /* no we only have pointers to single access path PVs
         in pv_this belonging to this VG */

      if ( np == 0) {
         ret = -LVM_EPV_READ_ALL_PV_OF_VG_NP;
         goto pv_read_all_pv_of_vg_end;
      }

      /* pass to find highest pv_number */
      for ( p = 0; pv_this[p] != NULL; p++) {
         if ( pv_number < pv_this[p]->pv_number)
            pv_number = pv_this[p]->pv_number;
      }

      if ( pv_number != np) {
         ret = -LVM_EPV_READ_ALL_PV_OF_VG_PV_NUMBER;
         goto pv_read_all_pv_of_vg_end;
      }

      /* Check for contiguous PV array */
      for ( p = 0; pv_this[p] != NULL; p++)
         if ( pv_this[p] == NULL && p < np)
            ret = -LVM_EPV_READ_ALL_PV_OF_VG_NP_SORT;

      first = 1;
   }

   if ( ret == 0) *pv = pv_this;

pv_read_all_pv_of_vg_end:

#ifdef DEBUG
   debug_leave ( "pv_read_all_pv_of_vg -- LEAVING with ret: %d\n", ret);
#endif
   return ret;
} /* pv_read_all_pv_of_vg() */

[-- Attachment #3: Type: APPLICATION/x-gzip, Size: 4076 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [linux-lvm] Problems with vgscan
  2001-03-10  0:36   ` Lukasz Trabinski
@ 2001-03-12 14:16     ` Lukasz Trabinski
  2001-03-12 18:25     ` Andreas Dilger
  1 sibling, 0 replies; 7+ messages in thread
From: Lukasz Trabinski @ 2001-03-12 14:16 UTC (permalink / raw)
  To: linux-lvm

On Sat, 10 Mar 2001, Lukasz Trabinski wrote:

> On Fri, 9 Mar 2001, Andreas Dilger wrote:
> >
> > Please run "vgscan -v -d" and post the output (compressed if very long).
>
> OK. There is gzipped output from vgscan -v -d
> I'm posting patched pv_read_all_pv_of_vg.c, too verify it.

Does anybody can verify output from my vgscan -v -d? (posted on my last
mail). What's wrong on that?

Thank's

-- 
*[ �ukasz Tr�bi�ski ]*
SysAdmin @polvoice.com

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [linux-lvm] Problems with vgscan
  2001-03-10  0:36   ` Lukasz Trabinski
  2001-03-12 14:16     ` Lukasz Trabinski
@ 2001-03-12 18:25     ` Andreas Dilger
  1 sibling, 0 replies; 7+ messages in thread
From: Andreas Dilger @ 2001-03-12 18:25 UTC (permalink / raw)
  To: linux-lvm

Lukasz Tribinski writes:
> I'm posting patched pv_read_all_pv_of_vg.c, too verify it.

Not related to the problem, AFAICS.

> OK. There is gzipped output from vgscan -v -d

It looks like it is not able to find LEs which are assigned to this LV.

What version of tools do you have?  It appears that with all of the
"lvm_add_dir_cache" calls you have an old version (this was fixed a few
weeks ago).  Maybe you should try the tools from CVS.

It appears you have two PVs - hdg1 and hdh1, correct?  Other than that,
I can't see what is missing.  Maybe "pvdata -a /dev/hd[gh]1" will help.
It will be long again (you have 16k+ LEs there), but it should show the
LE numbers on both PVs.

Cheers, Andreas
-- 
Andreas Dilger  \ "If a man ate a pound of pasta and a pound of antipasto,
                 \  would they cancel out, leaving him still hungry?"
http://www-mddsp.enel.ucalgary.ca/People/adilger/               -- Dogbert

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2001-03-12 18:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-03-09 23:31 [linux-lvm] Problems with vgscan Lukasz Trabinski
2001-03-10  0:04 ` Andreas Dilger
2001-03-10  0:36   ` Lukasz Trabinski
2001-03-12 14:16     ` Lukasz Trabinski
2001-03-12 18:25     ` Andreas Dilger
  -- strict thread matches above, loose matches on Subject: below --
2000-03-24 19:00 [linux-lvm] problems " jorg de jong
2000-03-25 14:03 ` Heinz Mauelshagen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).