fried partition table

John Summerfield (summer@os2.ami.com.au)
Mon, 10 Aug 1998 13:35:09 +0800 (WST)


I've tried various places to get help: thus far, no volunteers. What I
wish to know is the numbers to insert and where to get back my missing
partition. Rather than rewrite it all, here's what I've already posted,
slightly editted:

}My problem arose when I deleted an extended/logical/secondary/whatever
}partition using OS/2 fdisk.

}I have written a program (on Linux) which explores the disk. Thus far I
can

}1 Print out the partition table on some of my disks: it fails on one
which has primaries - more experimenting required there.
}2 Scan the disk looking for sectors with the magic code that indicates
}partition tables may be present. It finds some, but not enough to worry
about. It also finds a gem: the missing entry.
}3 Dump arbitrary areas of the disk.

}It's all very educational. I'd thought the partition tale was contained
in
}a few sectors at the 0 end of the drive. Not so: I've found they're
scattered all over the place. Not surprising one got lost.

}What I need most is some advice on the zap to fix the disk: offset and
bytes to insert.

}I have a backup on another disk, and my zaps will be easily reversable
too.
}I think that once the data's recovered I'll repartition the drive, just
to be sure.

My program has an option to, scan the entire hard drive looking for lost
partition tables.

It thinks it might have one if the sector ends with the magic code and the
number of sectors in every position in any suspected table isn't too
ridiculous.

Here's the entire report:

Superzap .01 copyright 1998 John Summerfield
1: scan /dev/hdb
file /dev/hdb
C(4092) T(16) S(63) s(0)
dumps 0 0
Fl Id C T S C T S: Ofs Sz
00 05 0 1 1 1023 15 63: 63 4124673
00 00 0 0 0 0 0 0: 0 0
00 00 0 0 0 0 0 0: 0 0
00 00 0 0 0 0 0 0: 0 0
dumps 63 63
Fl Id C T S C T S: Ofs Sz
81 83 0 2 1 203 15 63: 63 205506
00 05 1017 0 1 1023 15 63: 1025073 819504
00 00 0 0 0 0 0 0: 0 0
00 00 0 0 0 0 0 0: 0 0
dumps 126 126
Fl Id C T S C T S: Ofs Sz
00 00 0 0 0 0 0 0: 0 0
00 00 0 0 0 0 0 0: 0 0
00 00 0 0 0 0 0 0: 0 0
00 00 0 0 0 0 0 0: 0 2
dumps 205632 205632
Fl Id C T S C T S: Ofs Sz
80 83 204 1 1 1016 15 63: 63 819441
00 00 0 0 0 0 0 0: 0 0
00 00 0 0 0 0 0 0: 0 0
00 00 0 0 0 0 0 0: 0 0
dumps 1025136 1025136
Fl Id C T S C T S: Ofs Sz
01 83 1017 1 1 1023 15 63: 63 819441
00 05 204 0 1 1016 15 63: 205569 819504
00 00 0 0 0 0 0 0: 0 0
00 00 0 0 0 0 0 0: 0 0
dumps 1101395 1101395
Fl Id C T S C T S: Ofs Sz
00 00 0 0 0 0 0 0: 0 0
00 00 0 0 0 0 0 0: 0 0
00 00 0 0 0 0 0 0: 0 0
00 00 0 0 0 0 0 0: 0 0
dumps 1844640 1844640
Fl Id C T S C T S: Ofs Sz
81 83 1023 15 63 1023 15 63: 63 2280033
00 00 0 0 0 0 0 0: 0 0
00 00 0 0 0 0 0 0: 0 0
00 00 0 0 0 0 0 0: 0 0

The first column is a byte of flags: 0x80 means the partition is
bootable, no idea bout the 0x01.

The second column is the partition type: 0x83 is Linux.

The table in sector 1844640 is the one describing my missing partition.

My guess is that I have to add an extended partition (0x05) to the
table in the sector at 205632.

Does anyone disagree?

What numbers should I add and why?

