All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zdenek Kabelac <zkabelac@redhat.com>
To: linux-lvm@redhat.com
Subject: Re: [linux-lvm] How to recover data from a second disk in LVM.
Date: Fri, 05 Nov 2010 16:44:13 +0100	[thread overview]
Message-ID: <4CD4264D.4040801@redhat.com> (raw)
In-Reply-To: <C1362206939D4CC7BD7FF33A6B29F896@cbmb2fec088ae0>

Dne 2.11.2010 23:00, Oreste napsal(a):
> Hi:
> 
>   I has a LVM with 2 disk, first: a small SCSI and a second one,
>   IDE and bigger; now the first disk, the SCSI, is not functioning ...  
> 
>   How can I recover all the data present in the second disk???


Usually depends on the layout of your LVs and filesystem used and proportion
of your lost filesystem fragments.

If shouldn't be a big problem to recover your lost PV - as your second disk
contains the whole description also of the first PV, the bigger problem is,
trying to recover filesystem -  fsck when first part of it is missing isn't
trivial - but you should be able to handle that via googling - lot's of
manuals out there.

If you don't any backup of your lost metadata - you will need to retrieve them
from the beginning of your second disk - where they are stored by default.
Read first MB (dd) - and try to find  text block with the largest 'version =
XXX' Save this recovered text block to file  mda.txt.

Get another disk as a replacement of your lost 1st drive - initialize it with
 lost PVID  (pv0 { id = "aaa..aaa" } in your recovered mda.txt file)
'pvcreate -u aaa..aaa /dev/yyy'

Good idea is to 'zero' this device  (dd if=/dev/zero of=/dev/yyy bs=1M) so you
will not confuse fsck repair more then necessary with unknown data.

Now just 'vgcfgrestore -f mda.txt' and active LVs 'vgchange -ay' - and you
should be able to see missing lost volumes.

Now hardest part - to recover filesystem -  obviously  LVs located only on
your lost pv0 are simply lost.   Those spread also over pv1 could be partially
recovered - of course with major damage on files physically located on pv0.

Zdenek

      reply	other threads:[~2010-11-05 15:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-02 22:00 [linux-lvm] How to recover data from a second disk in LVM Oreste
2010-11-05 15:44 ` Zdenek Kabelac [this message]

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=4CD4264D.4040801@redhat.com \
    --to=zkabelac@redhat.com \
    --cc=linux-lvm@redhat.com \
    /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.