Linux Step By Steps

Simple Grub Procedure

Supplied by Collins Richey, 11 AUG 2004, erichey2@comcast.net

In case you haven't installed Grub and want to do so, here's a simple procedure to follow. If you have more complex needs than booting a plain ole linux and/or windows partition, please google for help.

Note for LILO users

Procedure

  1. Install the grub package using your favorite method - source, rpm, deb, slack, whatever. I'm using grub-0.94-r1, but select the most current stable version available for your distro or a recommended version.

  2. You must have a /boot/grub directory with the following contents. If the installer did not do this for you, make the directory and copy the following files from wherever the installer left them.
    e2fs_stage1_5
    fat_stage1_5
    ffs_stage1_5
    grub.conf (you create this file - see below)
    jfs_stage1_5
    menu.lst  (this is a symlink to grub.conf; optional)
    minix_stage1_5
    nbgrub
    pxegrub
    reiserfs_stage1_5
    splash.xpm.gz (optional)
    stage1
    stage2
    stage2.netboot
    stage2.old
    vstafs_stage1_5
    xfs_stage1_5
    
  3. Here is a sample grub.conf. I'm using a windows partition at hda1 ( hd0,0 ) and a linux partition at hda6
    ( hd0,5 ). Change to match your setup.
    # -- all this stuff is optional
    color white/blue black/light-gray
    default 0
    timeout 25
    ### This is the g2 splash image
    splashimage=(hd0,5)/boot/grub/splash.xpm.gz
    # --- end of optional stuff
    
    # note hd0,5 is my root partition. If you are using a 
    # /boot partition, then alter hd0,5 to wherever 
    # your /boot partition is located
    
    title what-ever-you-want-to-call-it
        root (hd0,5)
        kernel (hd0,5)/boot/your-kernel-name root=/dev/hda6 ro
    # note, the previous line for a separate /boot partition would be 
    # different unless your /boot partition has a /boot symlink
    #   kernel (hd0,?)/your-kernel-name root=/dev/hda? ro
    
    # -- obviously this is optional and for some obnoxious
    # but I run a dual boot machine
    
    title WinXP-hda1
        root (hd0,0)
        chainloader +1
    

  4. To enable grub as your bootloader, as root, do the following. Change hd0,5 to the location of your/boot/grub. The root statement merely points to the partition where grub can find the expected contents of /boot/grub. The setup statement identifies the disk drive (not partition) where the mbr is to be written.
    grub
    root (hd0,5)
    setup (hd0)
    quit
    

  5. Reboot and enjoy

searchSearch Index