GNU GRUB

From NoskeWiki
Jump to: navigation, search

About

GNU GRUB ("GRUB" for short) is a boot loader package from the GNU Project. GRUB is the reference implementation of the Multiboot Specification, which allows a user to have several different operating systems on their computer at once, and to choose which one to run when the computer starts.


How to edit GNU GRUB in red hat and change boot settings

At work I have a Sun Java Workstation W2100z which was set up by our IT guys. It's a dual boot system with Windows XP and Red Hat installed. It uses GNU-GRUB to do the booting, and often I want to change the default boot operating system (OS).... the process is:


  1. Boot into red hat
  2. Open a new terminal (unix shell)
  3. Enter: "cd /boot/grub"
  4. Enter: "sudo emacs grub.conf"
    1. (or can use vim or something else)
  5. Change the value of default and timeout.
    1. NOTE: the value "default=1" will set the 2nd (index starts at 0) OS in the list where each OS starts with the key word "title".
    2. NOTE: the value "timeout=10" is how long (in seconds) you can change the selection when the machine boots.
    3. NOTE: I would NOT advise changing anything else unless you know what you are doing!
  6. Save File & Exit
  7. Reboot The System


NOTE: The reason I needed to enter "sudo" is because I'm not the root user.






A copy of my current config (for myself) is:



# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/sda3
#          initrd /initrd-version.img
#boot=/dev/sda
default=6
timeout=10
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
password --md5 $1$MQLySVDb$/Hauowtx5SwA/CxT42m89/
title Red Hat Enterprise Linux AS (2.6.9-34.0.1.EL)
 root (hd0,0)
 kernel /vmlinuz-2.6.9-34.0.1.EL ro root=LABEL=/ rhgb quiet
 initrd /initrd-2.6.9-34.0.1.EL.img
title Red Hat Enterprise Linux AS (2.6.9-34.0.1.ELsmp)
 root (hd0,0)
 kernel /vmlinuz-2.6.9-34.0.1.ELsmp ro root=LABEL=/ rhgb quiet
 initrd /initrd-2.6.9-34.0.1.ELsmp.img
title Red Hat Enterprise Linux AS (2.6.9-34.EL)
 root (hd0,0)
 kernel /vmlinuz-2.6.9-34.EL ro root=LABEL=/ rhgb quiet
 initrd /initrd-2.6.9-34.EL.img
title Red Hat Enterprise Linux AS (2.6.9-34.ELsmp)
 root (hd0,0)
 kernel /vmlinuz-2.6.9-34.ELsmp ro root=LABEL=/ rhgb quiet
 initrd /initrd-2.6.9-34.ELsmp.img
title Red Hat Enterprise Linux AS (2.6.9-22.0.2.EL)
 root (hd0,0)
 kernel /vmlinuz-2.6.9-22.0.2.EL ro root=LABEL=/ rhgb quiet
 initrd /initrd-2.6.9-22.0.2.EL.img
title Red Hat Enterprise Linux AS (2.6.9-22.0.2.ELsmp)
 root (hd0,0)
 kernel /vmlinuz-2.6.9-22.0.2.ELsmp ro root=LABEL=/ rhgb quiet
 initrd /initrd-2.6.9-22.0.2.ELsmp.img
#title Red Hat Enterprise Linux AS (2.6.9-22.ELsmp)
# root (hd0,0)
# kernel /vmlinuz-2.6.9-22.ELsmp ro root=LABEL=/ rhgb quiet
# initrd /initrd-2.6.9-22.ELsmp.img
#title Red Hat Enterprise Linux AS (2.6.9-22.EL)
# root (hd0,0)
# kernel /vmlinuz-2.6.9-22.EL ro root=LABEL=/ rhgb quiet
# initrd /initrd-2.6.9-22.EL.img
#title Red Hat Enterprise Linux AS (2.6.9-11.ELsmp)
# root (hd0,0)
# kernel /vmlinuz-2.6.9-11.ELsmp ro root=LABEL=/ rhgb quiet
# initrd /initrd-2.6.9-11.ELsmp.img
#title Red Hat Enterprise Linux AS-up (2.6.9-11.EL)
# root (hd0,0)
# kernel /vmlinuz-2.6.9-11.EL ro root=LABEL=/ rhgb quiet
# initrd /initrd-2.6.9-11.EL.img
title Windows
        rootnoverify (hd1,0)
        chainloader +1
        map (hd0) (hd1)
        map (hd1) (hd0)


Links