Dell Latitude C610 -- Quadruple boot configuration

This part of my Latitude pages deals with installing multiple operating systems on an IA32 machine; you might ask yourself what is the point in installing multiple OS on a machine, and might have a point, but that is not the topic here -- if so, feel no obligation to read further ;-)

This installation actually started as a banal Windows/Linux dual-boot; eventually, I wanted to test the NFSv4 implementation in OpenSolaris, and that seemed to be the right machine for such tests. And as I was at it, why not look at how OpenBSD performed on a laptop ? Surely some other systems would have been interesting, but considering the way most OS boot (and the painfully inflexible installer of some other ones...) the old DOS heritage limits you to four OS, so here we are, with the following systems:

Before beginning, you might want to know that some installers can be quite picky about partitioning and other OS, so be prepared to actually install a particular system multiple times -- I actually had to install Debian three times (and do a rescue boot to recover my hosed GRUB) before obtaining an acceptable configuration. But I was not starting with an optimal configuration and had to trial-and-error a bit: after reading this short guide, you should not have to do a single reinstall :-) I just wanted you to be warned: you might end with a completely unbootable machine if you're not careful.

First of all, we'll examine disk partitioning: the first section will show you the final partitioning of the bootable disk. Most likely, you'll have to achieve this gradually, as there are many quirks in the partitioners included in most installers. However, you'll hopefully get a global understanding of the installation process, and this partitioning setup is a good one to start. Then we'll go into some details about installation of the operating systems themselves, in the recommended order. Finally, there is a basic troubleshooting section, just in case things go wrong.

Disk partitioning

A correct disk partitioning is crucial when installing multiple OS on the same disk; as most installers offer very limited functionality, you should be carefully planing your partitioning scheme and applying it before your first OS install. But before planning, let's have a bit of theory.

Actually, there are several meanings for the term 'partition': you could be talking about a DOS primary partition, a DOS extended partition, an OpenBSD or Solaris slice, not mentioning logical volumes. Essentially, a 'partition' is a part of your disk which is used by the OS as an homogeneous space to store data -- with most OS you don't actually *need* multiple partitions to install and run your system, but having several ones adds some flexibility to the future configuration. Now, as mentioned before, there are several types of partitions: we will adopt an incremental approach to describe them.

On i386 machines, the BIOS expects to find a so-called DOS partition table on a bootable disk -- this type of partitioning is actually quite simple: it allows for four primary partitions on a disk. This is a limitation of such machines, and is one of the reasons we limit ourselves to four OS on the Latitude (the other being the incapacity of some systems to boot on non-primary partitions). So in our setup, the primary partition table would look like the the one below:

  Part. Id   Intended Usage
+----------+----------------+
|    #1    |    Windows     |
+----------+----------------+
|    #2    |    OpenBSD     |
+----------+----------------+
|    #3    |    Solaris     |
+----------+----------------+
|    #4    |     Linux      |
+----------+----------------+

Note the relative order of the systems: when cohabiting with Windows, always put it first on the disk; it should also be the first installed OS, unless you like unpleasant surprises. So, we have a basic partitioning scheme, which could seem satisfactory: however it forces one to use only one partition per system, which is not recommended -- you should at least have a separate swap partition per system (using only one swap partition, which is shared by every OS apart from Windows is possible, but will not be implemented here for the sake of simplicity). To do this, different vendors have developed differing strategies: Solaris and the BSDs use so-called disklabels, which allow for subpartitions inside a primary DOS partition; Linux on the other hand allows one to use extended (or logical) DOS partitions (another possibility would be to use logical volumes, but it is outside the scope of this document).

DOS partitions, be there primary or logical, are usually created/modified using fdisk or one of its derivatives (parted is another very good partitioner, but is not likely to be included in most installers, so you better get used to fdisk :-). Disklabels are managed by specific tools included in the relevant installers (and which, strangely, are usually called disklabel). So the first step would be to fire up fdisk to create our primary and extended DOS partitions: we will need three primary partitions for Windows, OpenBSD, and Solaris, and six extended partitions for Linux. Below is the partitioning scheme for now, with intended space allocation:

  Part. Id      Primary        Logical       Space
