ORC Owl Logo 2  

Owl River Company

  Your IP is:

Grub cutover notes from lilo

The cutover from lilo to grub has produced the predictable complaints from people comfortable with the prior bootload manager. In part this is due to the somewhat partial nature of developer provided documentation and usage examples within the FSF package.

The FSF scope of coverage on operating systems, architectures and bootimage sources is much more ambitious than lilo -- all the 'Free' variants, and several of the commercials; network based booting (a la' syslinux for Intel PXE); and so forth.

The customary checklist to follow might be:

  1. Make sure grub is installed. If not, using yum, for example, type:
    yum -y install grub
  2. Edit the grub.conf and device.map files to taste. In Red Hat Linux, thess files live in: /boot/grub/ with permissions 700. We have an example below. The device.map lists the sequence in which devices are consulted for the bootloader bootstrap code.
  3. MAKE a backup recovery floppy. The specifics are beyond the scope of this outline, but it usually looks like:
    mkbootdisk -v 2.4.18-27.8.x
    We use the -v verbose option, so a failed format, or other image creation error is more evident. If the media looks like it has problems, mark and discard it from the production stream at once; we snap bad floppies in half, so we don't grab one by mistake. ;)
  4. LABEL the recovery floppy; Hostname, description as 'recovery floppy', creation date, kernel variant, root partition, distribution, and admin's initials are appropiate for the floppy label.
  5. TEST the recovery floppy. Hands off. Sitting across the room.
  6. Okay. Now we get to work. Move the old /etc/lilo.conf based file away.
    mv /etc/lilo.conf /etc/lilo.conf_
  7. Install the bootsector selection code for the /boot/grub/grub.conf to use:
    grub-install /dev/hda (obviously, perhaps, /dev/sda would be used with a SCSI boot device)
  8. Look for errors. A successful install will look like this:
    [root@hostname root]# grub-install /dev/sda Installation finished. No error reported. This is the contents of the device map /boot/grub/device.map. Check if this is correct or not. If any of the lines is incorrect, fix it and re-run the script 'grub-install'. # this device map was generated by anaconda (fd0) /dev/fd0 (hd0) /dev/sda [root@hostname root]#
  9. Time for the acid test. Reboot it and again, watch from across the room.

Diagnosis of the cause of any failure, and recovery from failed grub at this point usually boil down to reading the info pages, and the error messages on the screen, and doing whatever is needed to remove them. Media errors are of course outside of the scope of what grub handles.

Sample /boot/grub/grub.conf
# grub.conf generated by anaconda -- note: editted manually later # # Note that you do not have to rerun grub after making changes to this file # NOTICE: You do not have a /boot partition. This means that # all kernel and initrd paths are relative to /, eg. # root (hd0,5) # kernel /boot/vmlinuz-version ro root=/dev/hda6 # initrd /boot/initrd-version.img #boot=/dev/hda # start the #0 entry if possible default=0 # or fall back to the #1 backup if not fallback 1 timeout=10 # splashimage=(hd0,5)/boot/grub/splash.xpm.gz title Red Hat Linux (2.4.7-10) root (hd0,0) # kernel /boot/vmlinuz-2.4.7-10 ro root=/dev/hda1 # IDE CD burner on SEcondary Master ... kernel (hd0,0)/vmlinuz-2.4.7-10 ro root=/dev/hda3 hdc=ide-scsi # title DOS # rootnoverify (hd1,0) # chainloader +1 #

Sample /boot/grub/device.map
# this device map was generated by anaconda (fd0) /dev/fd0 (hd0) /dev/sda [root@localhost grub]# cat /etc/fstab /dev/hda3 / ext2 defaults 1 1 /dev/hda1 /boot ext2 defaults 1 2 none /dev/pts devpts gid=5,mode=620 0 0 none /proc proc defaults 0 0 none /dev/shm tmpfs defaults 0 0 /dev/hda2 swap swap defaults 0 0 /dev/fd0 /mnt/floppy auto noauto,owner,kudzu 0 0 # # /dev/hdb1 /mnt/dos vfat defaults 1 2 #

See also: Issue 85: Boot with GRUB

Back to Top Page
[legal] [ no spam policy ] [ Copyright] © 2008 Owl River Company
All rights reserved.

Last modified: Fri, 15 Apr 2005 01:23:24 -0400