Re: [gentoo-user] is grub in my mbr?

2008-05-21 Thread Neil Bothwick
On Wed, 21 May 2008 07:53:52 +0200, Dirk Heinrichs wrote:

  I believe that when I upgrade grub I am supposed to re-run it.  
 
 Only if you want to upgrade your MBR too.

If you don't, the stage1 in your MBR may not work with the stage1.5 and
stage2 in /boot. This happened with a recent GRUB update.


-- 
Neil Bothwick

DANGER! DANGER! Computer store ahead...hide wallet.


signature.asc
Description: PGP signature


Re: [gentoo-user] is grub in my mbr?

2008-05-21 Thread Dirk Heinrichs
Am Mittwoch, 21. Mai 2008 schrieb ext Neil Bothwick:
 On Wed, 21 May 2008 07:53:52 +0200, Dirk Heinrichs wrote:
   I believe that when I upgrade grub I am supposed to re-run it.
 
  Only if you want to upgrade your MBR too.

 If you don't, the stage1 in your MBR may not work with the stage1.5 and
 stage2 in /boot. This happened with a recent GRUB update.

Not to me.

Bye...

Dirk
-- 
Dirk Heinrichs  | Tel:  +49 (0)162 234 3408
Configuration Manager   | Fax:  +49 (0)211 47068 111
Capgemini Deutschland   | Mail: [EMAIL PROTECTED]
Wanheimerstraße 68  | Web:  http://www.capgemini.com
D-40468 Düsseldorf  | ICQ#: 110037733
GPG Public Key C2E467BB | Keyserver: wwwkeys.pgp.net


signature.asc
Description: This is a digitally signed message part.


Re: [gentoo-user] is grub in my mbr?

2008-05-21 Thread Neil Bothwick
On Wed, 21 May 2008 10:53:28 +0200, Dirk Heinrichs wrote:

  If you don't, the stage1 in your MBR may not work with the stage1.5
  and stage2 in /boot. This happened with a recent GRUB update.  
 
 Not to me.

Aha, the old works for me defence :)

It came up on this list very recently, where someone had to use a live CD
to fix GRUB after ignoring/missing the elog warnings.

WARN: postinst
*** IMPORTANT NOTE: you must run grub and install
the new version's stage1 to your MBR.  Until you do,
stage1 and stage2 will still be the old version, but
later stages will be the new version, which could
cause problems such as an unbootable system.


-- 
Neil Bothwick

Everything's back to normal. Damn.


signature.asc
Description: PGP signature


Re: [gentoo-user] is grub in my mbr?

2008-05-21 Thread Dirk Heinrichs
Am Mittwoch, 21. Mai 2008 schrieb ext Neil Bothwick:
 On Wed, 21 May 2008 10:53:28 +0200, Dirk Heinrichs wrote:
   If you don't, the stage1 in your MBR may not work with the stage1.5
   and stage2 in /boot. This happened with a recent GRUB update.
 
  Not to me.

 Aha, the old works for me defence :)

No, it's the couldn't happen to me because my /boot is mounted ro defense.

BTW: One doesn't really need to keep grub installed after writing the MBR. 
Just unmerge it and your /boot and/or MBR are save.

Bye...

Dirk
-- 
Dirk Heinrichs  | Tel:  +49 (0)162 234 3408
Configuration Manager   | Fax:  +49 (0)211 47068 111
Capgemini Deutschland   | Mail: [EMAIL PROTECTED]
Wanheimerstraße 68  | Web:  http://www.capgemini.com
D-40468 Düsseldorf  | ICQ#: 110037733
GPG Public Key C2E467BB | Keyserver: wwwkeys.pgp.net


signature.asc
Description: This is a digitally signed message part.


Re: [gentoo-user] is grub in my mbr?

