As I promised in several threads, here are some notes on how I installed several Operating Systems on my laptap. I will give links to the tools that I obtained from various third parties. And I will include the source code for a few scripts that I wrote.
Introduction
A few months ago the disk drive on my Inspiron 8200 fried out. I decided to customize it with new peripherals. I got a 100 GB Seagate drive and a DVD burner. That 100 GB drive is mounted in a carrier. It is a big deal to mount the drive in a carrier, but remove one screw and the carrier can just be pulled out. I bought a second carrier and a second 100 GB drive. This allows me to switch my hard drive and so I can try experiments with little risk. I can remove one of my batteries and install another drive in the battery slot. I have a floppy drive to install there. My BIOS supports booting from any ATA device so I can boot from the hard disk, the CD/DVD drive or the floppy.
I decided to install as many OS's as I could on the new setup. The problem is that, except for Linux, everything demands a primary partition and there are only 4 primary partitions. If one is used as a chain of logical partitions, that leaves 3 non-linux OS's. I decided to live with that. There are some extreme solutions that would allow more non-linux OS's, but they are too extreme. I wanted NETbsd, Desktop BSD, and Solaris 8 in addition to what I did install. But those 3 OS's did not seem worth very extreme measures. So I wound up with:
- Windows XP
- Redhat
- Fedora
- SuSE
- Debian
- Scientific
- FreeBSD
- Solaris 10
Tools
I used several software tools to help me with this project.
GRUB
First, I need a really good bootloader that I understand completely. GRUB is really the only game in town. There are some very powerful bootloader products, but without access to the source code, there is a limit to how well I can understand them. GRUB is actually very easy to understand, but it has been documented poorly. Until I understood GRUB, various disasters rendered my system unbootable. In each case I was able to eventually track down exactly what happened. It really is no longer possible to render my system unbootable.
Disk Director/True Image
I needed a Partition Manager and I have used Partition Magic in the past. But PowerQuest sold the product to another company and it doesn't seem to be well supported now. I decided to try Acronis Disk Director which is less expensive. It isn't perfect, but it worked well enough. I also bought Acronis True Image. Again not perfect, but it can completely restore the system on to a brand new drive from DVD backup. You can create a bootable cd that has both products on it. This allows backups and restores from a quiescent disk. Disk Director comes with a GUI sector editor that is arguably better that dskprobe.
Disk Wizard/Seatools
Seagate has these utilities available for download from their site. These are bootable CD's that can run diagnostics and write zeros over an entire drive among various other tasks. I like to zero out a drive before I do a re-install (9 hours for 100 GB!). And it can do non-destructive tests on the drive. Other manufacturers have similiar utilities.
System Rescue CD
When I did have trouble during the project, this is the tool that got me out of the woods. It is basicly a "Live CD" with a lot of useful tools available.
Sector Inspector
This is an XP comand line based physical sector utility. It can do a lot of stuff that the GUi based sector editors cannot do. This is a Microsoft program and it is free.
grub
Acronis Disk Director Suite 10.0
Acronis True Image 9.0 Home
Disk Wizard
Seatools
SystemRescueCd
sector inspector
I have switched from dskprobe to the Acronis Sector Editor. But dskprobe is free and it comes in the support tools package on the XP installation CD. Or you can download the Support Tools here. dskprobe comes with a doc file called dskprtrb.doc which I thought was very helpful. Also dskprobe is a stand-alone utility while the Acronis sector editor is a sub-tool of Disk Director.
Installation Notes
Here are some notes on what I did to install the os'es. I did not just gather a collection of OS's and jump straight into the mass installation. I did test installations first to gain experience with each installer. In every case, I used the "custom" options to maximize my flexibility during the install. This means that I had to understand each installer rather well. Remember that the Master Boot Record has a table for 4 partition entries.
Windows XP
I installed XP first on the first primary partition which I formatted with an NTFS filesystem. I installed the recovery console and I added an option to boot into safe mode. This means that the NT bootloader presents a menu not unlike the grub menu. I created an E: partition which used FAT32. This is my first logical partition. The second entry in the partition table is now consumed to support my string of logical partitions. This partition will contain data files and Linux will mount it as /driveE. This allows me move files between Linux and XP. At bootup time, the NT loader looks for a file called hiberfil.sys. If found, it is loaded into memory and execution resumes. This is how hibernation is implemented. Upon awakening from hibernation, it is critical that nothing has changed since hibernation began. Even docking or undocking a laptop is enough is cause problems. I will be booting via grub and I can't guarantee that another OS might not get started. Since I am sharing partitions among OS's this would be a recipe for disaster. So I have disabled hibernation.
Each of the other OS installation procedures is prepared to co-exist with a pre-existing XP instance in the first primary partition. Most of them would install a bootloader that could boot XP or themself. See the "failsafe boot" article below to see why this is not a problem.
Linux Distros
I used LVM for each Linux distro. Even / is under LVM, but Linux cannot boot from LVM, so I created a temporary /boot partition during the install. Let's take RedHat as am example...it was the first distro I installed. I copied /boot to /mastergrub/RedHat. Then I moved /mastergrub/RedHat/grub to /mastergrub/grub. /mastergrub/RedHat/grub became a symlink to /mastergrub/grub. And /boot becomes a symlink to /mastergrub/RedHat. Each distro gets its own subdirectory under /mastergrub and each of these subdirectories gets a grub symlink pointing to /mastergrub/grub. So all of the distros wind up using the same grub instance. That /boot partition is then just discarded.
I used a separate /tmp partition and swap partition putside of LVM. The swap area is 2 GB and /tmp is 1 GB. Each Linux distro uses the same partitions. So, in total, I use 3 GB for /tmp and swap rather than 15 GB. I am in the process of modifying the start up scripts to rebuild /tmp at boot time. This will mean that any OS can use the swap or /tmp area for any purpose. It also explains why /tmp in ext2 rather than ext3. There is no point in a log if I rebuild the filesystem upon each boot.
RedHat is rather old and it is out of step with the other distros. But I still encounter RedHat deployed by companies so I wanted a version on my laptop. RedHat is using LVM version 1 and the other distros use LVM version 2. I picked Fedora, and did a "vgscan --makenodes". This gave me device files for all of the other distros' logical volumes. I can mount the other distros when I need to. I will use this to develop a file level backup for the Linux distros. I have also used this to correct a problem with boot up scripts.
Every Linux partition is a logical partition. This includes the Grub partitions and the LVM partitions. I have a /userdata partition formatted as ext3 which all of the Linux distros mount. I do have a small /home (under LVM) in each distro so that each can have its own start up files, etc. But most of my stuff will go in /userdata. So each distro has its own LVM partition. But then there is swap, /tmp, /userdata, and /mastergrub (each in a separate logical partition) used by all distros in common. And there is /driveE which they mount as well.
FreeBSD
FreeBSD goes into primary partition 3. I used Acronis to pre-allocate the partition before the installation. FreeBSD carves up the partition intp pieces that it confusingly also calls partitions. In theory, Grub can boot FreeBSD directly, but I could not get that to work. So I had FreeBSD install it's own bootloader into the partition, thus leaving the MBR alone. Then I modified grub.conf to chainloader into it. I would like to get a direct Grub boot working and I plan to work on this. For now, it is good enough.
Solaris
I have one primary partition left and I installed Solaris 10 in it. Much like FreeBSD, Solaris carves the partition up. It uses "slices" so describe the pieces. Again, I preallocated the partition before doing the install. At the last minute I noticed that Sun had a new version of Solaris 10 on their site. I don't usually instantly jump to each new version, but Sun had switched from their own bootloader to using grub. So I downloaded the latest Solaris 10. Well, none of my versions of Grub can read the Solaris slices...I even downloaded the latest Grub from the Grub home page and still no go. Sun must have modified Grub. I may switch to Sun's version at some point. But for now, my Grub is chainloadering Sun's Grub.
My Final Grub Configuration
With each OS that used Grub, I took a look at its grub.conf. Many times I saw a new technique; and, if I liked it, I added it to my bag of tricks. SuSE heavily modified Grub and I could not find much info on their mods. There are warnings that SuSE's mods introduced a security problem. So I will not use the SuSE version of Grub. But even with SuSE, I found some things to use. My grub.conf:
#
# This configuration file is maintained by a series of scripts that support the concept of this
# partition being moved or copied. Statements like " r00t (xxxx) " where there is exactly one
# space between the word "root" and the opening parenthesis will be replaced with a grub device
# that corresponds to the current partition. Put extra spaces after "root" to protect a root entry
# from this automatic replacement.
default=1
timeout=60
color red/black black/green
title Boot Octave from grub.conf on mastergrub
root
title 1) Windows XP Pro
root (hd0,0)
makeactive
chainloader +1
title 2) RedHat
root (hd0,6)
kernel /Redhat/vmlinuz-2.4.18-14 ro root=/dev/RedHat00/LogVol00 hdb=ide-scsi
initrd /Redhat/initrd-2.4.18-14.img
title 3) Fedora Core
root (hd0,6)
kernel /Fedora/vmlinuz-2.6.15-1.2054_FC5 ro root=/dev/Fedora00/LogVol00 rhgb quiet
initrd /Fedora/initrd-2.6.15-1.2054_FC5.img
title 4) SuSE
root (hd0,6)
kernel /SuSE/vmlinuz root=/dev/SuSE00/lvol0 vga=0x31a resume=/dev/hda8 splash=silent showopts
initrd /SuSE/initrd
title 5) Debian
root (hd0,6)
kernel /Debian/vmlinuz-2.4.27-2-386 root=/dev/mapper/Debian00-lvol0 ro
initrd /Debian/initrd.img-2.4.27-2-386
title 6) Scientific
root (hd0,6)
kernel /Scientific/vmlinuz-2.6.9-34.EL ro root=/dev/Scientific00/LogVol00 rhgb quiet
initrd /Scientific/initrd-2.6.9-34.EL.img
title 7) FreeBSD
rootnoverify (hd0,2)
makeactive
chainloader +1
title 8) Solaris
rootnoverify (hd0,3)
makeactive
chainloader +1
title ----UTILITIES----
root
title ______reboot
reboot
title ______off
halt
title ______halt
halt --no-apm
title ______floppy
chainloader (fd0)+1