The lines "dumps ..." are program control statements: they serve two
purposes:
1 They report the number of the sector containing the following table.
2 They can be fed back into the program to produce the dump that
follows.

Superzap .01 copyright 1998 John Summerfield
1: file /dev/hdb
Opened file(/dev/hdb) handle(3)
2: dumps 0 0
00000000 00000000 00000000 00000000 00000000 ................
26 lines like the previous
000001b0 00000000 00000000 74b22b3f 00000001 ........t.+?....
000001c0 0100050f ffff3f00 000001f0 3e000000 ......?.....>...
000001d0 00000000 00000000 00000000 00000000 ................
1 lines like the previous
000001f0 00000000 00000000 00000000 000055aa ..............U.
3: dumps 63 63
00007e00 00000000 00000000 00000000 00000000 ................
23 lines like the previous
00007f80 00000000 00000000 0000014c 696e7578 ...........Linux
00007f90 32202000 30303163 32356130 00000000 2 .001c25a0....
00007fa0 00000000 00000000 00000000 00000000 ................
1 lines like the previous
00007fc0 0100830f 3fcb3f00 0000c222 03000000 ....?.?...."....
00007fd0 c1f9050f ffff31a4 0f003081 0c000000 ......1...0.....
00007fe0 00000000 00000000 00000000 00000000 ................
00007ff0 00000000 00000000 00000000 000055aa ..............U.
4: dumps 126 126
0000fc00 eb694c49 4c4f0100 14005a00 00000000 .iLILO....Z.....
0000fc10 2c8f1134 0254820a 01035482 0a010154 ,..4.T....T....T
0000fc20 820a0101 00000000 00000005 54820a01 ............T...
0000fc30 3f52820f 01015382 00010253 82000103 ?R....S....S....
0000fc40 53820001 04538200 01055382 00010653 S....S....S....S
0000fc50 82000107 53820001 00000000 00000000 ....S...........
0000fc60 00000000 00000000 000000b8 c0078ed8 ................
0000fc70 8c066600 89366400 891e6800 88166a00 ..f..6d...h...j.
0000fc80 b8009a8e c0b90001 29f629ff fcf3a5ea ........).).....
0000fc90 9400009a fa8ed88e c0bc00b0 b800908e ................
0000fca0 d0fbb00d e85700b0 0ae85200 b04ce84d .....W....R..L.M
0000fcb0 00be3000 bb0010fc ad89c1ad 89c209c8 ..0.............
0000fcc0 742046e8 43007206 81c30002 ebea50b0 t F.C.r.......P.
0000fcd0 20e82a00 5888e0e8 120031c0 88c2cd13 .*.X.....1.....
0000fce0 ebcfb049 e81700ea 0000009b 50c0e804 ...I........P...
0000fcf0 e8010058 240f0430 3c3a7202 040730ff ...X$..0<:r...0.
0000fd00 b40ecd10 c35a595b c3f6c240 745280e2 .....ZY[...@tR..
0000fd10 bf535152 b408cd13 72eb88f3 5a88166d .SQR....r...Z..m
0000fd20 0188f230 f688f758 5186cdd0 c5d0c580 ...0...XQ.......
0000fd30 e503890e 6b015983 e13ff7f1 fec28816 ....k.Y..?......
0000fd40 6e0131d2 43f7f388 d68a166d 013b066b n.1.C......m.;.k
0000fd50 01771386 c4d0c8d0 c80a066e 0189c15b .w.........n...[
0000fd60 b80102cd 13c35b31 c0f9c300 00000000 ......[1........
0000fd70 00000000 00000000 00000000 00000000 ................
7 lines like the previous
0000fdf0 00000000 00000000 00000200 000055aa ..............U.
5: dumps 205632 205632
06468000 00000000 00000000 00000000 00000000 ................
23 lines like the previous
06468180 00000000 00000000 00000030 30303332 ...........00032
06468190 33376600 00000000 00000000 00000000 37f.............
064681a0 00000000 00000000 00000000 00000000 ................
1 lines like the previous
064681c0 01cc830f fff83f00 0000f180 0c000000 ......?.........
064681d0 00000000 00000000 00000000 00000000 ................
1 lines like the previous
064681f0 00000000 00000000 00000000 000055aa ..............U.
6: dumps 1025136 1025136
1f48e000 00000000 00000000 00000000 00000000 ................
24 lines like the previous
1f48e190 00000000 30303033 32333430 00000000 ....00032340....
1f48e1a0 00000000 00000000 00000000 00000000 ................
1 lines like the previous
1f48e1c0 c1f9830f ffff3f00 0000f180 0c000000 ......?.........
1f48e1d0 01cc050f fff80123 03003081 0c000000 .......#..0.....
1f48e1e0 00000000 00000000 00000000 00000000 ................
1f48e1f0 00000000 00000000 00000000 000055aa ..............U.
7: dumps 1101395 1101395
219ca600 eb4d9049 424d2032 302e3000 02040100 .M.IBM 20.0.....
219ca610 02000200 00f82900 11000400 11000000 ......).........
219ca620 c3a20000 80002815 9cd56443 2d445249 ......(...dC-DRI
219ca630 56450000 00004850 46532020 20200000 VE....HPFS ..
219ca640 00000000 00000000 00000000 000000fa ................
219ca650 33c08ed0 bc007cfb b8c0078e d8a12400 3.....|.......$.
219ca660 a34d00cd 122d4c00 25f0ffc1 e006a34b .M...-L.%.0.....K
219ca670 00c7063e 000000c7 06400000 00c70645 ...>.....@.....E
219ca680 001400a1 4b008ec0 2bdbe821 00ff364b ....K...+..!..6K
219ca690 00687202 a14d0026 a34d0026 a22400a1 .hr..M.&.M.&.$..
219ca6a0 1c0026a3 1c00a11e 0026a31e 00cb5053 ..&......&....PS
219ca6b0 515206a1 3e008b16 40000306 1c001316 QR..>...@.......
219ca6c0 1e0050a1 1a00f626 18008bc8 58f7f1a3 ..P....&....X...
219ca6d0 42008bc2 f6361800 fec48826 4400a225 B....6.....&D..%
219ca6e0 00a11800 2a064400 403b0645 007603a1 ....*.D.@;.E.v..
219ca6f0 450050b4 028b1642 00b106d2 e60a3644 E.P....B......6D
219ca700 008bca86 e98b1624 00cd1358 722a0106 .......$...Xr*..
219ca710 3e008316 40000029 06450076 0bc1e005 >...@..).E.v....
219ca720 8cc203d0 8ec2eb8b 075a595b 58c3be6e .........ZY[X..n
219ca730 08eb08be 0202eb03 be5801e8 0900be3e .........X.....>
219ca740 02e80300 fbebfeac 3c007409 b40ebb07 ........<.t.....
219ca750 00cd10eb f2c31d00 41206469 736b2072 ........A disk r
219ca760 65616420 6572726f 72206f63 63757272 ead error occurr
219ca770 65642e0d 0a00074f 53324b52 4e4c064f ed.....OS2KRNL.O
219ca780 53324c44 52074f53 32424f4f 54000000 S2LDR.OS2BOOT...
219ca790 00000000 00000000 00000000 00000000 ................
5 lines like the previous
219ca7f0 00000000 00000000 00000000 000055aa ..............U.
8: dumps 1844640 1844640
384b4000 00000000 00000000 00000000 00000000 ................
23 lines like the previous
384b4180 00000000 00000000 00000030 30316332 ...........001c2
384b4190 35646600 30303033 32333430 00000000 5df.00032340....
384b41a0 00000000 00000000 00000000 00000000 ................
1 lines like the previous
384b41c0 ffff830f ffff3f00 000061ca 22000000 ......?...a."...
384b41d0 00000000 00000000 00000000 00000000 ................
1 lines like the previous
384b41f0 00000000 00000000 00000000 000055aa ..............U.

Cheers
John Summerfield
http://os2.ami.com.au/os2/ for OS/2 support.
Configuration, networking, combined IBM ftpsites index.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html