All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andreas Dilger <adilger@turbolabs.com>
To: Matt Zimmerman <mdz@debian.org>
Cc: linux-lvm@sistina.com
Subject: Re: [linux-lvm] Need help with PV recovery
Date: Mon Dec 31 01:47:01 2001	[thread overview]
Message-ID: <20011231004824.D12868@lynx.no> (raw)
In-Reply-To: <20011230234056.GB1965@alcor.net>; from mdz@debian.org on Sun, Dec 30, 2001 at 06:40:56PM -0500

On Dec 30, 2001  18:40 -0500, Matt Zimmerman wrote:
> During a different recovery operation, the first sector of one of my PVs was
> partially corrupted (it had bootsector data written to it).  Some of the
> metadata is still intact; in particular, the total/free/allocated statistics
> look reasonable, part of the PV UUID is still there, the volume group
> configuration is still there, and all of the LE->PE mappings seem to be OK.
> 
> It seems like this situation should be recoverable, but so far I have been
> unsuccessful.  After backing up the beginning of the partition, I tried
> patching it up by hand with little success, then I tried pvcreate -ff and
> vgcfgrestore.  While pvdisplay seems to show the right data after that,
> vgscan still doesn't recognize the volume.
> 
> Attached is the result of "pvdata -a" on the (unmodified) partition.

> --- Physical volume ---
> PV Name               /dev/scsi/host1/bus0/target0/lun0/part1
> VG Name               D\x02\x01
> PV Size               8.43 GB / NOT usable 4.48 MB [LVM: 132.00 KB]
> PV#                   0
> PV Status             NOT available
> Allocatable           yes
> Cur LV                7
> PE Size (KByte)       4096
> Total PE              2158
> Free PE               681
> Allocated PE          1477
> PV UUID               EffefH-Zmr5-gMrs-rUEM-\x03\x02…

So, what you need to do (approximately) is (bPV = broken PV):

# restore the LVM magic at the start of the PV (probably OK, but why not)
dd if=/dev/<some other PV> bs=1 count=4 of=<bPV>
# restore the UUID (obviously broken)
echo -e "EffefHZmr5gMrsrUEM6CkDRRZC1ragTp\0" | dd bs=1 seek=44 count=33 of=<bPV>
# restore the VG name (looks to be missing)
echo -e "<vgname>\0" | dd bs=1 seek=172 count=<length of vgname + 1>

According to the UUID list, this _should_ be PV #2, is that correct?
Hard to see if the "system id" is OK, but I'm not sure if it is important.
What about the output of "pvdata -PP <bPV>"?  I _assume_ that the PV
location data is OK, or you wouldn't be getting anything from the
PE and LV lists, but it is hard to tell for sure.

What would be also useful is the first 40 lines of "od -Ax -tx4 <bPV>".

Cheers, Andreas
--
Andreas Dilger
http://sourceforge.net/projects/ext2resize/
http://www-mddsp.enel.ucalgary.ca/People/adilger/

  reply	other threads:[~2001-12-31  1:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-12-30 17:38 [linux-lvm] Need help with PV recovery Matt Zimmerman
2001-12-31  1:47 ` Andreas Dilger [this message]
2001-12-31  2:13   ` Matt Zimmerman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20011231004824.D12868@lynx.no \
    --to=adilger@turbolabs.com \
    --cc=linux-lvm@sistina.com \
    --cc=mdz@debian.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.