[linux-lvm] Recovering "broken" disk ( 17th )

Roger Heflin rogerheflin at gmail.com
Tue Oct 19 10:06:37 UTC 2021


I would edit the vgconfig you dd'ed with an editor and make sure it looks
reasonable for what you think you had.

When you do the pvcreate --uuid it won't use anything except the uuid info
so the rest may not need to be exactly right, if you have to do a
vgcfgrestore to get it to read the rest of the info will be used.

I have seen some weird disk controller failures that appeared to zero out
the first bit of the disk (enough to get the partition table, grub, and the
pv header depending on where the first partition starts).

You will need to reinstall grub if this was the bootable disk, since there
were 384 bytes of grub in the sector with the partition table that you know
are missing.

On Tue, Oct 19, 2021 at 1:04 AM Brian McCullough <bdmc at buadh-brath.com>
wrote:

> On Mon, Oct 18, 2021 at 09:49:44AM -0500, Roger Heflin wrote:
> > You will need a lvm backup file for the pvcreate --uuid I believe (there
> > may be some option to get around needing the backup file).
> >
> > That will put the header back on if you either have an lvm backup and/or
> > archive file, you might also need a vgcfgrestore afterwards depending on
> if
> > anything else is missing.
> >
> > I have never done it, but it looks possible to make a lvm backup file by
> > reading it directly off the disk with dd, so that you will have a file
> that
> > pvcreate is ok with, that is if there is no way to force it without a
> > backup file.
> >
> > But, this should get the pv back showing up with whatever sectors that
> you
> > successfully recovered.
>
> Thank you, Roger.
>
> I might be able to do that on the original machine, which won't boot at
> the moment because of this failure, but I have been using a working
> machine so far to use ddrestore etc.
>
> Yes, as you said, I was able to use dd to copy off the vgconfig data
> into a file.  So you think that I might be able to use that as the
> reference in pvcreate?  That makes some sense.
>
> I started this out asking ( but not clearly ) whether the data on the
> disk appeared to be in the correct place and whether what was there was
> correct, but I think that I answered that for myself with the
> comparison to the working PV partition.
>
>
> Thanks again,
> Brian
>
> _______________________________________________
> linux-lvm mailing list
> linux-lvm at redhat.com
> https://listman.redhat.com/mailman/listinfo/linux-lvm
> read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/linux-lvm/attachments/20211019/ea699436/attachment.htm>


More information about the linux-lvm mailing list