Return-Path: <linux-lvm-admin@sistina.com>
Delivered-To: bluca@comedia.it
Received: from sistina.com (hermes.sistina.com [208.210.145.141])
	by colombina.comedia.it (Postfix) with SMTP id 25049506D
	for <bluca@comedia.it>; Mon,  2 Apr 2001 21:27:59 +0000 ()
Received: (qmail 5697 invoked from network); 2 Apr 2001 21:23:03 -0000
Received: from localhost (HELO hermes.sistina.com) (127.0.0.1)
  by localhost with SMTP; 2 Apr 2001 21:23:03 -0000
Delivered-To: linux-lvm@sistina.com
Received: (qmail 5640 invoked from network); 2 Apr 2001 21:22:57 -0000
Received: from h24-65-193-28.cg.shawcable.net (HELO webber.adilger.int) (24.65.193.28)
  by hermes.sistina.com with SMTP; 2 Apr 2001 21:22:57 -0000
Received: (from adilger@localhost)
	by webber.adilger.int (8.11.2/8.11.1/Debian 8.11.0-6) id f32L0jL13101
	for linux-lvm@sistina.com; Mon, 2 Apr 2001 15:00:45 -0600
From: Andreas Dilger <adilger@turbolinux.com>
Message-Id: <200104022100.f32L0jL13101@webber.adilger.int>
Subject: Re: [linux-lvm] Problem with UUID, vgscan, vgcfgrestore
In-Reply-To: <01040207434300.00937@darkvader> from Diederick van Dijk at "Apr
 2, 2001 07:43:43 am"
To: linux-lvm@sistina.com
X-Mailer: ELM [version 2.4ME+ PL66 (25)]
Sender: linux-lvm-admin@sistina.com
Errors-To: linux-lvm-admin@sistina.com
X-BeenThere: linux-lvm@sistina.com
X-Mailman-Version: 2.0
Precedence: bulk
Reply-To: linux-lvm@sistina.com
List-Help: <mailto:linux-lvm-request@sistina.com?subject=help>
List-Post: <mailto:linux-lvm@sistina.com>
List-Subscribe: <http://lists.sistina.com/mailman/listinfo/linux-lvm>,
	<mailto:linux-lvm-request@sistina.com?subject=subscribe>
List-Id: linux-lvm general discussion <linux-lvm.sistina.com>
List-Unsubscribe: <http://lists.sistina.com/mailman/listinfo/linux-lvm>,
	<mailto:linux-lvm-request@sistina.com?subject=unsubscribe>
List-Archive: <http://lists.sistina.com/pipermail/linux-lvm/>
Date: Mon, 2 Apr 2001 15:00:44 -0600 (MDT)

Diederick van Dijk writes:
> I've a LVM of 8 physical volumes that I've created with LVM 0.9.1 beta 2.
> I've the know problem that vgscan reports that it can't find my VG.
> So I upgraded to LVM 0.9.1 beta 6 (tools and kernel) and runned on each
> physical disk a vgcfgrestore. Unfortunately I didn't solve the problem.
> Attached is the output of the commands vgdisplay -v and a pvdata -U for each 
> physical disk. Debug logs a very huge so I won't attach them.

OK, I have figured out why vgcfgrestore doesn't work properly with broken
UUIDs.  It is because vgcfgrestore only restores the backup VGDA data to
each disk separately.  This means it is not possible to have consistent
UUIDs generated for all PVs in a VG when vgcfgrestore is run.

You can try the following (experimental) procedure to fix the UUIDs:

Check each PV with "pvdata -PP /dev/hdX" to ensure it has a valid
UUID assigned.  Also get the PV numbers (starting with 1) for each of
the PVs.  Finally, check the pv_uuidlist_on_disk.base for each PV.
It will normally be 6144, but it does not have to be.

for each PV (in PV# order)
    dd if=/dev/hdX bs=1 skip=44 count=128 >> /tmp/uuids

This should create a file /tmp/uuids which has all of the PV UUIDs in it.
Make sure there are as many UUIDs in the file ("od -a /tmp/uuids" is good)
as you have PVs (8 in your case).

Now, we want to write the UUID list back to the PVs so vgscan is happy:

for each PV (in any order)
    dd if=/tmp/uuids of=/dev/hdX bs=1 seek=<pv_uuidlist_on_disk.base for hdX>

example:
    dd if=/tmp/uuids of=/dev/hda2 bs=1 seek=6144

Now vgscan should be able to detect all of the disks and work properly.

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
_______________________________________________
linux-lvm mailing list
linux-lvm@sistina.com
http://lists.sistina.com/mailman/listinfo/linux-lvm
