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

Re: GRUB Reboot Loop



Pieter Agten wrote:

> Hello,
> 
> A couple of weeks ago I installed Debian Stable (3.1) on a PII 400Mhz
> with a 80GB harddisk, everything worked fine. I had to replace this
> harddisk with a different one (also 80GB) and I did this by cloning the
> original disk to this new one with HDClone 3.1. After replacing the
> harddisk, the system doesn't boot anymore: when I should see the GRUB
> Boot Menu,  the system just reboots. So now it is stuck in a reboot loop.
> 
> The exact boot process is as follows:
> - System POST
> - I see 'GRUB Loading stage1.5.' and 'GRUB loading, please wait...' for
> about half a second.
> - Reboot
> 
> I am sure the HDClone 3.1 program works flawlessly because I have used
> it before (on linux systems) and it has never failed. Furthermore, I
> have had this problem before on an entirely different system, right
> after the Debian installation (so on that system I never had even one
> correct boot with GRUB).
> 
> How can I solve this problem? One fix might be to install LILO instead
> of GRUB, but what is the best way to do this? I replaced GRUB by LILO
> once before, and after that, everytime I would install a different (home
> made) kernel, I had to adjust the lilo.conf and run lilo manually, so I
> would like to avoid that. If it is possible, I would like to keep GRUB...
> 
> Thanks in advance!

Most likely: GRUB got written to a different cluster than original - a
common event in cloning.  As a result, the code in bootsector points to
wrong location on partition and GRUB is confused.

To fix it, start up GRUB in interactive mode (as root) and rewrite the
bootsector:

# Assuming boot partition is on first hard drive (hd0):

$ sudo grub

    GNU GRUB  version 0.97  (640K lower / 3072K upper memory)

       [ Minimal BASH-like line editing is supported.   For
         the   first   word,  TAB  lists  possible  command
         completions.  Anywhere else TAB lists the possible
         completions of a device/filename. ]

# type "root (hd0, " then press tab key to get list of partitions:

grub> root (hd0,
 Possible partitions are:
   Partition num: 0,  Filesystem type is fat, partition type 0x16
   Partition num: 2,  Filesystem type unknown, partition type 0x7
   Partition num: 4,  Filesystem type unknown, partition type 0x82
   Partition num: 5,  Filesystem type is reiserfs, partition type 0x93
   Partition num: 6,  Filesystem type is fat, partition type 0xb

# Here, partition 5 has grub directory, so:

grub> root (hd0,5)
 Filesystem type is reiserfs, partition type 0x93

# now rewrite the bootsector:

grub> setup (hd0)
 Checking if "/boot/grub/stage1" exists... yes
 Checking if "/boot/grub/stage2" exists... yes
 Checking if "/boot/grub/reiserfs_stage1_5" exists... yes
 Running "embed /boot/grub/reiserfs_stage1_5 (hd0)"...  18 sectors are
embedded.
succeeded
 Running "install /boot/grub/stage1 (hd0) (hd0)1+18 p
(hd0,5)/boot/grub/stage2 /boot/grub/menu.lst
"... succeeded
Done.

# we're done:
grub> reboot

Adjust the numbers to fit your situation.  Hope this helps!




Reply to: