# grub-0.97-x appends garbage chars; can cause boot to fail

## avenj

grub-0.97-r5 (as of this posting, the most recent ~arch-keyworded grub update - and not masked) has a bug that will potentially append garbage characters to the end of your kernel command line. In many cases the last command passed to the kernel by the bootloader will be root=/dev/drive. This may leave your system unbootable, causing a VFS error on boot when it cannot find /dev/drive<garbage>, or otherwise break the last option on your bootloader's kernel line.

You may see errors like:

 *Quote:*   

> 
> 
> Cannot open root device /dev/sda3<garbage characters> or unknown-block(0,0)<garbage characters>
> 
> Please append a correct "root=" boot option; here are the available partitions:
> ...

 

There is a workaround to this problem. While in the grub menu at boot time use 'e' to edit the currently selected command and add a space or other meaningless character to the end of your kernel command line. You can also use a working grub bootdisk to boot your system, or chroot from a bootable CD. 

Once booted back into a usable system, downgrade to 0.97-r4 and reinstall grub to your MBR via the grub shell (there are instructions in the handbook) and you should be OK.

The relevant bug report: https://bugs.gentoo.org/show_bug.cgi?id=216307

mod edit: sticky.  --bunder

Unstuck 8 Jan 2010, bug long since fixed. --timeBandit

----------

## avenj

grub-0.97-r5 is now fixed in the tree, but there has not yet been a revision bump.

If you are running 0.97-r5 you may want to doublecheck that you have the fixed patchset by re-syncing and re-merging grub.

Broken ebuild:

# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/grub-0.97-r5.ebuild,v 1.7 2008/04/06 22:41:51 vapier Exp $

Fixed ebuild:

# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/grub-0.97-r5.ebuild,v 1.8 2008/04/07 08:14:09 robbat2 Exp $

----------

## cerebus_k

I'm having problems booting my system. I'm getting a 

```
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
```

and it appears to be due to garbage in the root devide name. A few lines back from the above message shows the line 

```
VFS: Cannot open root device "hda3xxxxxx" or unknown-block(0,0)
```

where the xxxxxx in the "hda3xxxxxx" have garbage characters. These garbage characters are different for each reboot. 

I'm using grub and have several kernals defined and I've tried booting each with the same results as above.

I'm kind of at a loss here to know where to go. I'm searching using Google but I'm not sure what I'm looking for (and Google is returning a lot of noise). 

If anyone can point me in the general direction of what might be causing this and/or what I might do to correct this, I'd sure appreciate it. 

TIA .. bill

----------

## nixnut

merged above post here.

----------

## peter4

Hi, 

it's a rather weird problem. My menu.lst says "kernel /vmlinuz root=/dev/hda4 video=uvesafb:1024x768-32,mtrr:3,ywrap " (note the space at the end), but dmesg says:

```
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 455165

Kernel command line: root=/dev/hda4 video=uvesafb:1024x768-32,mtrr:3,ywrap �����B��

��

  �Q����~*;��y1�Y

mapped APIC to ffffb000 (fee00000)

```

...that's why I have to add the space at the end, so that it doesn;t become part of video statement. Also it's worth noting that it's different after each boot. Any ideas what this is?

----------

## nixnut

merged above post here.

----------

## darkeye

interesting - I just upgraded my system, and now the screen seems to be corrupting during the boot process. first I thought it's a kernel-upgrade issue, but putting back the old kernel yields the same results. I have grub-0.97-r6.

----------

## desultory

That is actually a different bug, in short your splash image is missing due to having upgraded without running emerge --config grub or manually copying a splash image into the expected location.

----------

## darkeye

 *desultory wrote:*   

> That is actually a different bug, in short your splash image is missing due to having upgraded without running emerge --config grub or manually copying a splash image into the expected location.

 

thanks. actually running grub-install /dev/sda solved the issue as well...

----------

## edoiks2

I have recently installed a 2008.0, after compiling a kernel (gentoo-sources 2.6.25-r8) and configuring a Grub i restart a computer. When Grub tries to load a kernel everything stops and i cant do anything, first i thought that it is a foult of a kernel but I used a genkernel to make a new one and problem didn't disapear. I only see this:

[Linux-bzImage, setup=0x2c00, size=0x2a329c] 

and everything stops...

A live cd works perfect.

----------

