# grub stopped working suddenly

## juniper

hello,

i tried to do a kernel update (something i have done a million times) and all of the sudden grub stopped working.

i did the usual of  copying bzImage and System.map to /boot and editting my /boot/grub/grub.conf to include the new kernel.

then, instead of starting, i just get a blank black screen with

GRUB

in the top left corner.

i have used a live cd to look at my grub.conf and i couldn't see a problem.  i removed the new boot entry and that didn't fix it.

what could cause this?  keep in mind i have done this a million times and all of  the sudden this has happened.

help!!!

j

----------

## CrazyPyro

I think even if you had a bad config file, GRUB would still start.  It's more likely that something's messed with the grub binary.  Have you tried reinstalling GRUB?  If that fails to solve it, check to see if you've recently upgraded to glibc-2.3.5 - I know the new glibc was causing problems with Nvidia GLX, so who knows what other things it might break...

----------

## Bitwaba

I'm not sure if i understand you.  It sounded like you were saying that you get a black screen after grub tries to boot.  If this is the case, then you probably have a bad kernel, so you should boot back up with your old one and recompile the new.

However, if you are getting the black screen when grub is trying to start, then your grub has probably become corrupt some how.

You would probably want to reinstall it.  I think you can do this by typing "grub" at your prompt. but if not you probably would have to reemerge it.  Either way, i think the info can be found in the gentoo handbook.

----------

## widremann

This happened to me too.  All you have to do after installing a new kernel is run 'grub-install --recheck /dev/hda' and possible 'grub-install /dev/hda' just to be sure.  I think the kernel install somehow messes up GRUB's hardware map.  I don't know how or why, but I know that this works, so until they fix the bug, just do this.

----------

## Raistlin

 *widremann wrote:*   

> ...I think the kernel install somehow messes up GRUB's hardware map.  I don't know how or why, but I know that this works, so until they fix the bug, just do this.

 

Please specify, what you mean by "kernel install". IMHO the most probable thing that prevents grub from loading is a messed-up MBR - and this shld not happen unless you write into the first block of your hd..

cheers, R.

----------

## sidkdbl07

I have exactly the same trouble. Upon booting, my computer gets oast the bios screen but doesn't get to the grub splash screen. It just says GRUB in the top left corner.

I went in with liveCD and re-emerged grub-0.96-r1.... didn't work

I went in with liveCD and emerged grub-0.94-r1.... didn't work

I went in with liveCD and re-emerged grub-0.96-r1.... didn't work

I tried 'grub-install --recheck /dev/hda' after every install and I get the following error

```
Probing devices to guess BIOS drives. This may take a long time.

floppy0: no floppy controllers found

Could not find device for /boot: Not found or not a block device
```

Any ideas?

P.S. I emerged glibc-2.3.5 at the same time I updated grub yesterday.

----------

## penguinlnx

I have had that in the past when GRUB tried to write to a Windose Drive BOOT SECTOR and trashed the drive.

GRUB sometimes does this....

My solution is to boot up with the 4-disk Win2K emergency disk set and go into a Win2K commandline.  Although there are no decent commands on the disks, there is a built-in command (you can list them by typing HELP) called FIXMBR. this restores the Master Boot Record to a bootable one.  There is another command called FIXBOOT you can execute as well.

Now you can usually reinstall your Windows side (dual boot) or reboot off a liveCD and reinstall LINUX using the GUI Partition program in either the VLOS Gentoo disk, or even a RED HAT partition maker.  I can't really tell you how to recover critical partitions that may be okay, except to warn you that any FDISK type program can delete them forever, so you should do a listing of your (still usable) partitions from the commandline: 

```
# FDISK /DEV/HDA

(from within FDISK type: P (list partitions)

and you should get a list of all the partitions of the drive onscreen here.

WRITE THEM DOWN and carefully figure out what each partition really is. (SWAP, ROOT, BOOT etc.)

```

I hope this is a start for you.

----------

## sidkdbl07

I don't have a windows partition. Gentoo is the only thing I run.

----------

## penguinlnx

In any case, the MBR (master boot record) is either damaged, or GRUB can't find the /boot or /root.  

