Cannot Boot Haiku with Grub 2

I have been trying to boot haiku for quite a few weeks trying different ways but nothing works. I have never had trouble like this. When I go into the grub menu after the BIOS screen and choose Haiku, a black screen shows with error: cannot find c/h/s values, at top of screen. I have 3 hard drives. Linux Mint 18.3 taking the whole first drive: sda1 sda2 sda3. The second drive is a non boot-able data backup: sdb. The third: sdc has two partitions: Haiku 2: sdc1 and Haiku 3: sdc2. I wrote an msdos partition table with gparted before making the partitions on this drive. I then used gparted to create unformatted Haiku partitions of near equal size taking up most of the drive, except 1mb before the first partition before Haiku 2. I then boot into Haiku on a USB pen drive and used the Installer program with Drive Setup, to format the Haiku partitions with bfs. The entry in /etc/grub.d/40_custom for booting Haiku 2 and Haiku 3 is:
menuentry “Haiku 2” {
set root=(hd2,1)
chainloader +1
}

menuentry “Haiku 3” {
set root=(hd2,2)
chainloader +1
}
I have used sudo update-grub command in linux and Haiku 2 and Haiku 3 shows on the boot menu. So why am I getting this error cannot find c/h/s values and how can I get Haiku booted?

This is what I have and working for some years now:

#! /bin/sh -e

echo "Adding Haiku entry" >&2
cat << EOF
menuentry "Haiku R1 alpha" {
    ## change to your partition, the first partition on your first hard drive
    ## is (hd0,1), the third partition on your 2nd hd is (hd1,3) and so on...
    set root=(hd0,7)
    chainloader +1
}
EOF

Thanks for your reply. This is what I put in the /etc/grub.d/custom_40 file, according to your format:

#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
echo "Adding Haiku entry" >&2
cat << EOF
menuentry "Haiku 2 B2" { 
 set root=(hd2,1)
 chainloader +1
}

menuentry "Haiku 3" { 
 set root=(hd2,2)
 chainloader +1
}
EOF

I still get the same trying to boot Haiku: error could not get c/h/s values.

I managed to boot Haiku. The reason it wasn’t booting was: the second hard drive, sdb was disabled in the BIOS and in the Linux custom_40 file, the menuentry was on hd2,1 and hd2,2 which would have only allowed two instead of three hard drives to be referenced from grub. That would mean sdc which contained Haiku 2 and Haiku 3 partititions to be skipped since that drive was treated as hd1.

2 Likes

The problem is known and an issue exists.

I had the same problem with multiple disks using Grub Legacy (Grub 1) and didn’t test with Grub 2. As a workaround you can try to use drivemap Grub command as indicated in this answer. In your case this would be:

menuentry "Haiku 2" {
  drivemap -s (hd2) (hd0)
  set root=(hd0,1)
  chainloader +1
}

menuentry "Haiku 3" {
  drivemap -s (hd2) (hd0)
  set root=(hd0,2)
  chainloader +1
}

Thanks for your reply but I was able to find a way to boot Haiku by enabling sdb drive as second boot priorty, in the BIOS, even though it is not bootable. I explained in comment 4 above.

Haiku need to be installed in first boot hdd or you need to switch boot hdd in bios.

That’s not true, if you use Grub or another bootloader you can boot from any hard disk and Haiku has no problem with that. The only limitation we have currently is that it is not possible to use bootman to boot systems installed on different disks. And even that is not a limitation of bootman itself, but of its installer program.

One thing I have in an external multiboot drive is ask grub to find the device. It is a modified grub to get the GPT info I have in that drive, but it should work for you with stock grub2 using either the fs label or uuid. For example this would add entries for two Haiku installs with their fs labelled “Haiku32” and “Haiku64”, whatever their drive and partition numbers are:

function find_part {
  spart=
  search --set=spart --no-floppy --label "$1"
}

[...]

if find_part Haiku32; then
  menuentry --class haiku "Haiku 32bits BeOS compatible" "${spart}" {
    set root="$2"
    chainloader +1
  }
fi

if find_part Haiku64; then
  menuentry --class haiku Haiku "${spart}" {
    set root="$2"
    chainloader +1
  }
fi

1 Like