The following is a brief step-by-step on how I’ve been multi-booting different operatings systems on my machines for the past few years.
It’s not necessarily the easy way to do things. It is the way I first learned and the way that I’m most comfortable with using. I’m posting it here, as I believe it may be helpful to some Linux Explorers out there. This tutorial is based on GRUB Legacy. I do not use the new GRUB2 on my machines.
Here we go…
I have multiple drives on my system, so multi-booting becomes a bit more interesting. Currently, I have three hard drives installed. They are /dev/sda, /dev/sdb, and /dev/sdc. We won’t concern ourselves at all with /dev/sdc because it is primarily used as a common storage/backup drive. My operating systems are installed on /dev/sda and /dev/sdb.
I use /dev/sda (1st boot device in my BIOS) as the drive that has my primary operating system and my secondary operating system on it. I break my drives down into numerous partitions because I always install GNU/Linux operating systems on at least two partitions; /(root) and /home. I also have a common /swap partition on each drive that I plan on installing GNU/Linux distributions on.
My /dev/sda partitions look like this:
/dev/sda1 * 16065 51215219 25599577+ 83 Linux <– Slackware /(root)
/dev/sda2 51247350 153645659 51199155 83 Linux <– Slackware /home
/dev/sda3 153661725 488392064 167365170 5 Extended
/dev/sda5 153661788 204860879 25599546 83 Linux <– Arch /(root)
/dev/sda6 204877008 307275254 51199123+ 83 Linux <– Arch /home
/dev/sda7 307307448 311403959 2048256 82 Linux swap / Solaris
/dev/sda8 311420088 488392064 88485988+ 83 Linux <– Archives
My /dev/sdb partitions look like this:
/dev/sdb1 * 16384 51216383 25600000 7 HPFS/NTFS/exFAT <– MS Windows XP
/dev/sdb2 51232768 102432767 25600000 7 HPFS/NTFS/exFAT <– MS Windows Programs
/dev/sdb3 102453181 488270159 192908489+ 5 Extended
/dev/sdb5 102453183 106550639 2048728+ 82 Linux swap / Solaris
/dev/sdb6 106565823 137289599 15361888+ 83 Linux <– CentOS tester 1 /(root)
/dev/sdb7 137304783 188501039 25598128+ 83 Linux <– CentOS tester 1 /home
/dev/sdb8 188516223 219239999 15361888+ 83 Linux <– Foresight tester 2 /(root)
/dev/sdb9 219255183 270451439 25598128+ 83 Linux <– Foresight tester 2 /home
/dev/sdb10 270466623 301190399 15361888+ 83 Linux <– Debian tester 3 /(root)
/dev/sdb11 301205583 352401839 25598128+ 83 Linux <– Debian tester 3 /home
/dev/sdb12 352417023 383140799 15361888+ 83 Linux <– vacant tester 4 /(root)
/dev/sdb13 383155983 434352239 25598128+ 83 Linux <– vacant tester 5 /home
/dev/sdb14 434367423 488270159 26951368+ 83 Linux <– common storage
You get the above information on your drives using the fdisk -l command as root from the command line.
Alright then, let’s say that I now want to install Fedora Core Linux on my tester 4 partitions of /dev/sdb. Here’s how I would do that step-by-step:
1) Begin the Fedora installation setting /dev/sdb5 as swap, /dev/sb12 as /(root), and /dev/sdb13 as the /home partition from Fedora’s installer.
2) When the Anaconda installer reaches the point where it asks where I want to install the GRUB bootloader, I choose to SKIP installation of GRUB.
3) Once the install is finished, I reboot my main operating system (Slackware) and from the command line I mount the newly installed Fedora /(root) partition:
root_Slackware/home/vtel57:# mount /dev/sdb12 /mnt/tmp
*Note: I have a /mnt/tmp directory in my Slackware. If you don’t have a /mnt/tmp, just mount in /mnt. You’ll be fine.
4) I list the contents of the Fedora /boot directory:
root_Slackware/home/vtel57:# ls /mnt/tmp/boot
5) I copy down the vmlinuz and initrd information. You’ll be looking for the vmlinuz-<kernel version> and the initrd-<kernel version>.img files specifically. You’ll need that information for the next step.
6) I edit my /boot/grub/menu.lst file to add the new Fedora Core entry. Note: my MBR-controlling GRUB is in my secondary OS, Arch Linux. I can still mount and modify it from within Slackware, though.
root_Slackware/home/vtel57:# mount /dev/sda5 /mnt/tmp
root_Slackware/home/vtel57:# vim /mnt/tmp/boot/grub/menu.lst
I’ll add this entry to the file:
# Fedora Core
title fedora (t4)
root (hd1,11)
kernel /boot/vmlinuz-<kernel version> root=/dev/sdb12 ro
initrd /boot/vmlinuz-<kernel version>.img
7) I reboot and choose “fedora (t4)” from the GRUB menu to boot my new Fedora installation.
That’s it, folks. Straightforward, but not necessary the easiest way to do this. That’s the beauty of GNU/Linux. You can do it your way.
Have fun!
~Eric
P.S. I’m still working on the next shell scripting lesson. It’s going to be about variables and parameters, a necessary lesson for further BASH learning. Unfortunately, it’s also kinda’ complicated, so it’s taking me a bit to figure out how to formulate a lesson and still stay loyal to my primary goal here… keeping it as simple as possible. Stay tuned…
*Originally published on my Nocturnal Slacker v1.0 blog at WordPress.com