You need to restore the /boot (this shouldn't be too bad if you can reinstall Gentoo without repartitioning your /root partition.

Then you could save most of your files and programs.  If you can boot a liveCD and 'see' the other partitions, you can mount them and hopefully copy the files off before reinstalling Gentoo, if you can't actually save the partitions.

Alternately, if you can boot from the CD and get on the web, you could upload the files to a server or another computer on the net.

By the way, I tried that thing by dropping into a commandline and got this: 

```
#grub-install --recheck /dev/hda <enter>

(fd0)   /dev/fd0

(hd0)   /dev/hda

tux root #
```

----------

## penguinlnx

"DING"  Idea:  It could be a bad hard drive cable.  You should shut down, try unplugging and replugging in your cable, then reinstall GRUB  and/or your /boot partition.  

For tips on a possible hardware problem, see my thread here;

HARDWARE Failures: READ ME!

https://forums.gentoo.org/viewtopic-t-324144.html

-just in case your problem can't be solved without a bit of maintainence.

----------

## penguinlnx

Okay I have a third idea, after trying to reboot from this mess.

Dropping into a commandline and executing grub-install --recheck /dev/hda <enter>was disastrous! 

Afterward, my system was unable to reboot!  Now the good news:  I was able to duplicate your problem.  

My machine now boots to a black screen with GRUB> as a prompt. 

But now I know what this is:  it is the same prompt you get if you run GRUB <enter>  from the commandline.

That is, you are looking at the prompt that GRUB gives you, when you are about to manually configure GRUB.

To be exact, on trying to reboot, my screen looked like this:

```
GNU GRUB .96 (639k lower/3092840k 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.]

grub> (if you press TAB here, you get this:)

Possible commands are: background blocklist boot cat (...a whole pile of commands ....HELP ....some more commands).

grub> (if you type HELP here, you get columns with examples of arguments for each command.)
```

If this is your case, you can probably repair your BOOT partition and get back up again by following your handbook and manually re-installing GRUB. I found that from here (after booting) I could not proceed to a Linux commandline because the kernel was not yet loaded.

I solved my problem this way, and it should work whether or not 

you are sitting in GRUB after bootup, or just hung frozen:

(1) Reboot with the LiveCD.

(2) mount the swap drive (make sure you know what the partition was: mine was hda2.)

a) # mkswap /dev/hda2 <enter>

b) # swapon /dev/hda2 <enter>

(3) mount the other boot and root partitions:

a) # mount /dev/hda4 (yours might be hda3) /mnt/gentoo <enter> (this directory should exist)

b) # mkdir /mnt/gentoo/boot <enter> (try this, you may already have a dummy folder here named 'boot'. Don't worry if you get an error.)

c) # mount /dev/hda1 (the boot partition) /mnt/gentoo/boot <enter>

d) # mount -t proc none /mnt/gentoo/proc  <enter> (this I think is necessary when booting off the liveCD)

(4) chroot to your hard drive: 

a) # chroot /mnt/gentoo /bin/bash <enter>

b) # env-update <enter>  (this may take a couple of minutes...)

c) # source /etc/profile <enter>

(You probably don't need to do anything else, if your file systems are intact, other than the GRUB files.)

(5) Reinstall GRUB:

a) # grub-install --root-directory=/boot /dev/hda <enter>

 (if you get an error here, make sure you have chrooted and mounted properly, start again.

That is, Exit and unmount, by following step 6, and reboot with the LiveCD again:)

(6) Exit the chrooted environment and unmount all partitions:

a) # exit <enter>

b) # cd <enter>

c) # umount /mnt/gentoo/boot /mnt/gentoo/proc /mnt/gentoo <enter>

d) # reboot <enter> 

