grub error 22 when trying to boot to hde

Bug #27513 reported by Tony Austin
28
Affects Status Importance Assigned to Milestone
grub (Ubuntu)
Invalid
Medium
Unassigned

Bug Description

Grub was working without any bother when I had Gentoo Linux installed on the
very same machine.

The computer has 2 * standard IDE plus 2 * Highpoint IDE controller. I have
CDROM on hda and mirrored hard disks on hde and hdg (the Highpoint). Disks have
just 3 primary partitions each: /boot, swap, /.

/boot/grub/device.map says:-

(fd0) /dev/fd0
(hd0) /dev/hde
(hd1) /dev/hdg

This is what I do with grub to make a boot floppy on a floppy that has an empty
ext2 fs on it:-

grub> root (

 Possible disks are: fd0 hd0 hd1

grub> root (hd0,0)
 Filesystem type is ext2fs, partition type 0xfd

grub> kernel /vmlinuz-2.6.12-9-386 root=/dev/md2
   [Linux-bzImage, setup=0x1c00, size=0x124b0e]

grub> initrd /initrd.img-2.6.12-9-386

Error 16: Inconsistent filesystem structure {I didn't always get this message
and sometimes still don't}

grub> setup (fd0)
 Checking if "/boot/grub/stage1" exists... no
 Checking if "/grub/stage1" exists... yes
 Checking if "/grub/stage2" exists... yes
 Checking if "/grub/e2fs_stage1_5" exists... yes
 Running "embed /grub/e2fs_stage1_5 (fd0)"... failed (this is not fatal) Running
"embed /grub/e2fs_stage1_5 (hd0,0)"... failed (this is not fatal) Running "install
/grub/stage1 d (fd0) /grub/stage2 p /grub/menu.lst "...
succeeded
Done.

grub>

This works fine and the computer boots up from floppy.

If I do exactly the same except:-

grub>setup (hd0)

grub says that it has installed the bootloader successfully just as above, but
when I try to boot without the floppy I get:-

GRUB Loading stage1.5.
GRUB loading, please wait...
Error 22

I have tried changing the device.map so that (hd4) is /dev/hde and guess some
different (hdx) to try to get it to work, but without success.

Revision history for this message
Bruno (bruno666-666) wrote :

If you type grub hpt370 in google you should find an explanation and a workaround.
Here's the link : http://lists.gnu.org/archive/html/bug-grub/2004-07/msg00113.html

Revision history for this message
Paul Dufresne (paulduf) wrote :

In my opinion, you should ignore previous Bruno Patri comment.

I believe you are wrongly using initrd.
initrd can be use in command, or in menu, and I believed it to be
ignored by the setup command.
I believe that when you type
grub> initrd /initrd.img-2.6.12-9-386
it should try to load and execute the initrd file.
The error 16, seems to indicate, it was not able.
Maybe because you are running from Ubuntu?

The way to use it, is really inside menu.lst.

Also you say then I do setup (hd0), and then you test with the
floppy. But setup (hd0) install on hd0, not the floppy.

Maybe the manual could help:
http://www.gnu.org/software/grub/manual/grub.html

Tollef Fog Heen (tfheen)
Changed in grub:
assignee: tfheen → nobody
Revision history for this message
Adriano Grassi (califalcon) wrote :

This is a wild shot but it may help, I have seen this happen on my system if I had a usb flash drive plugged in while rebooting it would give the same error 22, after removing the usb drive and rebooting grub booted just fine.

Revision history for this message
Hal Lamborn (hlamborn) wrote :

10-15-2008 Hal Lamborn <email address hidden> I have the same problem on my PC after trying to run dual boot Xubuntu 8.04 desktop 32bit and 64bit with win xp pro the problem only occurs when I install xubuntu on my external USB HD if I install xubuntu on the
one and only internal HD within windows its ok but if I install on external HD within windows or not the problem occurs.

Revision history for this message
Daniel T Chen (crimsun) wrote :

Tony, is this symptom still reproducible in 8.10 or 9.04?

Changed in grub:
status: New → Incomplete
Revision history for this message
Toni Helenius (toni-helenius) wrote :

I come from duplicate https://bugs.launchpad.net/bugs/120488.

I installed Kubuntu 8.10 from scratch and I don't suffer from this anymore. I can keep my external HD now plugged in the USB without getting the error. At least so far so good...

Revision history for this message
Axel Werner (mail-awerner) wrote :

@Daniel T Chen : yes its reproducible even with 9.04 ! we cannot boot from a RAID5 software raid using grub.

i can boot from software RAID1 , but not from a software RAID5 . possibly this might be impossible by design, because in a raid5 (with 3 drives or more) we need ALL x-1 Drives to get propper data from it (boot files). So a grub bootloader would must be able to handle our disk controller (Drivers) AND software raid5 AND filesystem properly right from the start.

on a raid1 any data is valid and readable from any one of the both disks, so there is no additional need for reconstructing our data.

so i think this might be not possible at all.

i read somewhere that for booting we need at least a RAID1 for /boot or "/" and a RAID5 for the less important stuff like user data.

someone please teach me wrong that it is supposed to boot from raid5 software raid using grub n linux.

Revision history for this message
dino99 (9d9) wrote :

outdated report & no more maintained distro; please send a new one if that issue still exist (using ubuntu-bug)

Changed in grub (Ubuntu):
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.