User Tools

Site Tools


soc:2010:multiboot:howto

How to Multiboot MINIX with GRUB 2

<!> When following the instructions in this manual you will install a bootloader, which may leave some or all of the operating systems installed on your computer unbootable if done incorrectly. Only continue if you know what you are doing, be sure to back up important data first.

There currently are no multi-boot compliant bootloaders that support the MINIX 3 filesystem and MINIX-style subpartitions. To Multiboot load MINIX kernel we need a patched version of GRUB. This page describes how to compile and install GRUB and Multiboot MINIX 3 with it. This procedure was tested on Ubuntu 10.4 (Lucid Lynx) 32-bit desktop edition; commands to install packages may be different on other distributions and GRUB 2 may not be installed on old versions (9.10/Karmic Koala should be ok though).

  1. Prepare your machine (or VM). Install both MINIX 3 and Linux (for example Ubuntu), late versions are better. GRUB 2 is supposed to be installed along with your Linux. When they are properly installed, you should be able to chainload MINIX bootloader with GRUB, and access internet to get MINIX and GRUB source for compile.
  2. If your MINIX is older than revision 7906, checkout the latest trunk code and make world (see TrackingCurrent). Or you can download and install the “current development” image, which already supports Multiboot itself. It's found here: http://www.minix3.org/download/
  3. Get GRUB source: Install bzr in Linux (Ubuntu: sudo apt-get install bzr) and type
    bzr branch -r 2547 http://bzr.savannah.gnu.org/r/grub/trunk/grub/
  4. Download the patch (grub_minix.patch) for MINIX support, apply it on the source tree (patch is a command that may need to be installed in your Linux manually, for Ubuntu: sudo apt-get install patch):
    cd grub && wget -O - http://www.cs.vu.nl/~vdkouwe/minix/multiboot/grub_minix.patch | patch -p0
  5. Compile and install GRUB (some tools are needed to compile it, read ./INSTALL in GRUB source; on Ubuntu the following should be enough to get all dependencies:
    sudo apt-get install gcc make bison gettext binutils flex libdevmapper-dev libncurses5-dev libusb-dev libsdl1.2-dev ruby python autoconf automake
    
    ./autogen.sh
    ./configure
    make
    sudo make install
  6. Install GRUB on your harddisk (this assumes the first harddisk, change the a into b, c, d, … for other disks; you may need to replace the s with h on some systems):
    sudo grub-install /dev/sda

    You can see the message “Installation finished. No error reported” if it's successful.

  7. To make it a bit easier, add a menu entry to GRUB.
    The root command must be adjusted according to the value printed with rootdev in MINIX. For example if your installed MINIX in /dev/c0d0p1, the command is root (hd0,msdos2,msdos1). There are two potential pitfalls here: (1) GRUB 2 counts partitions starting at one, while MINIX and previous versions of GRUB counted from zero and (2) if the partition sequence in the partition table does not correspond with the on-disk sequence or if partion table slots are skipped, partition numbering differs between operating systems and bootloaders and may be hard to predict.
    If you have difficulty in determining the root command parameter, you can also try to press 'c' in GRUB menu to get a prompt, and type ls -l to list all recognized partitions. The MINIX partitions will look like (hdY,msdosX,msdos1), (hdY,msdosX,msdos2) and (hdY,msdosX,msdos3), where X and Y are arbitrary numbers and types of all three are minix3. If you see partitions in this style, the listed (hdY,msdosX,msdos1) should be the right parameter, try with it.
    sudo tee -a /usr/local/etc/grub.d/40_custom > /dev/null
    menuentry 'Multiboot kernel' {
     	  root (hd0,msdos1,msdos1)
     	  multiboot /boot/image_latest
    }
       
    <CTRL-D>
       
    sudo update-grub
  8. Now reboot and you can use GRUB to load MINIX directly!
soc/2010/multiboot/howto.txt · Last modified: 2014/11/11 22:37 (external edit)