[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: did lilo rewrite my boot sector?



Matt Price wrote:
> 
> Hi,
> 
>  I was installing a new kernel and accidentally pressed "return" when
>  asked if I wanted to have lilo rewrite the boot sector of my disk.
>  The install failed, and I want to figure out whether the boot sector
>  was ACTUALLY rewritten.  I use GRUB, so I'd really rather not have to
>  deal with setting up the boot loader all over again...
> 
> Is there a way to look at the boot record and see when it was last
> modified, or what its contents are?
> 
> thanks,
> matt


One way to look at disk sectors is by using the hexedit program. Hexedit
is a Debian package. It will help if you know where Grub is/was
installed. 

If in the MBR, you could use the command 'hexedit -s /dev/hda' to look
at the MBR sector. If installed in the boot sector of /dev/hda1, the
command 'hexedit -s /dev/hda1' would show the boot sector for /dev/hda1
etc.

Boot sectors installed by Lilo will have the "LILO" string visible on
the first line like this"

FA EB 32 90 A4 01 4C 49  4C 4F 01 00 16 03 00 00  ..2...LILO......

Boot sectors installed by Grub will have the 'GRUB' string present on
the 170h offset line like this:

7D E8 2A 00 EB FE 47 52  55 42 20 00 47 65 6F 6D  }.*...GRUB .Geom

Reinstalling Grub (if necessary) is pretty simple to do though. Check
the man page for the 'grub-install' command. The 'update-grub' command
is also good to know about. 

Tom



Reply to: