[linux-lvm] Please help me recover my LVM configuration
Ray Van Dolson
rvandolson at esri.com
Sat Jul 30 18:15:48 UTC 2011
On Fri, Jul 29, 2011 at 08:30:25PM -0700, David Ziring wrote:
> Hi all,
> I’m hoping I can get some help recovering my data. A week or so back I
> accidentally overwrote the partition table on one of the two drives containing
> my data. I luckily didn’t touch the partition itself, so I believe all the
> data is still there, but in rebuilding the partition table I (think I) nuked
> the uuid of the drive. Now I’m not sure how to progress.
> Please help this relative neophyte – there is a lot of nostalgia sitting on
> those drives. Tell me what information you need and I will get it.
Was the lost partition also the one housing /etc/lvm? If not, you can
get the UUID that way....
If it was, fortunately LVM keeps metadata information about itself.
You should able to dump it via:
dd if=/dev/sda2 bs=512 count=255 skip=1 of=/tmp/sda2.txt
Where /dev/sda2 is your LVM partition.
You can then examine the output file with "strings" and pull out the
UUID information or even completely recreate your configuration files.
What I have done in the past is to just examine this information and
then use dmsetup to create a temporary device, mount it and copy out
the information from /etc/lvm.
Then it's the standard vgcfgrestore dance...
Dumped some instructions from a work wiki here that may be of help
(sorry it's PDF):
More information about the linux-lvm