Grand and Unified
- 0
- Add a Comment
- No Related Post
Grand and Unified
We’ve begun this week to talk about Grub, the GRand Unified Bootloader that’s winning the hearts and minds of many Linux users. With a little history and background in our pockets, it’s time to get down to the nitty-gritty - installing Grub on a system that doesn’t already leverage its great bootloading power.
First things first. If you’re using a current commercial distribution, check your install CDs for a Grub .rpm file. If none exist, you can download it from here. Pick your distro, download and install the package.
After installing, you’ll need to configure Grub to take over the initial bootloading duties on your machine. Remember, Grub also has chain-loading capabilities, so it may pass off some of the work to the native bootloader in your other OS. As root, open the /etc/grub.conf file in your favorite editor. Here’s a pretty standard simple configuration and some comments on what it all means:
default=0
timeout=10
splashimage=(hd0,0)/grub/splash.xpm.gztitle Linux
root (hd0,0)
kernel /vmlinuz-2.4.17 ro root=/dev/hdb2
initrd /initrd-2.4.17.imgtitle Windows 2000
map (hd0,0) (hd0,2)
map (hd0,2) (hd0,0)
rootnoverify (hd0,2)
chainloader +1
default is the default OS to boot. In this case it’s Linux, as it’s shown in position 0 of the OS list (the first title line). timeout is the length of time Grub will wait, in seconds, before booting to the default OS. splashimage is, as we’ve talked about, the background image for the Grub boot screen.
The real meat of Grub starts in the following line, with the first OS. The title line tells Grub that this section is the beginning of a set of parameters for a single OS. The root parameter defines the location of the root partition for this OS. In this case, it’s the first partition [0] of /dev/had [hd0]. Zero is significant in Grub so these notations may look a bit odd. kernel is exactly as it appears, directing Grub to the kernel image named vmlinuz-2.4.17 and to mount the root partition on /dev/hdb2 as read-only [ro]. This differs from the root line in that it uses an actual Linux partition name. initrd, as you’ll remember, is loaded into RAM while the rest of the system boots, then released. This is the name and location of the initrd image.
map is an interesting piece of work in Grub. In essence, it tricks Windows into believing that it’s installed in the first partition of the first hard disk. This prevents Windows from overwriting the partition table. rootnoverify instructs Grub to boot from the Windows partition but to leave it unmounted. Finally, chainloader is that mystical piece of code that passes the boot process to the native Windows bootloader.
You’ll notice some similarities with Lilo in Grub. Overall, though, Grub is a much more robust and flexible boot manager. Tomorrow, we’ll talk about some of the potential gotchas when using Grub to dual boot your system.
