官术网_书友最值得收藏!

GRUB

GRUB stands for Grand Unified Bootloader. GRUB is primarily used for booting Linux distributions. However, GRUB can work with other boot loaders. A common use-case scenario is for dual booting with a Microsoft operating system: it does this by doing a hand-off to the Windows bootloader for Microsoft operating systems.

GRUB uses the /boot/grub/grub.conf file. Sometimes you will see /boot/grub/menu.lst, but this file is simply a symbolic link to /boot/grub/grub.conf. Using the CentOS 6.5 distro, run the following command:

[root@localhost ~]# ls -l /boot/grub
total 274
-rw-r--r--. 1 root root 63 Jun 20 01:47 device.map
-rw-r--r--. 1 root root 13380 Jun 20 01:47 e2fs_stage1_5
-rw-r--r--. 1 root root 12620 Jun 20 01:47 fat_stage1_5
-rw-r--r--. 1 root root 11748 Jun 20 01:47 ffs_stage1_5
-rw-------. 1 root root 769 Jun 20 01:48 grub.conf
-rw-r--r--. 1 root root 11756 Jun 20 01:47 iso9660_stage1_5
-rw-r--r--. 1 root root 13268 Jun 20 01:47 jfs_stage1_5
lrwxrwxrwx. 1 root root 11 Jun 20 01:47 menu.lst -> ./grub.conf
-rw-r--r--. 1 root root 11956 Jun 20 01:47 minix_stage1_5
-rw-r--r--. 1 root root 14412 Jun 20 01:47 reiserfs_stage1_5
-rw-r--r--. 1 root root 1341 Nov 14 2010 splash.xpm.gz
-rw-r--r--. 1 root root 512 Jun 20 01:47 stage1
-rw-r--r--. 1 root root 126100 Jun 20 01:47 stage2
-rw-r--r--. 1 root root 12024 Jun 20 01:47 ufs2_stage1_5
-rw-r--r--. 1 root root 11364 Jun 20 01:47 vstafs_stage1_5
-rw-r--r--. 1 root root 13964 Jun 20 01:47 xfs_stage1_5
[root@localhost ~]#

From the preceding output, we can see /boot/grub/grub.conf and also the symbolic link /boot/grub/menu.lst.

We can view the actual /boot/grub/grub.conf file as follows:

[root@localhost ~]# cat /boot/grub/grub.conf
# 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/sda2
# initrd /initrd-[generic-]version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.32-431.el6.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.32-431.el6.x86_64 ro root=UUID=05527d71-25b6-4931-a3bb-8fe505f3fa64 rd_NO_LUKS rd_NO_LVM LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet
initrd /initramfs-2.6.32-431.el6.x86_64.img
[root@localhost ~]#

From the preceding output, the common options would be as follows:

  • default=0: This means it is the first entry to boot from the menu.
  • timeout=5: This gives the amount of seconds (5, in this case) that the menu will be displayed for before the Linux kernel is booted or the Windows boot loader gets a hand-off from GRUB.
  • splashimage=(hd0,0)/grub/splash.xpm.gz: This is the background image of the boot menu.
  • root (hd0,0): This refers to the first hard disk and the first partition on the first hard disk.
主站蜘蛛池模板: 汉寿县| 临武县| 惠水县| 上犹县| 墨竹工卡县| 东山县| 红河县| 成安县| 平顺县| 舞钢市| 花垣县| 陇南市| 利辛县| 临城县| 吉首市| 黄冈市| 紫金县| 察隅县| 莎车县| 张家港市| 米脂县| 海原县| 田林县| 云霄县| 深水埗区| 惠水县| 镶黄旗| 自贡市| 逊克县| 卓尼县| 吉安县| 蓝田县| 安西县| 沅江市| 葫芦岛市| 时尚| 凤翔县| 沙坪坝区| 红安县| 嘉鱼县| 永登县|