+----------+---------------+
|    #1    |    Windows    |                 15 GB
+----------+---------------+
|    #2    |    OpenBSD    |                 15 GB
+----------+---------------+
|    #3    |    Solaris    |                 15 GB
+----------+---------------+
|    #4    |       *       | \               15 GB =
+----------+---------------+-------------+
|    #5    |               | Linux /     |    1.0 GB +
+----------+---------------+-------------+
|    #6    |               | Linux swap  |    2.0 GB +
+----------+---------------+-------------+
|    #7    |               | Linux /home |    6.0 GB +
+----------+---------------+-------------+
|    #8    |               | Linux /usr  |    4.0 GB +
+----------+---------------+-------------+
|    #9    |               | Linux /var  |    2.0 GB +
+----------+---------------+-------------+
|    #10   |               | Linux /tmp  |    1.0 GB
+----------+---------------+-------------+

For precision-lovers, here is the same table as displayed by cfdisk -- enjoy :-)

               First       Last
 # Type       Sector      Sector   Offset    Length   Filesystem Type (ID) Flag
-- ------- ----------- ----------- ------ ----------- -------------------- ----
 1 Primary           0    27342629     63    27342630 HPFS/NTFS       (07) Boot
 2 Primary    27342630    54685259      0    27342630 OpenBSD         (A6) None
 3 Primary    54685260    82027889      0    27342630 Solaris         (BF) None
 4 Primary    82027890   117210239      0    35182350 Extended        (05) None
 5 Logical    82027890    83987819     63     1959930 Linux           (83) Boot
 6 Logical    83987820    87891614     63     3903795 Linux swap      (82) None
 7 Logical    87891615   101562929     63    13671315 Linux           (83) None
 8 Logical   101562930   111330449     63     9767520 Linux           (83) None
 9 Logical   111330450   115234244     63     3903795 Linux           (83) None
10 Logical   115234245   117210239     63     1975995 Linux           (83) None

In my opinion, the best way to prepare the partition table would be to boot from a Linux installer, and use the built-in partitioner -- any distribution will most likely do. For the record, I will include more complete examples of the full partition table as the systems are installed: don't forget that we still have to stick some labels on some partitions. Once this preliminary step is done, you can proceed to install Windows -- time to reboot.

Windows installation

Classic installation

Installation of Windows is pretty straightforward -- in fact, most of the time the installer does not ask for your opinion. Once you have booted on the CD, it will however ask you one very important question: which partition you'll use for Windows (*don't* tell it to use the totality of your hard drive, of course). Choose the first one (#1 above), and some minutes later you should have a shiny new Windows ready to boot.

Installation from a saved partition image

Now that was actually quite boring. Another way to install Windows on your new disk is to recover a saved image from a previous installation (and apart from being a less boring way, it is actually very useful in case you purchased a pre-installed version of Windows without an included installation CD-ROM). There are several programs you can use to build such an image and rewrite it, from the bare-bones dd+netcat combination to more elaborate ones.

I used ghost4unix (g4u), which has the advantage of needing very few additional installation (an FTP server will do), and of supporting NTFS partitions pretty well (which is a must for post-Windows2k installs, unless you were foolish enough to stick with a FAT32 filesystem in your initial installation). Once you have the right tool, the process is actually pretty simple:

  1. Set up an FTP server on another machine on the network
  2. Download a bootable CD image, burn it, and boot on it
  3. Dump the partition containing your Windows install
  4. If you have to swap disks, do it now
  5. Partition your disk as explained in the preceding section
  6. Reboot on your g4u CD, and restore the saved image on the newly created partition #1 (of course, this partition has to be at least as big as the original one -- otherwise be prepared for some serious trouble)
  7. You're done. Reboot and enjoy :-)

Finally, we'll include the state of our partition table at this point, which should actually not have been modified -- we'll also show the name of the partitions as attributed by the different systems. Only changing partitions will be shown, as a complete table will be shown at the end of this document -- 'N/A' means the OS won't be able to ever see the corresponding partition, '?' means it has not been installed yet or that the partition table/disklabel could be further completed.

  Windows   OpenBSD   Solaris   Linux 
+---------+---------+---------+-------+---------+
|    C:   |    ?    |    ?    |   ?   | Windows |
+         +         +         +       +---------+
|   N/A   |    ?    |    ?    |   ?   | OpenBSD |
+         +         +         +       +---------+
|   N/A   |    ?    |    ?    |   ?   |   etc.  |

OpenBSD installation

The installation of OpenBSD is also straightforward (as is actually the installation of any mainstream OS out there nowadays), the only potential issue being the formating of the disk, and we'll go through it -- everything's fine :-)