(don't forget to pull the CD out of the drive after you get the blank screen/BIOS screen.) Doing this restored my bootup to its usual errors, 

some of which I haven't fixed yet.  Please post a reply whether this works or not for you.

----------

## pazz

hi!

I have the same problem.

I's not the Grub shell i get after rebooting, but just the letters 

GRUB after hw related infor of my bios.

no respose to any keypresses from grub.

i also tried to remerge grub, ran grub-install and so on, but still the same error.

pazz

----------

## penguinlnx

Note that I am using GRUB .96.  

Second, notice that one of the other fellows did this:

 *Quote:*   

> I tried 'grub-install --recheck /dev/hda' after every install and I get the following error ...

 

I now believe this command to be dangerous and probably contains some buggy code.

Until that is clarified, try the instructions I have posted, and let me know if this series of steps works.

The steps I have posted DID work for me, and saved my system and partitions.

----------

## Cintra

I guess juniper fixed  it..  :Wink: 

btw for anyone with a floppy the following guide will let you boot from a grub floppy

http://www.wbglinks.net/pages/reads/wbgreads/linux/grub.html

good to have around.. in fact I use it all the time

mvh

----------

## pamplemousse

Hello, 

I think I have made a very big mistake. I have following Penguinlnx method. But at the 2nd step, when mounting swapdrive, I have launch this: 

```

mkswap /dev/hda7

swapon /dev/hda7

```

, thinking hda7 is my swap partition but NO! it is my boot partition!!!! and my swap partition is hda8. Very very big mistake because now I have lost my boot partition, it is now a swap partition.  :Mad: 

I have launched System Rescue CD boot disk to verify this and it is right: hda7 and hda8 are now swap partitions.

I actually use Knoppix boot cd to write this message. Have I definitively broken my Gento system? Should I reinstall all my system from the beginning, like a new computer? Installing this Pentium III-500 had taken one week to 10 days in the past...  :Crying or Very sad: 

Bye.

----------

## penguinlnx

This isn't so bad then:

You only need to redo the BOOT partition.

When you boot the LiveCD, you have to delete the 2nd SWAP partition and re-partition it to be a BOOT partition.

Then re-compile your kernel and install GRUB.  This might save the main ROOT partitions if you have files on those.

You could try to do it with one of the GUI driven install disks as well, but this would be experimental.

You could boot with a VidaLinux Install disk, and when you get to the GUI driven Partition program it would be fairly easy to put things right and get your system back up.

 You can then convert it to a 'true' Gentoo system later, after recovering your files.

----------

## pamplemousse

Hello,

very thank you, penguinlnx, now I can relax. I have launch System Rescue CD to format my hda7 to a ext2 partition. I have boot the LiveCD, and make all the procedures to get the good environment (after chroot). And then, I have compiled the kernel, and emerge Grub. 

I have read the old install documentation of Gentoo I had printed the last year when I had installed Gentoo for the 1st time. I have follow all the steps to configure grub. At last, it tells to write the grub.conf file like this:

```

# Boot automatically after 30 secs.

timeout 30

# By default, boot the first entry.

default 0

# Fallback to the second entry.

fallback 1

# For booting GNU/Hurd

title  GNU/Gentoo 2.6.9

root   (hd0,6)

kernel (hd0,6)/boot/bzImage root=/dev/hda9

```

But when rebooting, grub tells me it can't the bzImage file. After trying several possibilites, I found that writing this line:

```
kernel /bzImage root=/dev/hda9
```

works and now my Gentoo system boots well. 

Thanks a lot!

----------

## sidkdbl07

No dice yet  :Confused: 

I get the following error

 *Quote:*   

> -> grub-install --root-directory=/boot /dev/hda
> 
> Could not find device for /boot/boot: Not found or not a block device
> 
> 

 

I'm getting really pissed! Sorry to be so krass, but AGGGGGHHHHHHH!!!!!

----------

## platojones

What partition is /boot on in your configuration?

----------

## sidkdbl07

/dev/hda1 is /boot (ex2)

/dev/hda2 is swap

/dev/hda3 is /root (reiserfs)

----------

## platojones

Ok, I see the problem.  First mount your /boot partition, then give the following grub-install command:

```

grub-install /dev/hda1

```

----------

## sidkdbl07

i used livecd 2005.1 to get in.

 *Quote:*   

> 
> 
> -> net-setup eth0
> 
> -> mkswap /dev/hda2
> ...

 

Am I doing something wrong here? I also tried unmerging and the re-emerging grub from scratch... no dice.

----------

## platojones

Mount the /boot partition after you do the 'chroot /mnt/gentoo /bin/bash'.

----------

## sidkdbl07

Well... the good news is that I can get into the splash screen. I think I have some upgrading to do to accomodate the new kernel sources, but for now.......yeah, I can login!!!

Thank you for all of those involved.

----------

## [sinz]

I had the same deal but it was after I updated grub.  If you did also, maybe you updated world and didn't notice it?  You simply need to type:

```
root (hd0,0)

setup (hd0)

boot

```

at the grub prompt (on the black screen you get when you boot up).

----------

## Jalmar

Hey ho and good morning!

After a reinstall of my windoze-XP my mbr was wracked as well. But thanks to you, penguinlnx and platojones I managed to get my Gentoo back. Chrooting from my LiveCD and mounting /boot AFTERWARDS did the trick.

Damn, I hate messing around with windoze on the same hdd. I did it only because I need it for my job (Visual Studio .NET), and that's what I got   :Evil or Very Mad: 

----------

## harryr

I too recently updated 'world'.  I had the same error which started this thread.

I eventually followed the modified quote given in sidkdb107 email:

 *Quote:*   

> 
> 
> -> mount /dev/hda3 /mnt/gentoo 
> 
> -> mount -t proc none /mnt/gentoo/proc 
> ...

 

It didn't work.

I changed my grub-install /dev/hda1 command to hda[without 1].

This worked.

For the future and to know how I got into this sweating-bullet's situation,

did I update grub when I updated 'world' recently?

Why does an update of grub need a different MBR anyway?

Can updates of grub give an extra "Are you willing to proceed anyway?'

paranoia question?

I think this kind of catestrophic failure with simply updating world should

be unacceptable.  In the same -volunteer- friendly way though I want to

thank all who helped me recover so that it was no worse than just a few

hours of sweating bullets.  :Wink: 

----------

