Master the core knowledge of Linux system grub.conf configuration in one minute

Master the core knowledge of Linux system grub.conf configuration in one minute

A boot loader is a small program that runs before the computer loads the operating system kernel. Through this small program, the hardware device can be initialized and the mapping map of the memory space can be established, so as to load the software and hardware environment of the system into a suitable state, so as to prepare for the final call to the operating system kernel. Usually, the bootloader depends on the hardware implementation. There are two common bootloaders in early Linux systems, namely Grub and Lilo. Now Grub has become the mainstream (similar to the boot.ini boot file under Windows).

The boot loader reads the configuration information of the grub.conf file, and then starts different operating systems according to the corresponding configuration information. The administrator can view the configuration information of grub.conf from three paths, as follows:

[root@oldboy boot]# cat /etc/grub.conf

#<== can also read /boot/grub/menu.lst (soft link) or /boot/grub/grub.conf (real file).

...omitting the multi-line comment information, in fact, the comments here have been explained quite clearly, but 90% of beginners can't see it here...

default=0

#<== How to load the system by default, 0 means the first name in the loading menu, the default add-in can be adjusted when there are multiple systems.

timeout=5

#<== indicates how many seconds to start loading the default system, giving the administrator the time to choose in advance.

splashimage=(hd0,0)/grub/splash.xpm.gz  

#<==The background icon displayed at startup, in (hd0,0) represents the /boot partition.

hiddenmenu 

#<==When the system starts, the boot menu information will be hidden, and the system will be started with the default settings, unless the user presses the key to intervene.

password [–md5|–encrypted ] STRING   

#<==Password authentication is required when editing the grub menu, one of the basic Linux optimizations, not by default.

title CentOS 6 (2.6.32-696.el6.x86_64)  

#<==The project name corresponding to the system to be started can be modified as needed.

root (hd0,0) 

#<==The partition where the boot kernel files and the driver files required by the kernel are located, (hd0,0) represents the /boot partition.

#<==Where hd0 represents the first disk of the computer, and the 0 after the comma in (hd0,0) represents the first partition, that is, (hd0,0) represents the first partition of the first disk, ie /dev /sda1 (The /boot partition is usually the first independent partition, and the corresponding device name is sda1).

kernel /vmlinuz-2.6.32-696.el6.x86_64 ro root=UUID=491eabe5-e6c0-4457-9bdb-b37cc6751308 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  

#<==The whole line means loading the kernel, that is, reading the kernel file on the boot partition and a bunch of optional kernel parameters.

#<==/vmlinuz-2.6.32-696.el6.x86_64 is the kernel file. root=UUID=The following string of numbers indicates the device information (/dev/sda3) corresponding to the root. Other introductions have little effect and can be ignored.

initrd /initramfs-2.6.32-696.el6.x86_64.img   #<==The location of the driver file required for kernel startup, which exists in the boot area.

Tip: The knowledge of grub.conf is actually not very useful in enterprise Linux operation and maintenance. The purpose of explaining grub is to hope that readers can understand the entire boot process of the Linux system to pave the way. The RHCE certification course will have exam questions for repairing grub.conf , in fact, it is not very useful, because in the operation and maintenance of IT websites, there are very few online problems, and if there is a problem, you can directly switch the service, and then you can slowly study the repair or reinstall.

The content source "Learning Linux Operation and Maintenance with Old Boys : Core Basics in Practice" is expected to be published in July 2018 , so stay tuned .

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326047329&siteId=291194637