First, the installer will offer to partition your disk (we are talking about DOS partitions here), which should not be necessary, given that we already have a suitable partition table. The only thing you might need to do is to change the "type" of partition #2 to "OpenBSD".

Once you have an OpenBSD partition on your disk, you'll have to write a disklabel on it -- the installer therefore immediately fires up disklabel after the first partitioning. Now it's time to define your final partitions, as they will be used by the system. I hope you did give a thought at this before starting installation, but if not, now is the time. The schema below includes an example labeling scheme for a 15GB partition; adapt it as you need. Here is the extended state of the partition table after writing your changes to disk and exiting disklabel:

  Part. Id   Windows   OpenBSD   Solaris   Linux   Primary        Logical       Disklabel    Space
+----------+---------+---------+---------+-------+---------+
|    #1    |    C:   |  wd0i   |    ?    |   ?   | Windows |                                 15 GB
+----------+---------+---------+---------+-------+---------+-----------------+
|    #2    |   N/A   |    ?    |    ?    |   ?   | OpenBSD |                 |\              15 GB =
+----------+---------+---------+---------+-------+---------+-----------------+------------+
|          |         |  wd0a   |    ?    |   ?   |         |                 |  a: /      |  0.5 GB +
+          +         +         +         +       +         +                 +------------+
|          |         |  wd0b   |    ?    |   ?   |         |                 |  b: swap   |  2.0 GB +
+          +         +         +         +       +         +                 +------------+
|          |         |  wd0d   |    ?    |   ?   |         |                 |  d: /home  |  5.0 GB +
+          +         +         +         +       +         +                 +------------+
|          |         |  wd0e   |    ?    |   ?   |         |                 |  e: /usr   |  5.0 GB +
+          +         +         +         +       +         +                 +------------+
|          |         |  wd0f   |    ?    |   ?   |         |                 |  f: /var   |  2.0 GB +
+          +         +         +         +       +         +                 +------------+
|          |         |  wd0g   |    ?    |   ?   |         |                 |  g: /tmp   |  0.5 GB
+----------+---------+---------+---------+-------+---------+-----------------+------------+
|    #3    |   N/A   |  wd0j   |    ?    |   ?   | Solaris |                                 15 GB
+----------+---------+---------+---------+-------+---------+
|    #4    |   N/A   |  wd0k   |    ?    |   ?   | etc.    |

As a sidenote, I cheated a bit on the schema at this point: in reality, disklabel will happily include existing OS installs when creating a default label, but that's actually it. So chances are that if you followed the procedure outlined here, your label will contain a wd0i (as Windows is already installed), but no wd0j or wd0k. To remediate this, you have two solutions: either define those manually the same way you defined wd0a-g, or install OpenBSD a second time once every OS is installed (in which case every partition will be included in a default label). You might have noted that wd0c is *not* included here, and there is a specific reason for it: BSD disklabels require the presence of a "whole-disk partition", which is always the third one -- so wd0c represents the whole disk (not just the OpenBSD part of it), and is therefore not included in our partition scheme (also remember when partitioning that offsets in the disk label are relative to the beginning of the disk, not just partition #2).

Finally, there is a chance that the installation will break an existing GRUB install (if any): basic troubleshooting usually involves re-installing GRUB from your favorite Linux distribution installation CD (if it is sufficiently smart to give you a shell).

OpenSolaris installation

