At Wed, 21 May 2008 07:12:32 -0700 Mark Knecht <[EMAIL PROTECTED]> wrote:

> I think this answer would be good to have on a Gentoo grub Wiki
> somewhere. (If it isn't already.) There have been times I've wondered
> the same thing and didn't know how to extract the data out fo the MBR
> the way you did. It would also be good to add a second example of how
> to get it out of a partition instead of the MBR in case grub is
> installed there.

Here is how to do it for a partition, in my case /dev/sda2 is the
active partition and it is a windows partition (remember that in grub
this would be (hd0,1), not sd and not 2).  Note that if `GRUB' is in
the boot block of a partition it does not mean it is not in the mbr.
However, there is no ambiguity when you check the mbr itself since
whatever is there counts.

ajglap ~ # dd if=/dev/sda2 ibs=512 count=1 | od -c --address-radix=d
1+0 records in
1+0 records out
512 bytes (512 B) copied0000000 353   R 220   N   T   F   S                  \0 
002  \b  \0  \0
, 0.0234332 s, 21.8 kB/s
0000016  \0  \0  \0  \0  \0 370  \0  \0   ?  \0 377  \0  \0 200 001  \0
0000032  \0  \0  \0  \0 200  \0 200  \0 377 237 337 001  \0  \0  \0  \0
0000048  \0  \0  \f  \0  \0  \0  \0  \0 377 371 035  \0  \0  \0  \0  \0
0000064 366  \0  \0  \0 001  \0  \0  \0  \a   C 326 216   r 326 216 236
0000080  \0  \0  \0  \0 372   3 300 216 320 274  \0   | 373   h 300  \a
0000096 037 036   h   f  \0 313 210 026 016  \0   f 201   > 003  \0   N
0000112   T   F   S   u 025 264   A 273 252   U 315 023   r  \f 201 373
0000128   U 252   u 006 367 301 001  \0   u 003 351 322  \0 036 203 354
0000144 030   h 032  \0 264   H 212 026 016  \0 213 364 026 037 315 023
0000160 237 203 304 030 236   X 037   r 341   ; 006  \v  \0   u 333 243
0000176 017  \0 301   . 017  \0 004 036   Z   3 333 271  \0       + 310
0000192   f 377 006 021  \0 003 026 017  \0 216 302 377 006 026  \0 350
0000208   @  \0   + 310   w 357 270  \0 273 315 032   f   # 300   u   -
0000224   f 201 373   T   C   P   A   u   $ 201 371 002 001   r 036 026
0000240   h  \a 273 026   h   p 016 026   h  \t  \0   f   S   f   S   f
0000256   U 026 026 026   h 270 001   f   a 016  \a 315 032 351   j 001
0000272 220 220   f   ` 036 006   f 241 021  \0   f 003 006 034  \0 036
0000288   f   h  \0  \0  \0  \0   f   P 006   S   h 001  \0   h 020  \0
0000304 264   B 212 026 016  \0 026 037 213 364 315 023   f   Y   [   Z
0000320   f   Y   f   Y 037 017 202 026  \0   f 377 006 021  \0 003 026
0000336 017  \0 216 302 377 016 026  \0   u 274  \a 037   f   a 303 240
0000352 370 001 350  \b  \0 240 373 001 350 002  \0 353 376 264 001 213
0000368 360 254   <  \0   t  \t 264 016 273  \a  \0 315 020 353 362 303
0000384  \r  \n   A       d   i   s   k       r   e   a   d       e   r
0000400   r   o   r       o   c   c   u   r   r   e   d  \0  \r  \n   B
0000416   O   O   T   M   G   R       i   s       m   i   s   s   i   n
0000432   g  \0  \r  \n   B   O   O   T   M   G   R       i   s       c
0000448   o   m   p   r   e   s   s   e   d  \0  \r  \n   P   r   e   s
0000464   s       C   t   r   l   +   A   l   t   +   D   e   l       t
0000480   o       r   e   s   t   a   r   t  \r  \n  \0  \0  \0  \0  \0
0000496  \0  \0  \0  \0  \0  \0  \0  \0 200 235 262 312  \0  \0   U 252
0000512
ajglap ~ #


> Anyway, great info. Thanks!

You are welcome and thanks again to alan mckinnon for confirming my
guess.

allan (gottlieb)
-- 
gentoo-user@lists.gentoo.org mailing list

Reply via email to