Updating GRUB





Updating GRUB

You should now update your /etc/grub.conf file to include an option to boot the new kernel. The make install command does this for you automatically.

In this example, default is set to 1, which means the system boots the second kernel entry, which happens to be that of the original kernel 2.6.5-1.358. You can set this value to 0, which makes it boot your newly compiled kernel (the first entry).

     default=1
     timeout=10
     splashimage=(hd0,0)/grub/splash.xpm.gz
     title Red Hat Linux (2.6.5-1.358-new)
             root (hd0,0)
             kernel /vmlinuz-2.6.5-1.358-new ro root=LABEL=/
             initrd /initrd-2.6.5-1.358-new.img
     title Red Hat Linux (2.6.5-1.358)
             root (hd0,0)
             kernel /vmlinuz-2.6.5-1.358 ro root=LABEL=/
             initrd /initrd-2.6.5-1.358.img

Kernel Crash Recovery

Sometimes the new default kernel will fail to boot or work correctly with the new kernel. A simple way of recovering from this is to reboot your system, selecting the old version of the kernel from the Fedora splash screen. Once the system has booted with this stable version, edit the grub.conf file and set the default parameter to point to the older version instead. If this fails, you may want to boot from a CD with the original kernel. You can then try to either reinstall a good kernel RPM or rebuild the failed one over again after fixing the configuration problem that caused the trouble in the first place.

How to Create a Boot CD

The Fedora Core 2 kernel is too big to fit on a floppy disk, so you'll have to create a boot CD instead. Here are the steps.

1.
Each installed kernel has a dedicated subdirectory for its modules in the /lib/modules directory. Get a listing of this directory. Here there are two installed kernels: versions 2.6.5-1.358 custom and 2.6.8-1.521:

[[email protected] tmp]# ls /lib/modules/
2.6.5-1.358custom  2.6.8-1.521
[[email protected] tmp]#

2.
Select the desired kernel, and use the mkbootdisk command to create a CD ISO image named /tmp/boot.iso of one of the kernels, in this case 2.6.8-1.521:

[[email protected] tmp]# mkbootdisk --iso --device /tmp/boot.iso \
                        2.6.8-1.521

3.
Burn a CD using the image. This creates a boot CD with the specified kernel, named vmlinuz, and a scaled-down version of the grub.conf configuration file named isolinux.cfg, both located in the isolinux subdirectory of the CD. This example mounts the newly created CD-ROM and takes a look at the isolinux.cfg file to confirm that everything is okay.

 [[email protected] tmp]# mount /mnt/cdrom
 [[email protected] tmp]# ls /mnt/cdrom/isolinux/
boot.cat   boot.msg  initrd.img  isolinux.bin  isolinux.cfg
TRANS.TBL   vmlinuz
[[email protected]  tmp]# cat /mnt/cdrom/isolinux/isolinux.cfg
default linux
prompt 1
display boot.msg
timeout 100
label linux
        kernel vmlinuz
        append initrd=initrd.img ro root=/dev/hda2
[[email protected] tmp]#

When you reboot your system with the CD, the boot process automatically attempts to access your files in the /root partition and boot normally. The only difference is that the kernel used is on the CD.


     Python   SQL   Java   php   Perl 
     game development   web development   internet   *nix   graphics   hardware 
     telecommunications   C++ 
     Flash   Active Directory   Windows