Grub in Lenny won’t boot when the kernel is on disk 26 or more

Will hopefully get to report this tomorrow to the Grub folks and the Debian maintainer, but basically it looks like the grub in Lenny can’t cope with systems with lots of disks. We have two storage systems that we use software RAID on and seem to have hit a few problems with grub.

  1. grub-mkdevicelist only iterates over the first 16 SCSI drives, so if your boot partition is beyond /dev/sdp then you’ll get an error about it not being able to find the boot partition. This is hard coded into a loop in grub-mkdevicelist.c so you can tweak that up to 25 disks safely.
  2. if you have more than 25 drives (as we do on one system) you’ll hit the next problem as your devices start getting called /dev/sdaa, /dev/sdab, etc.. grub-mkdevicelist doesn’t handle that correctly. If you bump the number in that loop beyond 25 as it will start trying to find /dev/sd{ , /dev/sd| , etc, which it then rejects as they don’t exist. Again that’s fairly easy to work around with a conditional check in get_scsi_disk_name() to at least cope with the sd?? pattern (Reported as bug #514967). This then leads to the last problem of..
  3. Even having the correct device map when your boot device is on /dev/sdab1 still results in Grub in Lenny not being able to locate the boot partition, and we’ve not had time to chase that down any further (reported as bug #514976).

Comments of the type “serve you right for having too many disks” will be ignored.. 😉

5 thoughts on “Grub in Lenny won’t boot when the kernel is on disk 26 or more

  1. Tried using UUID’s or labels in grub? It also makes thing easier to maintain since you can have LABEL=Debian, LABEL=SWAP, LABEL=boot, etc… Don’t know if this would fix grub or not since it might still be grabbing the raw drive entries in its scan but if the problem is occurring because or the extra letters after sdz then maybe it is smart enough to look in /dev/disc/by-label/Debian

    Also try using lvm since it makes its own /dev/ entries that might work in grub.

Comments are closed.