2008-05-21 Thread Allan Gottlieb
At Wed, 21 May 2008 11:42:37 +0200 Dirk Heinrichs [EMAIL PROTECTED] wrote:

 Am Mittwoch, 21. Mai 2008 schrieb ext Neil Bothwick:
 On Wed, 21 May 2008 10:53:28 +0200, Dirk Heinrichs wrote:
   If you don't, the stage1 in your MBR may not work with the stage1.5
   and stage2 in /boot. This happened with a recent GRUB update.
 
  Not to me.

 Aha, the old works for me defence :)

 No, it's the couldn't happen to me because my /boot is mounted ro defense.

 BTW: One doesn't really need to keep grub installed after writing the MBR. 
 Just unmerge it and your /boot and/or MBR are save.

This discussion is interesting and may well prove helpful.  But,
unless I missed it, I didn't see an answer to my question, namely

Am I correct in believing that seeing `GRUB' within the first 512
bytes of /dev/sda (I have a one-hard-disk laptop) confirms my memory
that I did install grub in the mbr (as opposed to the boot block of
the active partition).

thanks,
allan
-- 
gentoo-user@lists.gentoo.org mailing list



Re: [gentoo-user] is grub in my mbr?

2008-05-21 Thread Dirk Heinrichs
Am Mittwoch, 21. Mai 2008 schrieb ext Allan Gottlieb:

 This discussion is interesting and may well prove helpful.  But,
 unless I missed it, I didn't see an answer to my question, namely

Although it was a little bit ironic, I gave it in my first reply.

 Am I correct in believing that seeing `GRUB' within the first 512
 bytes of /dev/sda (I have a one-hard-disk laptop) confirms my memory
 that I did install grub in the mbr (as opposed to the boot block of
 the active partition).

Yes.

Bye...

Dirk
-- 
Dirk Heinrichs  | Tel:  +49 (0)162 234 3408
Configuration Manager   | Fax:  +49 (0)211 47068 111
Capgemini Deutschland   | Mail: [EMAIL PROTECTED]
Wanheimerstraße 68  | Web:  http://www.capgemini.com
D-40468 Düsseldorf  | ICQ#: 110037733
GPG Public Key C2E467BB | Keyserver: wwwkeys.pgp.net


signature.asc
Description: This is a digitally signed message part.


Re: [gentoo-user] is grub in my mbr?

2008-05-21 Thread Allan Gottlieb
At Wed, 21 May 2008 15:31:23 +0200 Dirk Heinrichs [EMAIL PROTECTED] wrote:

 Am Mittwoch, 21. Mai 2008 schrieb ext Allan Gottlieb:

 This discussion is interesting and may well prove helpful.  But,
 unless I missed it, I didn't see an answer to my question, namely

 Although it was a little bit ironic, I gave it in my first reply.

Thanks.  I thought so, but feared that my question might have been
poorly written and suggested that I wanted to know which loader I had
rather that where it was installed.

Thanks again.
allan
-- 
gentoo-user@lists.gentoo.org mailing list



Re: [gentoo-user] is grub in my mbr?

2008-05-21 Thread Mark Knecht
On Wed, May 21, 2008 at 7:08 AM, Allan Gottlieb [EMAIL PROTECTED] wrote:
 At Wed, 21 May 2008 15:31:23 +0200 Dirk Heinrichs [EMAIL PROTECTED] wrote:

 Am Mittwoch, 21. Mai 2008 schrieb ext Allan Gottlieb:

 This discussion is interesting and may well prove helpful.  But,
 unless I missed it, I didn't see an answer to my question, namely

 Although it was a little bit ironic, I gave it in my first reply.

 Thanks.  I thought so, but feared that my question might have been
 poorly written and suggested that I wanted to know which loader I had
 rather that where it was installed.

 Thanks again.
 allan

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.

Anyway, great info. Thanks!

Cheers,
Mark
-- 
gentoo-user@lists.gentoo.org mailing list



Re: [gentoo-user] is grub in my mbr?

2008-05-21 Thread Allan Gottlieb
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) copied000 353   R 220   N   T   F   S  \0 
002  \b  \0  \0
, 0.0234332 s, 21.8 kB/s
016  \0  \0  \0  \0  \0 370  \0  \0   ?  \0 377  \0  \0 200 001  \0
032  \0  \0  \0  \0 200  \0 200  \0 377 237 337 001  \0  \0  \0  \0
048  \0  \0  \f  \0  \0  \0  \0  \0 377 371 035  \0  \0  \0  \0  \0
064 366  \0  \0  \0 001  \0  \0  \0  \a   C 326 216   r 326 216 236
080  \0  \0  \0  \0 372   3 300 216 320 274  \0   | 373   h 300  \a
096 037 036   h   f  \0 313 210 026 016  \0   f 201003  \0   N
112   T   F   S   u 025 264   A 273 252   U 315 023   r  \f 201 373
128   U 252   u 006 367 301 001  \0   u 003 351 322  \0 036 203 354
144 030   h 032  \0 264   H 212 026 016  \0 213 364 026 037 315 023
160 237 203 304 030 236   X 037   r 341   ; 006  \v  \0   u 333 243
176 017  \0 301   . 017  \0 004 036   Z   3 333 271  \0   + 310
192   f 377 006 021  \0 003 026 017  \0 216 302 377 006 026  \0 350
208   @  \0   + 310   w 357 270  \0 273 315 032   f   # 300   u   -
224   f 201 373   T   C   P   A   u   $ 201 371 002 001   r 036 026
240   h  \a 273 026   h   p 016 026   h  \t  \0   f   S   f   S   f
256   U 026 026 026   h 270 001   f   a 016  \a 315 032 351   j 001
272 220 220   f   ` 036 006   f 241 021  \0   f 003 006 034  \0 036
288   f   h  \0  \0  \0  \0   f   P 006   S   h 001  \0   h 020  \0
304 264   B 212 026 016  \0 026 037 213 364 315 023   f   Y   [   Z
320   f   Y   f   Y 037 017 202 026  \0   f 377 006 021  \0 003 026
336 017  \0 216 302 377 016 026  \0   u 274  \a 037   f   a 303 240
352 370 001 350  \b  \0 240 373 001 350 002  \0 353 376 264 001 213
368 360 254 \0   t  \t 264 016 273  \a  \0 315 020 353 362 303
384  \r  \n   A   d   i   s   k   r   e   a   d   e   r
400   r   o   r   o   c   c   u   r   r   e   d  \0  \r  \n   B
416   O   O   T   M   G   R   i   s   m   i   s   s   i   n
432   g  \0  \r  \n   B   O   O   T   M   G   R   i   s   c
448   o   m   p   r   e   s   s   e   d  \0  \r  \n   P   r   e   s
464   s   C   t   r   l   +   A   l   t   +   D   e   l   t
480   o   r   e   s   t   a   r   t  \r  \n  \0  \0  \0  \0  \0
496  \0  \0  \0  \0  \0  \0  \0  \0 200 235 262 312  \0  \0   U 252
512
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



Re: [gentoo-user] is grub in my mbr?

2008-05-21 Thread Neil Bothwick
On Wed, 21 May 2008 11:00:50 -0400, Allan Gottlieb wrote:

 ajglap ~ # dd if=/dev/sda2 ibs=512 count=1 | od -c --address-radix=d

dd if=/dev/sda bs=446 count=1 2/dev/null | strings | grep GRUB

Is clearer, add a partition number to check a partition.


-- 
Neil Bothwick

The trouble with the world is that everybody in it is three drinks behind.


signature.asc
Description: PGP signature


Re: [gentoo-user] is grub in my mbr?

2008-05-21 Thread Alan McKinnon
On Wednesday 21 May 2008, Mark Knecht 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.

I skipped over most of this thread, I now wished I hadn't :-) Not having 
the previous posts handy, this might already have been answered, but 
I'll go ahead anyway. The way I normally do the extraction is very 
simple:

from mbr:
dd if=/dev/sda of=/dev/pts/0 bs=512 count=1

from disk partition:
dd if=/dev/sda1 of=/dev/pts/0 bs=512 count=1

Change the of= appropriately, of course


-- 
Alan McKinnon
alan dot mckinnon at gmail dot com

-- 
gentoo-user@lists.gentoo.org mailing list



Re: [gentoo-user] is grub in my mbr?

2008-05-21 Thread Mark Knecht
On Wed, May 21, 2008 at 8:31 AM, Neil Bothwick [EMAIL PROTECTED] wrote:
 On Wed, 21 May 2008 11:00:50 -0400, Allan Gottlieb wrote:

 ajglap ~ # dd if=/dev/sda2 ibs=512 count=1 | od -c --address-radix=d

 dd if=/dev/sda bs=446 count=1 2/dev/null | strings | grep GRUB

 Is clearer, add a partition number to check a partition.


 --
 Neil Bothwick

Neil,
   That single command would have saved me some heartache in the past.
I think it could be a good one-line addition to even something like
the Quick Install guide - I.e. If you want to sanity check your grub
installation then run this command to ensure grub is located where you
think it's located...

  Great info. thanks!

Cheers,
Mark
-- 
gentoo-user@lists.gentoo.org mailing list



Re: [gentoo-user] is grub in my mbr?

2008-05-21 Thread Neil Bothwick
On Wed, 21 May 2008 09:07:28 -0700, Mark Knecht wrote:

  dd if=/dev/sda bs=446 count=1 2/dev/null | strings | grep GRUB

That single command would have saved me some heartache in the past.
 I think it could be a good one-line addition to even something like
 the Quick Install guide - I.e. If you want to sanity check your grub
 installation then run this command to ensure grub is located where you
 think it's located...

You could check for all instances with

for i in /dev/[hs]d*
dd if=$i bs=446 count=1 2/dev/null | strings | grep -q GRUB \
 echo GRUB found in $i
 

-- 
Neil Bothwick

OS/2: Obsolete Soon, Too


signature.asc
Description: PGP signature


Re: [gentoo-user] is grub in my mbr?

2008-05-21 Thread Mark Knecht
On Wed, May 21, 2008 at 11:13 AM, Neil Bothwick [EMAIL PROTECTED] wrote:
 On Wed, 21 May 2008 09:07:28 -0700, Mark Knecht wrote:

  dd if=/dev/sda bs=446 count=1 2/dev/null | strings | grep GRUB

That single command would have saved me some heartache in the past.
 I think it could be a good one-line addition to even something like
 the Quick Install guide - I.e. If you want to sanity check your grub
 installation then run this command to ensure grub is located where you
 think it's located...

 You could check for all instances with

 for i in /dev/[hs]d*
 dd if=$i bs=446 count=1 2/dev/null | strings | grep -q GRUB \
  echo GRUB found in $i


This is great info. I know of one case a long time ago, maybe 2001 or
2002, where I used an older drive and got burned by a preexisting copy
of grub in the MBR conflicting with the version I had installed into a
specific partition. I kept thinking grub was working but doing the
wrong thing. I suspect that had I run some commands like the ones were
talking about here I would have found the problem. As it turned out I
didn't and went the direction of completely repartitioning the drive.
What a waste!

Cheers,
Mark
-- 
gentoo-user@lists.gentoo.org mailing list



[gentoo-user] is grub in my mbr?

2008-05-20 Thread Allan Gottlieb
I believe that when I upgrade grub I am supposed to re-run it.

I would like to keep the same configuration I have know but am not
sure if I installed grub in the MBR (I dual boot windows since it is
often needed when calling Dell Support).

I believe that I do have grub in the mbr, but wish to confirm it so
executed an od to confirm.

Here is my disk layout (a one disk laptop)

ajglap ~ # fdisk -l

Disk /dev/sda: 100.0 GB, 100030242816 bytes
255 heads, 63 sectors/track, 12161 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0800

   Device Boot  Start End  Blocks   Id  System
/dev/sda1   1   6   48163+  de  Dell Utility
/dev/sda2   *   71963157163527  HPFS/NTFS
/dev/sda319631975   98683+  83  Linux
/dev/sda41976   12161818190455  Extended
/dev/sda519762098  987966   82  Linux swap / Solaris
/dev/sda62099453119543041   83  Linux
/dev/sda74532599111727418+  83  Linux
/dev/sda85992842419543041   83  Linux
/dev/sda98425   1085719543041   83  Linux
ajglap ~ # 

Here is an od of the mbr

ajglap ~ # dd if=/dev/sda ibs=512 count=1 | od -c --address-radix=d
1+0 records in
1+0 records out
000 353   H 220 320 274  \0   | 216 300 216 330 276  \0   | 277  \0
016 006 271  \0 002 374 363 244   P   h 034 006 313 373 271 004  \0
032 275 276  \a 200   ~  \0  \0   |  \v 017 205 020 001 203 305 020
048 342 361 315 030 210   V  \0   U 306   F 021 005 306   F 003 002
512 bytes (512 B) copied, 1.8159e-05 s, 28.2 MB/s
064 377  \0  \0 001  \0  \0  \0  \0 002 372 220 220 366 302 200
080   u 002 262 200 352   Y   |  \0  \0   1 300 216 330 216 320 274
096  \0 373 240   @   |377   t 002 210 302   R 276 177   }
112 350   4 001 366 302 200   t   T 264   A 273 252   U 315 023   Z
128   R   r   I 201 373   U 252   u   C 240   A   | 204 300   u 005
144 203 341 001   t   7   f 213   L 020 276 005   | 306   D 377 001
160   f 213 036   D   | 307 004 020  \0 307   D 002 001  \0   f 211
176   \  \b 307   D 006  \0   p   f   1 300 211   D 004   f 211   D
192  \f 264   B 315 023   r 005 273  \0   p 353   } 264  \b 315 023
208   s  \n 366 302 200 017 204 352  \0 351 215  \0 276 005   | 306
224   D 377  \0   f   1 300 210 360   @   f 211   D 004   1 322 210
240 312 301 342 002 210 350 210 364   @ 211   D  \b   1 300 210 320
256 300 350 002   f 211 004   f 241   D   |   f   1 322   f 367   4
272 210   T  \n   f   1 322   f 367   t 004 210   T  \v 211   D  \f
288   ;   D  \b   }212   T  \r 300 342 006 212   L  \n 376 301
304  \b 321 212   l  \f   Z 212   t  \v 273  \0   p 216 303   1 333
320 270 001 002 315 023   r   * 214 303 216 006   H   |   ` 036 271
336  \0 001 216 333   1 366   1 377 374 363 245 037   a 377  B
352   | 276 205   } 350   @  \0 353 016 276 212   } 350   8  \0 353
368 006 276 224   } 350   0  \0 276 231   } 350   *  \0 353 376   G
384   R   U   B  \0   G   e   o   m  \0   H   a   r   d   D
400   i   s   k  \0   R   e   a   d  \0   E   r   r   o   r  \0
416 273 001  \0 264 016 315 020 254 \0   u 364 303  \0  \0  \0
432  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \b  \0  \0  \0 001
448 001  \0 336 376   ? 005   ?  \0  \0  \0   G   x 001  \0 200 036
464 031 006  \a 376 377 377  \0 200 001  \0  \0 240 337 001  \0 376
480 377 377 203 376 377 377  \0 341 001 367 002 003  \0  \0 376
496 377 377 005 376 377 377 367344 001   J 353 300  \t   U 252
512

Am I right that seeing `GRUB' in bytes 383-386 (decimal) is proof that
I did install grub in the MBR?

thanks,
allan

-- 
gentoo-user@lists.gentoo.org mailing list



Re: [gentoo-user] is grub in my mbr?

2008-05-20 Thread Dirk Heinrichs
Am Mittwoch, 21. Mai 2008 schrieb ext Allan Gottlieb:

 I believe that when I upgrade grub I am supposed to re-run it.

Only if you want to upgrade your MBR too.

 Am I right that seeing `GRUB' in bytes 383-386 (decimal) is proof that
 I did install grub in the MBR?

At least it isn't LiLo ;-)

Bye...

Dirk
-- 
Dirk Heinrichs  | Tel:  +49 (0)162 234 3408
Configuration Manager   | Fax:  +49 (0)211 47068 111
Capgemini Deutschland   | Mail: [EMAIL PROTECTED]
Wanheimerstraße 68  | Web:  http://www.capgemini.com
D-40468 Düsseldorf  | ICQ#: 110037733
GPG Public Key C2E467BB | Keyserver: wwwkeys.pgp.net


signature.asc
Description: This is a digitally signed message part.