2. Boot boot program Grub
2.1 Grub configuration file
(1) Representation of partitions in grub
Hard disk |
Partition |
Linux Device file name |
Device file name in Grub |
Block 1th SCSI HDD |
1th Primary Partition |
/dev/sda1 |
HD (0,0) |
2nd Primary Partition |
/dev/sda2 |
HD (0,1) |
Extended partition |
/dev/sda3 |
HD (0,2) |
1th logical Partition |
/dev/sda5 |
HD (0,4) |
Block 2nd SCSI HDD |
1th Primary Partition |
/dev/sdb1 |
HD (1,0) |
2nd Primary Partition |
/dev/sdb2 |
HD (+) |
Extended partition |
/dev/sdb3 |
HD (+) |
1th logical Partition |
/dev/sdb5 |
HD (1,4) |
(2) Grub configuration file: #vi/boot/grub/grub.conf
①default=0 boot 1th System by default
②timeout=5 wait time, default is 5 seconds
③splashimage= (hd0,0)/grub/splash.xpm.gz here specifies where to save the background image file when Grub starts (typically under/boot/grub/)
④hiddenmenu hidden Menu
⑤title CentOS (2.6.32-642.el6.i686) title
⑥root (hd0,0) refers to the save partition of the startup program
⑦kernel/vmlinuz-2.6.32-642.el6.i686 ro root=uuid=71c20ba0-4900-4
3cf-a18b-21f5ef11b893 Rd_no_luks keyboardtype=pc keytable=us rd_no_
MD Crashkernel=auto LANG=ZH_CN. UTF-8 RD_NO_LVM rd_no_dm RHGB quiet
Defining options for Kernel nucleation
⑧INITRD/INITRAMFS-2.6.32-642.EL6.I686.IMG specifies where the Initramfs memory file system image file is located.
2.2 Grub adjustment of encryption and character interface resolution
(1) Grub encryption
① startup, when the countdown to select "Operating System" appears , press any key to enter the Grub interface
② Press "E key", can directly edit Grup
③ to prevent this unsafe behavior of pressing the "E key" directly into the edit grub file, it can be encrypted.
#grub-md5-crypt// generate an encrypted cipher string
Password://Enter the password to be added for grub, such as 123456
Retype password://Enter password again
$1$wbwv7/$SKnbyZ 88.xl7lfyzbza9p. The generated cipher string
#vi/boot/grub/grub.conf
then save, restart, and press any key to enter the grub interface while waiting for the operating system to be selected .
(2) Adjustment of character interface resolution
① query whether the kernel supports resolution adjustment : (To see the effect in the virtual machine!) The remote tool is invalid! )
# grep "Config_framebuffer_console"/boot/config-2.6.32-642.el6.i686
Config_framebuffer_console=y//Support adjust resolution
Config_framebuffer_console_detect_primary=y
Config_framebuffer_console_rotation=y
② setting of adjustment parameters
Color depth |
640x480 |
800x600 |
1024x768 |
1280x1024 |
8 Guests |
769 |
771 |
773 |
775 |
15 Guests |
784 |
787 |
790 |
793 |
16 Guests |
785 |
788 |
791 |
39° |
32 Guests |
786 |
789 |
792 |
795 |
③ Modifying the Grub configuration file and changing the resolution
14th Linux Startup Management (2) _ Boot loader grub