Grub 0.97-29ubuntu62 gives error "Error 6: Mismatched or corrupt version of stage1/stage2"
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
grub (Ubuntu) |
Fix Released
|
Critical
|
Colin Watson | ||
Oneiric |
Fix Released
|
Critical
|
Colin Watson |
Bug Description
On the Oneiric testing system, I ran grub-install to reinstall grub for Debian Lenny.
$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_
DISTRIB_
DISTRIB_
The version of grub:
$ dpkg -l |grep grub
ii grub 0.97-29ubuntu62 GRand Unified Bootloader (Legacy version)
ii grub-common 1.99-11ubuntu1 GRand Unified Bootloader (common files)
Debian Lenny is on /dev/sda:
$ parted -s /dev/sda print
Model: ATA VMware Virtual I (scsi)
Disk /dev/sda: 17.2GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 32.3kB 354MB 354MB primary ext3 boot
2 354MB 8587MB 8234MB extended
5 354MB 3381MB 3027MB logical ext3
6 3381MB 4836MB 1456MB logical ext3
7 4836MB 5338MB 502MB logical linux-swap(v1)
8 5338MB 5601MB 263MB logical ext3
9 5601MB 8587MB 2986MB logical ext3
The root partition of Debian Lenny is /dev/sda1, therefore:
1. mount /dev/sda1 /mnt/
2. ls -alFd /mnt/boot/grub/
drwxr-xr-x 2 root root 1024 2011-08-31 03:12 /mnt/boot/grub/
3. grub-install --no-floppy --root-
Installing GRUB to /dev/sda as (hd0)...
[ Minimal BASH-like line editing is supported. For
the first word, TAB lists possible command
grub> root (hd0,0)
grub> setup --stage2=
Checking if "/boot/grub/stage1" exists... yes
Checking if "/boot/grub/stage2" exists... yes
Checking if "/boot/
Running "embed /boot/grub/
succeeded
Running "install --stage2=
Error 6: Mismatched or corrupt version of stage1/stage2
grub> quit
After downgrading to the grub version on Natty, i.e. grub_0.
$ dpkg -i grub_0.
dpkg: warning: downgrading grub from 0.97-29ubuntu62 to 0.97-29ubuntu61.
(Reading database ... 21423 files and directories currently installed.)
Preparing to replace grub 0.97-29ubuntu62 (using grub_0.
Unpacking replacement grub ...
Setting up grub (0.97-29ubuntu61) ...
root@oneiric:~# grub-install --no-floppy --root-
Installing GRUB to /dev/sda as (hd0)...
Installation finished. No error reported.
This is the contents of the device map /mnt//boot/
Check if this is correct or not. If any of the lines is incorrect,
fix it and re-run the script `grub-install'.
(hd0) /dev/sda
(hd1) /dev/sdb
I also experienced this bug when trying to use vmbuilder to create an oneiric VM. During the bootloader step (grub 0.97-29ubuntu62) I get the following:
2011-09-09 16:38:03,944 DEBUG : ['chroot', '/tmp/tmphxwuJ8', 'grub', '--device- map=/tmp/ vmbuilder- grub/device. map', '--batch'] grub/e2fs_ stage1_ 5" exists... yes e2fs_stage1_ 5 (hd0)"... 21 sectors are embedded. /boot/grub/ stage2 /boot/grub/ menu.lst" ... failed
2011-09-09 16:38:03,945 DEBUG : stdin was set and it was a string: root (hd0,0)
setup (hd0)
EOT
2011-09-09 16:38:07,981 DEBUG :
2011-09-09 16:38:07,981 DEBUG : [ Minimal BASH-like line editing is supported. For
2011-09-09 16:38:07,982 DEBUG : the first word, TAB lists possible command
2011-09-09 16:38:07,982 DEBUG : completions. Anywhere else TAB lists the possible
2011-09-09 16:38:07,982 DEBUG : completions of a device/filename. ]
2011-09-09 16:38:07,982 DEBUG : grub> root (hd0,0)
2011-09-09 16:38:07,983 DEBUG : grub> setup (hd0)
2011-09-09 16:38:07,983 DEBUG : Checking if "/boot/grub/stage1" exists... yes
2011-09-09 16:38:07,983 DEBUG : Checking if "/boot/grub/stage2" exists... yes
2011-09-09 16:38:07,984 DEBUG : Checking if "/boot/
2011-09-09 16:38:07,984 DEBUG : Running "embed /boot/grub/
2011-09-09 16:38:07,984 DEBUG : succeeded
2011-09-09 16:38:07,984 DEBUG : Running "install /boot/grub/stage1 (hd0) (hd0)1+21 p (hd0,0)
2011-09-09 16:38:07,985 DEBUG :
2011-09-09 16:38:07,985 DEBUG : Error 6: Mismatched or corrupt version of stage1/stage2
2011-09-09 16:38:07,985 DEBUG : grub> EOT
When using the same vmbuilder config but natty (grub 0.97-29ubuntu61) it works correctly:
2011-09-09 17:23:27,158 DEBUG : ['chroot', '/tmp/tmpqBagP3', 'grub', '--device- map=/tmp/ vmbuilder- grub/device. map', '--batch'] grub/e2fs_ stage1_ 5" exists... yes e2fs_stage1_ 5 (hd0)"... 17 sectors are embedded. /boot/grub/ stage2 /boot/grub/ menu.lst" ... succeeded
2011-09-09 17:23:27,158 DEBUG : stdin was set and it was a string: root (hd0,0)
setup (hd0)
EOT
2011-09-09 17:23:29,191 DEBUG :
2011-09-09 17:23:29,192 DEBUG : [ Minimal BASH-like line editing is supported. For
2011-09-09 17:23:29,192 DEBUG : the first word, TAB lists possible command
2011-09-09 17:23:29,193 DEBUG : completions. Anywhere else TAB lists the possible
2011-09-09 17:23:29,193 DEBUG : completions of a device/filename. ]
2011-09-09 17:23:29,193 DEBUG : grub> root (hd0,0)
2011-09-09 17:23:29,194 DEBUG : grub> setup (hd0)
2011-09-09 17:23:29,194 DEBUG : Checking if "/boot/grub/stage1" exists... yes
2011-09-09 17:23:29,194 DEBUG : Checking if "/boot/grub/stage2" exists... yes
2011-09-09 17:23:29,194 DEBUG : Checking if "/boot/
2011-09-09 17:23:29,195 DEBUG : Running "embed /boot/grub/
2011-09-09 17:23:29,195 DEBUG : succeeded
2011-09-09 17:23:29,196 DEBUG : Running "install /boot/grub/stage1 (hd0) (hd0)1+17 p (hd0,0)
2011-09-09 17:23:29,196 DEBUG : Done.
2011-09-09 17:23:29,196 DEBUG : grub> EOT