GRUB "Error 2" May Mean Incompatible stage1.5, stage2, and ext2

Submitted Wed Mar 18 20:10:03 2009 under tags "linux,grub,technology"

I just spent a couple of hours fighting with GRUB. I thought I'd document here what happened to me and how I solved it, in case someone else has the same problem and starts googling around. Don't bother reading this unless you are a Linux nut.

I wanted to transition my GRUB partition (typically /boot, but /boot/grub for me) from my second hard disk (don't ask) to my first hard disk.

I:

I received an "Error 2" from GRUB. What this means is that GRUB could not open the partition I initialized it with, which is odd, since I had just used GRUB to set itself up, so I knew that GRUB saw hd0,1 from the Ubuntu live session.

I rebooted into the liveCD image. Ran GRUB. I ran find menu.lst and the output was (hd0,1) and (hd1,2) , so GRUB could definitely see both partitions from inside the live session.

I ran setup --prefix= (hd2,1) in order to restore the old GRUB partition, and rebooted. Then I was able to enter GRUB's command line using "c". Inside GRUB booted from the BIOS, though, find menu.lst only output (hd1,2) . The implication is that GRUB inside the live session can see both partitions, but somehow the GRUB installed into the MBR could see only the original partition but not the one I just created. GRUB from the BIOS could see my other hd0 partitions, as find vmlinuz returned (hd0,2) , where one of my Linux installations lives, so it's not like the BIOS couldn't see that first drive.

So my hunch is that a newer ext2 filesystem has some incompatibility with the old stage1.5 that was in the GRUB partition. I booted into an older version of Linux that I had around on CD, about a year old (early 2008), initialized the /dev/sda2 partition again, copied everything over, ran GRUB, and it booted right up. Argh! So when I said "I had just used GRUB to set itself up," I was mixing versions. I had used an old set of GRUB installation files (stage1.5, stage2, etc) but a new GRUB and mkfs.

So I guess the lesson learned is one of two things:


Visit Brad's Home Page

See Brad's Full Blog Entry List