From: Lars Ellenberg <linux-lvm@linbit.com>
To: LVM general discussion and development <linux-lvm@redhat.com>
Subject: Re: [linux-lvm] Lost partition table --> Lost 4th PV partition on disk - how to find the partition bounderies
Date: Mon, 30 Oct 2006 12:13:39 +0100 [thread overview]
Message-ID: <20061030111339.GF7809@soda.linbit> (raw)
In-Reply-To: <3377.62.99.165.114.1162134421.squirrel@webmail.cosy.sbg.ac.at> <2813.62.99.165.114.1162122375.squirrel@webmail.cosy.sbg.ac.at>
/ 2006-10-29 12:46:15 +0100
\ gklima@cosy.sbg.ac.at:
> the layout of the disk was/is as follows:
> 1) ntfs ~10G
> 2) ntfs ~10G
> 3) ext3 36mb linux-boot
> 4) PV of lvm2 which had 72046800 blocks as of /proc/partition the last
> time lvm2 worked
>
> layout by fdisk after the win xp partitoning and ghost coping with a still
> working lvm2 PV on partition 4
>
> 1) 1-1703
> 2) 1704-3186
> 3) 3187-3192
> 4) 3192-12161
which is cylinders.
> The VG is called "vg"
> and the approximately layout is as follows:
>
> root lv 500M (bin, sbin, etc, lib, ......)
> swap lv 1500M encrypted
> and then var usr opt distfiles portage and so on.....
> 255 heads, 63 sectors/track, 12161 cylinders, total 195371568 sectors
> Possible partition(Linux ext2), size(36mb), offset(24998mb)
> type: 131(0x83)(Linux ext2 filesystem)
> size: 36mb #s(75600) s(51196320-51271919)
> chs: (1023/254/63)-(1023/254/63)d (3186/210/1)-(3191/134/63)r
> hex: 00 FE FF FF 83 FE FF FF A0 31 0D 03 50 27 01 00
so, here we are: this is obviously your "linux-boot".
the next recognized sector appears to be from swap.
so we know:
51271919 end sector of "linux-boot"
which is consistent with your remembered cylinders above:
> 4) 3192-12161
to find the exact sector offset of your pv,
have a knoppix (or some other live-cd) handy.
do
perl -e '$s= 51271919; $o = 512*$s;
sysseek(STDIN,$o,0) = $o or die "seek: $!\n";
while(1) {
sysread STDIN,$_,512;
last if /^.{24}LVM2/;
last if ++$s > 1000000;
}
print "start sector of pv appears to be",$s-1,"\n";
'
use
sfdisk -d /dev/hda > dummy
vi dummy
sfdisk -uS /dev/hda < dummy
to put some partition table back in place.
dummy would look similar to
-----
# partition table of /dev/hda
unit: sectors
/dev/hda1 : start= 63, size= 28675960, Id= 7, bootable
/dev/hda2 : start= 31268160, size= 19928152, Id= 7
/dev/hda3 : start= 51196320, size= 75600, Id=83
/dev/hda4 : start= 51277968, size=144093600, Id=8e
-----
I inserted the values that your "big scan" found out,
but decided slightly different what to discard because of overlap,
and added the information you gave about
> 4) PV of lvm2 which had 72046800 blocks as of /proc/partition the last
> time lvm2 worked
(total sectors 195371568 - 2*72046800 == 51277968), as it is consitent
with the offsets of the 36mb partition and the swap signature found by
the big scan as well as the additional context you provided.
hda1 and hda2 are likely slightly wrong,
as between those is some unused space.
hda3 is most likely correct, and hda4 would be your pv,
and my guess is that it is correct, too.
if the perl snipplet above confirms that
(start sector 51277968), go for it.
cheers.
--
: Lars Ellenberg Tel +43-1-8178292-55 :
: LINBIT Information Technologies GmbH Fax +43-1-8178292-82 :
: Schoenbrunner Str. 244, A-1120 Vienna/Europe http://www.linbit.com :
next prev parent reply other threads:[~2006-10-30 11:13 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-29 11:46 [linux-lvm] Lost partition table --> Lost 4th PV partition on disk - how to find the partition bounderies gklima
2006-10-29 15:07 ` gklima
2006-10-29 19:06 ` Luca Berra
2006-10-29 19:33 ` gklima
2006-10-30 11:13 ` Lars Ellenberg [this message]
2006-10-30 21:49 ` gklima
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=20061030111339.GF7809@soda.linbit \
--to=linux-lvm@linbit.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox