linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
* [linux-lvm] help to recovering my home volume
@ 2010-04-05 14:45 KiKouN
  2010-04-05 15:45 ` Phillip Susi
  0 siblings, 1 reply; 2+ messages in thread
From: KiKouN @ 2010-04-05 14:45 UTC (permalink / raw)
  To: linux-lvm

Hello, 

First, sorry for my english.


The other day, I wanted to create a multi-iso usb (for install- 
party) but I stupidly copied the image on my main hard drive.

When I have seen my error, I have stop the copy and run
"cat /proc/partitions" to make a backup of my partition table. But the
system was crash before.

I have reboot to a liveCD and make a copy of my disk on an other disk.

I have run testdisk and gpart on this image without success. So I have
make a bash script with dd and grep to find some file or some special
block.

With this script, I have found my last lvm backup text file
( http://pastebin.com/TTSnpr47 )

I want to know if I can make an image file of my home LV with this file
and how to calculate the start/end sector (on the disk) of my home LV.

dd if=sda.img of=home.img bs=512 count=size_of_home_part1
skip=start_sector_of_home_LV

I think that size_of_home_part1 is 11008*8192 but I want to know how to
calculate start_sector_of_home_LV. How to calculate this value ?

In the lvm backup file, I don't know what is the value "pe_start" in pv0
section. What is this value ? 

thanks for your help.



Some more info:

# hdparm -g /dev/sda

/dev/sda:
 geometry      = 14593/255/63, sectors = 234441648, start = 0


My partition table before the crash. 
/dev/sda1	/boot 	~200Mo
/dev/sda2	/boot2 	~200Mo
/dev/sda3	swap	~1Go
/dev/sda4
  /dev/sda5	PV	~107Go
End of disk

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [linux-lvm] help to recovering my home volume
  2010-04-05 14:45 [linux-lvm] help to recovering my home volume KiKouN
@ 2010-04-05 15:45 ` Phillip Susi
  0 siblings, 0 replies; 2+ messages in thread
From: Phillip Susi @ 2010-04-05 15:45 UTC (permalink / raw)
  To: LVM general discussion and development; +Cc: KiKouN

On 4/5/2010 10:45 AM, KiKouN wrote:
> I think that size_of_home_part1 is 11008*8192 but I want to know how to
> calculate start_sector_of_home_LV. How to calculate this value ?

It looks like your home lv is split into two segments, one that is 3 GB
long and at the start of the pv, and another segment that is 43 GB long
and elsewhere on the disk.  Did you create the home lv first only 3 GB
in size, then extend it later?

The second segment starts at extent 0, which is at sector 384, and is
768 4 MB segments long, or 768 x 4096 x 2 = 6291456 sectors.  The first
segment starts at extent 5376, which is at sector 5376 x 4096 x 2 + 384
= 44040576 and is 11008 extents or 90177536 sectors long.

These are all relative to the physical volume, which looks like it was
in /dev/sda7.  If you overwrite the partition table then you will need
to figure out where that partition started.

> In the lvm backup file, I don't know what is the value "pe_start" in pv0
> section. What is this value ? 

pe_start is the sector where the first physical extent is.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-04-05 15:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-05 14:45 [linux-lvm] help to recovering my home volume KiKouN
2010-04-05 15:45 ` Phillip Susi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).