Now all these text interfaces are cute, and having some flexibility in your OS installation is always a good thing. But sometimes there's just a need for change. So let's go back to a nice, warm and fuzzy graphical installation: OpenSolaris. Since it is now open-sourced, you can just grab an ISO image on the Web and get started -- the thing to look for is named Solaris Express.

And there you go, having to choose the partition to use: this time we'll use partition #3. Similarly to OpenBSD, Solaris will then ask you for directives about the disklabel to write on the partition -- my advice here is to use the default Solaris label (a root partition, swap space, and a home partition): some systems just do not support customisation very well, and there are several legacy Solaris particularities. For example, as a server OS it expects you to create your home directories under /env/export/home (so they can be exported via NFS later) -- Solaris 9 did even re-mount this under /home using an automounter, which IMO created a huge and unnecessary mess. Long story short: keep the default labeling scheme, customising partition space if necessary.

Somewhere along the installation process, the system might warn you that a parallel Linux/Solaris install is not supported: just ignore this, as it is simply not true -- you will however have to customise an existing GRUB installation, if any, by chain-loading Solaris (just as you'll do with Windows). Doing so, you will notice that booting Solaris now requires two GRUB executions: the one installed in the MBR (Linux), and the one installed in partition #3 (Solaris) -- I hope to find a workaround for this. A full GRUB configuration will be included at the end of this document; for now, let's have a look at our partition table:

  Part. Id   Windows   OpenBSD   Solaris   Linux   Primary        Logical       Disklabel    Space
+----------+---------+---------+---------+-------+---------+
|    #1    |    C:   |  wd0i   |    ?    |   ?   | Windows |                                 15 GB
+----------+---------+---------+---------+-------+---------+-----------------+
|    #2    |   N/A   |    *    |    ?    |   ?   | OpenBSD |                 |\              15 GB =
+----------+---------+---------+---------+-------+---------+-----------------+------------+
|          |         |  wd0a   |    ?    |   ?   |         |                 |  a: /      |  0.5 GB +
+          +         +         +         +       +         +                 +------------+
|          |         |  wd0b   |    ?    |   ?   |         |                 |  b: swap   |  2.0 GB +
+          +         +         +         +       +         +                 +------------+
|          |         |  wd0d   |    ?    |   ?   |         |                 |  d: /home  |  5.0 GB +
+          +         +         +         +       +         +                 +------------+
|          |         |  wd0e   |    ?    |   ?   |         |                 |  e: /usr   |  5.0 GB +
+          +         +         +         +       +         +                 +------------+
|          |         |  wd0f   |    ?    |   ?   |         |                 |  f: /var   |  2.0 GB +
+          +         +         +         +       +         +                 +------------+
|          |         |  wd0g   |    ?    |   ?   |         |                 |  g: /tmp   |  0.5 GB
+----------+---------+---------+---------+-------+---------+-----------------+------------+
|    #3    |   N/A   |  wd0j   |    *    |   ?   | Solaris |                 |\              15 GB =
+----------+---------+---------+---------+-------+---------+-----------------+------------+
|          |         |         | c0d0s0  |   ?   |         |                 |  s0: /     | 
+          +         +         +         +       +         +                 +------------+
|          |         |         | c0d0s1  |   ?   |         |                 |  s1: swap  | 
+          +         +         +         +       +         +                 +------------+
|          |         |         | c0d0s7  |   ?   |         |                 |  s7: /home | 
+----------+---------+---------+---------+-------+---------+-----------------+------------+
|    #4    |   N/A   |  wd0k   |    ?    |   ?   | etc.    |

Actually, I was quite impressed by this Solaris installation. As dependency management is still a nightmare (nothing new under the sun ;-), I choose the "Developer Package", which includes virtually everything. After installation I had the choice between the legacy CDE WM and their so-called "Java Desktop System". The second one is not much more than a customised GNOME environment, but a nicely customised one, and is generally the way to go. Note however that for an unknown reason the packagers choose to generate the X.Org configuration on the fly, which leads to some unexpected "features", like not being able to change your keyboard mapping -- I had to write a minimal X11 configuration file to /etc/X11/xorg.conf and manually configure my keyboard there. For reference, it is included below:

#
# Minimal X.org X11 server configuration file
# This one is for a Dell Latitude C610 laptop -- customise as needed
Section "Module"
	Load	"extmod"
	Load	"dbe"
	Load	"glx"
	Load	"bitstream"
	Load	"type1"
	Load	"IA"
#	Load	"xtsol"
EndSection

Section "InputDevice"
	Identifier	"Synaptics Touchpad"
	Driver		"mouse"
	Option		"Emulate3Buttons"
EndSection 

Section "InputDevice"
	Identifier	"Default Keyboard"
	Driver		"kbd"
	Option		"XkbRules"	"xorg"
	Option		"XkbModel"	"pc105"
	Option		"XkbLayout"	"fr"
EndSection

Section "Monitor"
		Identifier	"Builtin Default Monitor"
		Option		"TargetRefresh"	"75.0"
EndSection

Section "Device"
		Identifier	"ATI Radeon Mobility"
		Driver		"ati"
EndSection

Section "Screen"
	Identifier	"Default Screen"
	Device		"ATI Radeon Mobility"
	Monitor		"Builtin Default Monitor"
	SubSection	"Display"
		Depth	24
		Modes	"1024x768"
	EndSubSection
EndSection

Section "ServerLayout"
	Identifier	"Default Layout"
	Screen		"Default Screen"
	InputDevice	"Default Keyboard" "CoreKeyboard"
	InputDevice	"Synaptics Touchpad" "CorePointer"
EndSection

Another unpleasant surprise was to discover the number of services running on the machine after a default installation: issuing a netstat -a at the prompt will list a whole bunch of unnecessary services -- once again the server orientation of the OS. To disable these, you'll have to use the Solaris Service Management Framework, which is quite interesting (for example, it allows for asynchronous "init scripts") -- you might want to look at the svcs(8), svcadm(8) and related manpages for more details about this framework.

That's it for Solaris -- the only part that's still missing is a quick overview of a Debian install: here it comes :-)

