Grub gives: Couldn't load OS

Hello all,

I’ve been trying to get Haiku to run on real hardware for a while. So today I went and DLed the latest revision from the repositories, built it, etc. So then I format my second 80GB hard drive with a unformatted partition taking up the whole disk, and use dd to write the haiku.image file to the disk partition. After that I went and edited my /boot/grub/menu.lst file under Ubuntu 6.06.1 and added a chainload entry to the bottom:

title Haiku
rootnoverify (hd1,0)
makeactive
chainloader +1

I reboot my system and select ‘Haiku’. All the commands worked successfully until it tried to ‘boot’ and then failed with the error “Couldn’t load operating system” or something similar and prompts to press enter to reboot. After I’ve rebooted, I try to invoke the commands directly via the GRUB command line by pressing ‘C’. But I get the same result. Whats happening? and how could I possibly fix it?

Thanks!
-maddog39

I think it’s the Haiku stage 1 boot loader that’s missing from the boot record of the partition you’re dd:ing the Haiku image to. Some actual code for Grub to chainload.

If you had a BeOS or Zeta install/live CD I think you could use the ‘makebootable’ command to add Haiku-compatible boot code. This shouldn’t clobber Grub, as Grub usually lives in the master boot record, IIRC. Of course, make sure to point ‘makebootable’ at the right partition. BeOS and Linux device names differ.

I you don’t have a BeOS CD and can’t get one, there may be some helpful information here:
http://haiku-os.org/community/forum/installing_haiku_via_linux_and_grub#comment-3235
or here:
http://haiku-os.org/documents/dev/getting_the_source_code

