Comment 47 for bug 477104

Revision history for this message
Mark Abene (marcocinco) wrote :

Fresh Ubuntu 9.10 wubi install here. And here's the deal:
After updating and regenerating /boot/grub/grub.cfg (which is the same as original), a fresh boot drops me to the grub prompt. Grub2 is unable to read any text files at all now, which is the obvious reason for being dumped to the grub prompt. "cat /boot/grub/grub.cfg" gives a screen full of garbage. Even "cat /etc/passwd" gives garbage. "ls" can find the files just fine. I can still boot manually by giving the proper "linux" and "initrd" arguments. These files are NOT ACTUALLY CORRUPTED, they can be read just fine in ubuntu. Only grub can no longer read them. That's problem #1.

Now, problem #2: if you build a fresh kernel from source and install it into /boot, grub2 can't boot it. "Invalid magic number" is the error, no matter what you do. I first ran update-grub, which creates the proper grub.cfg in /boot/grub, but it's unreadable while in grub2 (see above problem). The grub.cfg is perfectly readable when booted in ubuntu. I also tried running grub-install after, which only modifies the "wubildr" file in the root directory of my windows drive ("wubildr.mbr" is untouched). This makes no difference. Worse still, if you move, rename, etc., the original stock generic kernel or initrd from the base install, grub will NEVER LOAD IT AGAIN at boot, you'll get the same "Invalid magic number" error in grub as you would from building your own kernel. I already killed a fresh install this way. Despite booting from usb and mounting/chroot my install, running grub-install a million times couldn't fix that problem. grub-install also leaves behind a whole mess of seemingly useless files in /boot/grub. And yes, I've verified that I'm running the grub-install wrapper from the lupin package.

Summary: Moving, renaming, or regenerating ANY file, whether it's the kernel, initrd or grub.cfg results in those files becoming unreadable by grub2, probably because they're not being found in the correct place on the drive, resulting in garbage for text files, and invalid magic numbers for binaries. Also, grub-install's modification of C:\wubildr has no effect, and it also leaves behind a mess in /boot/grub on the linux side.

I'd say this is pretty serious, since I already rendered my original install completely unbootable as a result of these problems.