1. Create a Ramdisk file in RHEL6. The file name is different from that in rehl5.
[Root @ server8 grub] # mkinitrd/root/initramfs-'uname-R '. img 'uname-R' indicates the kernel version through uname-r, and uses the command connector ''as a variable.
- Grub and mbr during Linux boot
- Installation and Use of grub
- Grub Bootstrap Configuration File Analysis
- CentOS 6.4 grub and password
2. reinstall grub
[Root @ server8 ~] # Grub-install/dev/sda install grub on the first disk
3. Detailed explanation of the grub. conf file
[Root @ server8 ~] # Cat/boot/grub. conf
Default = 0 default timeout does not take action to start the title, 0 indicates to start the first title
Timeout = 5 timeout
Splashimage = (hd0, 0)/grub/splash.xpm.gz
Indicates whether the hiddenmenu is a shadow menu.
Title Red Hat Enterprise Linux (2.6.32-71. el6.i686) first title display content, which can be written as needed
The partition where the root (hd0, 0) boot is located. It is written in (hd0, 0) mode.
Kernel/vmlinuz-2.6.32-71.el6.i686 ro root = UUID = export rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG = zh_CN.UTF-8 KEYBOARDTYPE = pc KEYTABLE = us crashkernel = auto rhgb quiet
Initrd/initramfs-2.6.32-71.el6.i686.img specifies the name of the Ramdisk File
Understanding (hd0, 0): the linux system recognizes two types of disks: IDE disks and SCSI disks. The former is named hda, hdb, hdc, and hdd, the latter is sda, sdb, sdc, and sdd, indicating the disk name and drive type,
When a partition is required, it is represented by a number. For example, sda1 indicates the first partition of the first SCSI drive disk. hdb2 indicates the second partition of the IDE interface disk, and so on. However, grub identifies the disk
In fact, it is represented by (hdN, M). N represents the first disk, 0 represents the first disk, and 1 represents the second disk, similarly, no disk is used for IDE or SCSI interfaces,
Use M to indicate the Partition Number, 0 to indicate the first partition, 1 to indicate the second partition, and 3 to indicate the third partition. The correspondence between linux and grub on the disk is as follows:
Disk of the IDE interface:
Linux grub
/Dev/hda1 (hd0, 0)
/Dev/hda2 (hd0, 1)
/Dev/hda3 (hd0, 2)
......
/Dev/hdb1 (hd1, 0)
/Dev/hdb2 (hd1, 1)
/Dev/sdb3 (hd1, 2)
......
SCSI interface Disk:
Linux grub
/Dev/sda1 (hd0, 0)
/Dev/sda2 (hd0, 1)
/Dev/sda3 (hd0, 2)
......
/Dev/sdc1 (hd2, 0)
/Dev/sdc2 (hd2, 1)
/Dev/sdc3 (hd2, 2)
Grub. conf configuration files vary according to different boot partition types:
1. boot can be used as an independent partition. df/boot can be used to check whether the device is mounted to the/boot directory. If so, boot is used as a separate partition. The content of this partition is as follows:
Default = 0
Timeout = 5
Splashimage = (hd0, 0)/grub/splash.xpm.gz
Hiddenmenu
Title Red Hat Enterprise Linux (2.6.32-71. el6.i686)
Root (hd0, 0)
Kernel/vmlinuz-2.6.32-71.el6.i686 ro root = UUID = 4e076fae-197d-42a7-b177-ac9ade0548cb rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LA
NG = zh_CN.UTF-8 KEYBOARDTYPE = pc KEYTABLE = us crashkernel = auto rhgb quiet
Initrd/initramfs-2.6.32-71.el6.i686.img
|
Relative Path
2. boot is under the/directory.
Default = 0
Timeout = 5
Splashimage = (hd0, 0)/grub/splash.xpm.gz
Hiddenmenu
Title Red Hat Enterprise Linux (2.6.32-71. el6.i686)
Root (hd0, 0)
Kernel/boot/vmlinuz-2.6.32-71.el6.i686 ro root = UUID = 4e076fae-197d-42a7-b177-ac9ade0548cb rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LA
NG = zh_CN.UTF-8 KEYBOARDTYPE = pc KEYTABLE = us crashkernel = auto rhgb quiet
Initrd/boot/initramfs-2.6.32-71.el6.i686.img
|
One more boot
4. Interface Types supported by grub:
1. menu interface
You can set multiple boot menus in the configuration file/boot/grub. conf, such as dual-system boot and Xen kernel. You can select
2. Editing page
During the restart process, press the e key to edit the selected menu, for example, correct incorrect characters. d can be directly deleted. All operations performed on the menu interface are currently valid.
3. command INTERFACE
In the bash environment, enter grub to go directly to the command shell interface where grub is located. On this interface, you can execute commands similar to those in bash, or enter c in the menu during startup to edit the command line.