Debian installation

If you're sick of not having total control control over your OS install, be relieved: Debian's expert-mode install will virtually let you choose everything. If you're more the Windows type, the default installer mode has very reasonable defaults. So there's something for everybody here: Debian just rocks :-). Grab a netinstall image from a Debian mirror, using jigsaw if you can -- or even better: download it using your preferred bittorrent client.

And once again we are asked to partition our disk and choose our mount points: partitioning should be easy since we already created everything in the first section. The only thing you'll have to do is to tell the installer which partition you want to mount, and where -- if you feel like trying an alternative filesystem, go for it, the installer supports this well: I kept the default one, as ext3 performance is perfectly acceptable considering the intended usage of this laptop, but don't hesitate to use the possibility (after all, this is the only OS so far that even gives you the choice of the filesystem -- no, FAT32 is *not* an alternative). After completing this step, you'll be able to contemplate your final partitioning scheme, as shown below:

  Part. Id   Windows   OpenBSD   Solaris   Linux   Primary        Logical       Disklabel    Space
+----------+---------+---------+---------+-------+---------+
|    #1    |    C:   |  wd0i   |    ?    | hda1  | Windows |                                 15 GB
+----------+---------+---------+---------+-------+---------+-----------------+
|    #2    |   N/A   |    *    |    ?    | hda2  | OpenBSD |                 |\              15 GB =
+----------+---------+---------+---------+-------+---------+-----------------+------------+
|          |         |  wd0a   |    ?    | hda11 |         |                 |  a: /      |  0.5 GB +
+          +         +         +         +       +         +                 +------------+
|          |         |  wd0b   |    ?    | hda12 |         |                 |  b: swap   |  2.0 GB +
+          +         +         +         +       +         +                 +------------+
|          |         |  wd0d   |    ?    | hda13 |         |                 |  d: /home  |  5.0 GB +
+          +         +         +         +       +         +                 +------------+
|          |         |  wd0e   |    ?    | hda14 |         |                 |  e: /usr   |  5.0 GB +
+          +         +         +         +       +         +                 +------------+
|          |         |  wd0f   |    ?    | hda15 |         |                 |  f: /var   |  2.0 GB +
+          +         +         +         +       +         +                 +------------+
|          |         |  wd0g   |    ?    | hda16 |         |                 |  g: /tmp   |  0.5 GB
+----------+---------+---------+---------+-------+---------+-----------------+------------+
|    #3    |   N/A   |  wd0j   |    *    | hda3  | Solaris |                 |\              15 GB =
+----------+---------+---------+---------+-------+---------+-----------------+------------+
|          |         |         | c0d0s0  | hda17 |         |                 |  s0: /     | 
+          +         +         +         +       +         +                 +------------+
|          |         |         | c0d0s1  | hda18 |         |                 |  s1: swap  | 
+          +         +         +         +       +         +                 +------------+
|          |         |         | c0d0s7  | hda19 |         |                 |  s7: /home | 
+----------+---------+---------+---------+-------+---------+-----------------+------------+
|    #4    |   N/A   |  wd0k   |    ?    | hda4  |    *    |\                                15 GB =
+----------+-----------------------------------------------------------------+
|    #5    |   N/A   |         |    ?    | hda5  |         |   Linux /       |               1.0 GB +
+----------+-----------------------------------------------------------------+
|    #6    |   N/A   |         |    ?    | hda6  |         |   Linux swap    |               2.0 GB +
+----------+-----------------------------------------------------------------+
|    #7    |   N/A   |         |    ?    | hda7  |         |   Linux /home   |               6.0 GB +
+----------+-----------------------------------------------------------------+
|    #8    |   N/A   |         |    ?    | hda8  |         |   Linux /usr    |               4.0 GB +
+----------+-----------------------------------------------------------------+
|    #9    |   N/A   |         |    ?    | hda9  |         |   Linux /var    |               2.0 GB +
+----------+-----------------------------------------------------------------+
|    #10   |   N/A   |         |    ?    | hda10 |         |   Linux /tmp    |               1.0 GB
+----------+-----------------------------------------------------------------+

