Getting multiple-boot installations including m$ things, without them messing everything up!

Not the most tasteful subject.

Just sometimes I get roped into helping set something up for someone who insists on using low-quality proprietary software, and thereby waste lots of time on silly problems. Having more than one system on a computer, let alone on a single disk, can often give rise to problems, to an extent determined largely by the thoughtlessness with which the installation program has been written.

Installing loads of Linux distributions multiboot, possibly with FreeBSD too, is a doddle: just create something like twelve logical partitions for the linux ones, tell each where to go, tell each not to write on the MBR, and they work. There's no twaddle about all needing to be on the first recognised partition, or the first disk.

Solaris-x86 has been pretty awful in the past, insisting on being in the first, primary partition, etc., and sharing a partition ID with linux swap, until getting its own but still being upset by swap IDs. I give Microsoft, however, the first place, since its systems are expensive and are purportedly intended for `the people', are claimed as `user friendly', yet are in many respects hopeless to install together even with each other! There is unhelpful information when problems arise, and too little flexibility in how to install, e.g. whether to zap the current MBR.

This page, its vitriol section now over, is hoped to be of some use in describing how the initial problems of m$windos vista and xp were overcome. It is assumed that GNU Grub is available as the computer's bootloader, as well as a way of reinstalling Grub to the MBR every time some ms installation program writes all over that without asking!

My problem: I tried to get loads of systems onto a single disk in a single computer, since the user was interested in trying them and the disk was far bigger than was needed for one system, with all personal files being on the network anyway. Thanks to the DOS partition-table limitations, and the disparate systems, only four were attempted: Gentoo Linux, Solaris x86 (10u3), ms-windows xp pro sp2, and ms-windows vista ultimate.

The disk had an extended partition, containing logical partitions for root and swap of the gentoo system, then three primary partitions for solaris, winxp and winvista. These were made with linux fdisk, and the suitable partition ID codes (e.g. 7 for the two NTFS partitions) were applied to the partition labels.

The gentoo system was installed first, by booting from a basic boot cd, mounting the disk and an nfs mount, then untarring the system from a remote file; finally, chrooting into the system, the grub program was run and the familiar "root (hd0,5)" then "setup (hd0)" was run to install Grub in the MBR.

Then, the win-xp system was installed. It happily accepted the first of the two NTFS primary partitions. After getting answers to its carefully posed questions scattered throughout the installation process, it was there. Trouble came when the win-vista DVD was used, and the final partition was chosen for it (the installer recognised this as "D:" and the other as "C:"). It was expected that it would cope, but it ended up making its own bootloader for both ms systems, with the problem of not actually managing to boot one (I don't even remember now which). This one was then reinstalled but that brought more problems.

The way that worked was to label all but the desired installation partition as hidden or some unrecognised filesystem type; e.g. in the fdisk program under linux, set the vista partition to linux and the win-xp one to NTFS when installing the win-xp thing, then vice-versa for installing the ms-vista thing. After this, set both to NTFS but set up the grub bootloader so that it always hides the other system -- see `info grub' then booting|os-specific|dos. To install a system on, say, hda3, with the other ms one being on hda2, do

        unhide (hd0,2)
        hide(hd0,1)
        rootnoverify (hd0,2)
        chainloader +1
        makeactive
This avoids upsetting either, by making them unaware of each others presence.

The final /boot/grub/menu.lst file that worked for all systems was the following. Note that the problem with the ms and solaris ones is not getting grub to work with them, but rather making them install at all, and to do so without messing up anything more than the MBR (which can be repaired each time from a linux live-cd, then mounting the linux system and chroot into it and run grub).

# /boot/grub/menu.lst (or /boot/grub/grub.conf)

default 0
timeout 15

title Linux-2.6.2x, Gentoo GNU/Linux system
root (hd0,5)
kernel /boot/vmlinuz root=/dev/sda6

title SunOS-5.10, Solaris system
rootnoverify (hd0,1)
chainloader +1
makeactive

title mswin-VU
unhide (hd0,2)
hide   (hd0,3)
rootnoverify (hd0,2)
chainloader +1
makeactive

title mswin-XP
unhide (hd0,3)
hide   (hd0,2)
rootnoverify (hd0,3)
chainloader +1
makeactive



Page started: 2007-06-24
Last change: 2008-08-20