I think you can build and install Haiku directly to a partition from within Linux, but perhaps this is still experimental. The readme (http://svn.berlios.de/viewcvs/haiku/haiku/trunk/) says that it doesn’t work, but this comment leads me to think that it might work: http://haiku-os.org/documents/dev/getting_the_source_code#comment-6582

Just remember to backup your system first!

You may be able to get some help on the Haiku IRC channel.
http://haiku-os.org/community/irc

Hi

Iam having the same setting and getting the same error “Failed to Load OS”.

Did you solve this problem? If so how, please let me know

Magesh

I have a multiboot system with Windows XP, Linux, BeOS, Haiku & Zeta.

Grub is my bootloader. My menu.lst for Haiku is:

title HAIKU
root (hd0,2)
chainloader +1

Works for me. BeOS & Zeta entries are the same except for different titles & partitions.

If this doesn’t work then your Haiku partition may not be bootable ( I use BeOS to create Haiku partition, initialize with bfs & make the partition bootable ).

Hi

Many thanks for your useful comments.

I have been using linux for a pretty good time but novicde to BeOS and its derivatives.

Can you please elobrate me the steps you mentioned

  1. use BeOS to create Haiku partition,

  2. initialize with bfs

  3. make the partition bootable

How do I do these 3 steps . Kindly let me know and some pointers to the docs explaining this

Thanks

For people without older BeOS-compatible hardware it may be easier to run Haiku in a virtual machine, for now. It’s possible to install BeOS(+patches) or prepare a Haiku partition on older, supported hardware, and then move the disk to a more recent computer. Haiku should be fine on its own (without anything BeOS) on a lot of modern hardware, but when installing Haiku, preparing partitions etc, we still rely somewhat on having BeOS (or Zeta) simply because, most of us still do.

(If anyone spots anything wrong here, please do point it out!)

A BeOS+Haiku user would be able to just wipe a BeOS partition and install Haiku in its place, leaving the BeOS bootcode in the partition boot record, for GRUB or some other MBR-installed boot manager to chainload. Starting from Linux, I’m not sure exactly how to actually install Haiku to a partition, having built it. I skimmed the documentation but didn’t see anything truly useful, except caution that it doesn’t work as expected. :confused:

Here’s one way to do steps 1-3 mentioned above:

If you have a BeOS CD, a suitable harddisk on PATA (SATA not supported by BeOS) and your hardware isn’t somehow too new for BeOS, this should be possible:

Boot from a BeOS (or maybe Zeta) CD. In the Installer, press “More options”, or the triangle. Press the button “Setup Partitions…”. This Opens DriveSetup.

In DriveSetup, select the physical disk where you have a spare partition for Haiku, then choose Setup-Partition-Intel, and proceed. In the partition window that opens, be extra careful not to touch any partitions you wish to keep. Do only this: for the Haiku partition, set the partition type to BeOS, and press OK. Back in the main window with the list of disks, select the physical disk, then choose Setup-Initialize-(your Haiku partition)-Be File System. Initialize does the same as quick format in Windows. Be careful to select the right partition! In the initialize options window, select 4096 as block size and name it Haiku or something.

Close DriveSetup and return to the Installer.

You need to make the partition bootable, by adding the BeOS bootcode to the very start of the Haiku partition. This is done by the command-line utility ‘makebootable’ which is run from within BeOS, like this, “makebootable /MyHaikuVolume” (note: the mount point, not the device node). To do this from the BeOS install CD you need to open a terminal. You do this by pressing Ctrl-Alt-Shift-T, in the Installer. (This is a service entry of sorts.) Makebootable only works on mounted volumes, IIRC, so you need to mount it if it’s not already. You can check with ‘df’ and you can double-check with DriveSetup. Then type “makebootable /MyHaikuVolume” (or whatever you named it).

The partition should be ready for Haiku now, and unless Linux, GRUB or the Haiku build in Linux somehow overwrites the partition boot record you should be able to boot into Haiku, by chainloading the Haiku partition from GRUB, if the Haiku files are all in place and the filesystem is proper BFS.

I’m not sure how well the Haiku build system supports installing to a partition from within Linux. You may have to ask in IRC channel #haiku on freenode or search the website. I know the development team are very much interested in making Haiku development more accessible to non-BeOS people, as the team needs more people, and most active BeOS-developers are already involved.

Jonas pretty much covered it but I’ll give a quick summary.

First I would like to say that dd may work too. You should search the the forums here and see if other people were able to do it.

You need BeOS ( ie: BeOS Max v4 from http://www.bebits.com ). You can either install BeOS ( or LiveCD should work too ).

*important: make sure you are only using upto 4 primary partitions. Using extended partitions can cause problems with DriveSetup ( data loss ).

  1. Create partition. You should be able to do this from any OS ( ie: BeOS, Linux, Windows ). I like to use BeOS DriveSetup myself.
  2. initialize with bfs file system. I use BeOS DriveSetup for this. You can also use terminal command “mkbfs” in BeOS.
  3. from terminal use command “makebootable” ( syntax I believe is makebootable /VolumeName ). ( I believe DriveSetup also is able to do this )

Haiku/BeOS does not support SATA drives. You need to have PATA drive to install to.

Afterwards, I mount the haiku image in BeOS ( this shows me Haiku directories & files ) and I copy over all the directories to the Haiku partition.

Doing it through BeOS means more steps but less problems ( easier to do ).

Linux may work but I’m not sure because I haven’t tried it. You can search on here.

Another, easier solution is to use Vmware Player and download the vmdk.

Dear Jonas and Tonestone

Many thanks for your elobrate tutorial. Iam able to install haiku and boot it.

Explanations from both of you helped me to understand Haiku/BeOS better. Probably you can put it in a sticky session, for the benefit of newbies like me

Once again many thanks to both of you for taking time to send elobrate post

Magesh

I’m glad that we could help you, Magesh. :slight_smile:

Great to hear it Magesh. You’ll still have to download & try 3rd party apps from http://www.bebits.com because the OS comes with the basics only.

I know when Haiku reaches Beta ( or maybe Alpha ) that it’ll have an installer & drive partitioner. This will make it easier to install Haiku to a hard drive for everyone.

Right now it is in Pre Alpha stage. And I believe they mostly aim for BeOS users to actually install to a physical partition to test out and everyone else ( Linux, Windows, MacOSX users ) to use Vmware image for testing it out.

Just my guess. Went a little off topic here.

If for some reason you cannot boot BeOS or BeOSMax to do a makebootable (the case with my pc), you can set up VMWare to access your raw partition as a harddrive. Then boot BeOS(Max) inside VMWare player and run makebootable on the mounted raw partition. Just be very sure you’ve mounted the correct raw partition, as you might screw up your windows/linux partition with a wrong choice :slight_smile: