|
|
||
A Slackware Desktop Enhancement GuideInstalling GRUB© Copyright Darrell Anderson. Every computer system needs a way to boot itself. Upon powering up a box, the BIOS (Basic Input Output System) provides the initial instructions and typically users configure their BIOS to continue the boot process by looking for a pointer located on the system’s hard drive master boot record (MBR). On any disk (including floppies), the MBR is only 512 bytes in length and is basically a pointer to a boot loader program that continues the boot operations for the operating system selected. GRUB (GRand Unified Bootloader) and LILO (LInux LOader) are boot loaders. Many GNU/Linux distro vendors support GRUB as the primary boot loader. Typically, when users install those distros GRUB gets installed automatically. Slackware sadly does not directly support GRUB. When users install Slackware they are offered an opportunity to install LILO but not GRUB. If users do not install LILO and, after installing Slackware over a previous distro, typically the hard drive MBR still points to a previous location to find the GRUB boot loader files. After installing Slackware the GRUB boot loader files no longer exist. The computer then sits there not knowing what to do. Not all is lost for those people who are familiar with GRUB and want to install Slackware. With Slackware, installing GRUB is another typical manual exercise. Fortunately, installing GRUB is a straightforward process. Of course, whether an individual prefers GRUB or LILO is a personal choice. GRUB does provide some advantages over LILO. One nice advantage is that LILO limits the length of the menu strings whereas GRUB does not. With GRUB, users can create long non-cryptic human readable descriptions for their menu options. Additionally, users do not have to re-run LILO every time they modify their menu, which many people tend to forget. With Slackware users will find GRUB in the /extras directory. For Slackware 10.2, that directory is located on CD-3, but is also available at any Slackware mirror web site. Installing is a typical Slackware process:
This will install the GRUB files. The important location to know is that the configuration files will be installed in /boot/grub. After installing the packages, run the following: grub-install /dev/hda This will install GRUB to the hard drive’s MBR. Then edit /boot/grub/menu.lst as necessary. If multi-booting with a Windows OS, then be sure to add a menu option so GRUB will pass (chainload) the boot sequence to the Windows boot loader (an example is provided below). Do not reboot until after editing and proofreading menu.lst. To create an emergency GRUB boot floppy, which is handy once every blue moon: grub-install /dev/fd0 Some notes:
Here is an example of a menu.lst: timeout 3 title NT4-Primary title Slackware 10.1 - 2.4.28 - KDE 3.3.2 title Slackware 10.1 - 2.4.28 - Init 3 title Floppy That last entry is kind of handy because users can disable floppy disk booting in the BIOS but still boot from floppy using GRUB. Notice too that there are two entries to boot Slackware: one from the GUI and one from the command line. The first Slackware entry is dependent upon configuring /etc/inittab correctly to boot into runlevel 4. For those who want to try to automate this process, run the grubconfig script. You probably will want to edit the menu.lst titles after running this script. Bear in mind that GRUB counts everything starting with zero. Thus, (hd0,1) points to the first hard drive (/dev/hda) and the second partition. Similarly, (hd0,12) points to /dev/hda, 13th partition. Be sure to browse the GRUB documentation. In emergencies, such as repartitioning a drive and then GRUB can no longer find the /boot/grub files, you still can boot with GRUB through the command line. For example, suppose your Slackware partition is located at the first partition and your /boot directory is located on that same partition. From the command line you can use GRUB like this: grub> root (hd0,0) Suppose you have Windows installed on the first partition, a swap partition at the second partition, and Slackware installed at the third partition. Then your emergency booting from the command line would look like this: grub> root (hd0,2) Suppose you have the same setup as the previous example, but you store your /boot directory in the fourth partition. grub> root (hd0,2) Notice the difference with pointing to the correct location for the kernel. Lastly, be sure to edit your menu.lst file to reflect similar changes. And don’t forget the GRUB manual. Finis. |
||