1 |
At Wed, 21 May 2008 07:12:32 -0700 Mark Knecht <markknecht@×××××.com> wrote: |
2 |
|
3 |
> I think this answer would be good to have on a Gentoo grub Wiki |
4 |
> somewhere. (If it isn't already.) There have been times I've wondered |
5 |
> the same thing and didn't know how to extract the data out fo the MBR |
6 |
> the way you did. It would also be good to add a second example of how |
7 |
> to get it out of a partition instead of the MBR in case grub is |
8 |
> installed there. |
9 |
|
10 |
Here is how to do it for a partition, in my case /dev/sda2 is the |
11 |
active partition and it is a windows partition (remember that in grub |
12 |
this would be (hd0,1), not sd and not 2). Note that if `GRUB' is in |
13 |
the boot block of a partition it does not mean it is not in the mbr. |
14 |
However, there is no ambiguity when you check the mbr itself since |
15 |
whatever is there counts. |
16 |
|
17 |
ajglap ~ # dd if=/dev/sda2 ibs=512 count=1 | od -c --address-radix=d |
18 |
1+0 records in |
19 |
1+0 records out |
20 |
512 bytes (512 B) copied0000000 353 R 220 N T F S \0 002 \b \0 \0 |
21 |
, 0.0234332 s, 21.8 kB/s |
22 |
0000016 \0 \0 \0 \0 \0 370 \0 \0 ? \0 377 \0 \0 200 001 \0 |
23 |
0000032 \0 \0 \0 \0 200 \0 200 \0 377 237 337 001 \0 \0 \0 \0 |
24 |
0000048 \0 \0 \f \0 \0 \0 \0 \0 377 371 035 \0 \0 \0 \0 \0 |
25 |
0000064 366 \0 \0 \0 001 \0 \0 \0 \a C 326 216 r 326 216 236 |
26 |
0000080 \0 \0 \0 \0 372 3 300 216 320 274 \0 | 373 h 300 \a |
27 |
0000096 037 036 h f \0 313 210 026 016 \0 f 201 > 003 \0 N |
28 |
0000112 T F S u 025 264 A 273 252 U 315 023 r \f 201 373 |
29 |
0000128 U 252 u 006 367 301 001 \0 u 003 351 322 \0 036 203 354 |
30 |
0000144 030 h 032 \0 264 H 212 026 016 \0 213 364 026 037 315 023 |
31 |
0000160 237 203 304 030 236 X 037 r 341 ; 006 \v \0 u 333 243 |
32 |
0000176 017 \0 301 . 017 \0 004 036 Z 3 333 271 \0 + 310 |
33 |
0000192 f 377 006 021 \0 003 026 017 \0 216 302 377 006 026 \0 350 |
34 |
0000208 @ \0 + 310 w 357 270 \0 273 315 032 f # 300 u - |
35 |
0000224 f 201 373 T C P A u $ 201 371 002 001 r 036 026 |
36 |
0000240 h \a 273 026 h p 016 026 h \t \0 f S f S f |
37 |
0000256 U 026 026 026 h 270 001 f a 016 \a 315 032 351 j 001 |
38 |
0000272 220 220 f ` 036 006 f 241 021 \0 f 003 006 034 \0 036 |
39 |
0000288 f h \0 \0 \0 \0 f P 006 S h 001 \0 h 020 \0 |
40 |
0000304 264 B 212 026 016 \0 026 037 213 364 315 023 f Y [ Z |
41 |
0000320 f Y f Y 037 017 202 026 \0 f 377 006 021 \0 003 026 |
42 |
0000336 017 \0 216 302 377 016 026 \0 u 274 \a 037 f a 303 240 |
43 |
0000352 370 001 350 \b \0 240 373 001 350 002 \0 353 376 264 001 213 |
44 |
0000368 360 254 < \0 t \t 264 016 273 \a \0 315 020 353 362 303 |
45 |
0000384 \r \n A d i s k r e a d e r |
46 |
0000400 r o r o c c u r r e d \0 \r \n B |
47 |
0000416 O O T M G R i s m i s s i n |
48 |
0000432 g \0 \r \n B O O T M G R i s c |
49 |
0000448 o m p r e s s e d \0 \r \n P r e s |
50 |
0000464 s C t r l + A l t + D e l t |
51 |
0000480 o r e s t a r t \r \n \0 \0 \0 \0 \0 |
52 |
0000496 \0 \0 \0 \0 \0 \0 \0 \0 200 235 262 312 \0 \0 U 252 |
53 |
0000512 |
54 |
ajglap ~ # |
55 |
|
56 |
|
57 |
> Anyway, great info. Thanks! |
58 |
|
59 |
You are welcome and thanks again to alan mckinnon for confirming my |
60 |
guess. |
61 |
|
62 |
allan (gottlieb) |
63 |
-- |
64 |
gentoo-user@l.g.o mailing list |