Once again, I cheated a bit: the Linux kernel is totally capable of reading a BSD disklabel at boot, but only if you include the relevant modules at compilation time -- your distribution's default kernel might include them, or it might not... more about this in the next section. Now we'll complete the install by adding some packages and answering some basic configuration questions, and soon your quadruple-boot configuration is ready to play with -- enjoy :-).

GRUB configuration example

As a final note, I will include the GRUB configuration I use for booting these four systems -- this is a very useful and feature-rich bootloader, and I just wish it would be able to read UFS filesystems so I don't have to chain-load Solaris. For now, here is a working config (I'll just include the kernel sections):

# menu.lst - See: grub(8), info grub, update-grub(8)
#            grub-install(8), grub-floppy(8),
#            grub-md5-crypt, /usr/share/doc/grub
#            and /usr/share/doc/grub-doc/.

default		0
timeout		5

title		Debian GNU/Linux, kernel 2.6.16.19-sjv1
root		(hd0,4)
kernel		/boot/vmlinuz-2.6.16.19-sjv1 root=/dev/hda5 video=radeonfb:1024x768 ro 
savedefault
boot

title		Debian GNU/Linux, kernel 2.6.16.19-sjv1 (recovery mode)
root		(hd0,4)
kernel		/boot/vmlinuz-2.6.16.19-sjv1 root=/dev/hda5 ro single
savedefault
boot

# This is a divider, added to separate the menu items below from the Debian
# ones.
title		Other operating systems:
root

title		Microsoft Windows XP Professionnel
root		(hd0,0)
savedefault
makeactive
chainloader	+1

title		OpenBSD 3.9 -- GENERIC
root		(hd0,1)
savedefault
makeactive
chainloader	+1

## This does not work, but definitely will...
#title		OpenSolaris 10 -- 2006/05
#root		(hd0,2)
#kernel		/platform/i86pc/multiboot
#module		/platform/i86pc/boot_archive
#savedefault
#boot

## So just chain-load for now
title		OpenSolaris 10 -- 2006/05
root		(hd0,2)
savedefault
makeactive
chainloader	+1