Re: recommendations on how to recover a corrupted, LVM-based hard drive?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 02/15/2014 10:12 AM, Robert P. J. Day wrote:
   at this point, before i go any further, if my math is correct, is
there some command that can be used to ask, "if i *tell* you that a PV
started at this offset, and the first part of it is trashed, can you
tell me what you can find in the *rest* of the PV if it should contain
valid LVs further down"?

All of the LVM metadata is at the beginning of the PV, so it's been
trashed.  The rest is just raw content -- nothing specific to LVM.

You can see this for yourself fairly easily.  First, create a large
sparse file to use as your volume.

   dd if=/dev/null bs=1k seek=1024k of=/var/tmp/test.img

That creates a 1GB file that currently uses no space on the disk.

   # losetup -f --show /var/tmp/test.img
   /dev/loop0
   # pvcreate /dev/loop0
     Physical volume "/dev/loop0" successfully created
   # vgcreate testvg1 /dev/loop0
     Volume group "testvg1" successfully created
   # lvcreate -l 25%FREE testvg1
     Logical volume "lvol0" created
   # lvcreate -l 100%FREE testvg1
     Logical volume "lvol1" created
   # echo "Start of testvg1-lvol0" >/dev/testvg1/lvol0
   # echo "Start of testvg1-lvol1" >/dev/testvg1/lvol1

At each stage you can run "hexdump -C /var/tmp/test.img | less"
and see what shows up there.  Beyond the first 384 sectors (offset
0x30000), the only non-zero lines will be the output from those
two "echo" commands.

--
Bob Nichols     "NOSPAM" is really part of my email address.
                Do NOT delete it.

--
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org




[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux