Article Title: GRUB instructions (III ). Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Iii. GRUB Interfaces
GRUB mainly has three powerful interfaces that provide different levels of functions. Each interface allows the user to guide the operating system, or even move between interfaces in the GRUB environment.
Menu interface
If GRUB is automatically configured by the installation program of Red Hat Linux, its default display interface is the menu interface. After the system is started for the first time, an operating system or kernel menu (which has been configured with their respective boot commands in advance) stores a list by name in this interface. Use the arrow keys to select a non-default option and then press the Enter key to guide it. If this is not the case, a notebook may have been set, then GRUB will start to load the default option.
On the menu interface, press the [e] key to edit the commands in the highlighted menu item. Press the [c] key to load a command line interface.
Menu project Editor interface
Press the [e] key in the boot loader menu to go to the menu project editor. The GRUB command for the project is displayed here. Before guiding the operating system, you can change these commands and add them (after the current row, use the [o] key; before the current row, use [0]). edit (with the [e] Key) and delete (with the [d] key ).
After all the changes are completed, run these commands with the [B] key and boot the operating system. [Esc] to discard these changes, and the standard menu interface will be re-entered. [C] key is used to load the command line interface.
Command line interface
The command line is the most basic interface of GRUB, but it is also the interface that has been granted the maximum control capability. In the command line interface, enter any related GRUB commands and press enter to execute them. The function of this interface is somewhat similar to the shell function, such as the [Tab] key completion, the prompt before and after, and the [Ctrl] key combination when the command is input, for example, [Ctrl]-[a] Move to the beginning of the line, [Ctrl]-[e] Move to the end of the line. In addition, the arrow keys, [Home], [End], and [Delete] are used in the same way as those in bash shell.
Interface Usage Sequence
When the GRUB environment starts loading the second-step bootstrap loader, it looks for its own configuration file. After the configuration file is found, it uses this configuration file to create a menu list of the operating system to be loaded, and then displays the boot menu interface.
If the configuration file is not found, or the configuration file cannot be read, GRUB loads the command line interface to allow users to manually enter necessary commands to start the operating system.
If the configuration file is incorrect, GRUB displays an error and requests the input. This is very helpful because you will be able to see where the problem occurs in the file and fix it. Press any key to reload the menu interface. Based on the error reported by GRUB, edit the menu options and correct the problem. If this correction fails, the error is reported and GRUB starts again.
4. GRUB commands
GRUB contains many different commands that can be executed interactively in the command line interface. Some of these commands can be followed by the options after the command name. These options are separated by spaces.
The following lists some of the most useful commands:
Boot-boot the operating system or chain loader that has been previously specified and loaded.
Chainloader-load the specified file as a chain loader. To obtain the file in the first sector of a specified partition, + 1 is used as the file name.
Displaymem-displays the current memory usage. This information is BIOS-based. This command helps determine how much memory the system has before boot.
Initrd-allows you to specify an initial ramdisk available during boot. This is required when the kernel needs some modules for full boot.
Install p-install the Master Boot Record from GRUB to the system. This command allows GRUB interface to appear during system restart.
Warning the install command overwrites other information in the primary Boot Sector. If the command is executed, all information except GRUB information used to guide other operating systems will be lost. Before executing this command, make sure you have a correct understanding of it.
This command can be configured in several different ways. However, it must be specified. Indicates a device, partition, and file, where you can find the first image of the boot loader, such as (hd0, 0)/grub/stage1. In addition, it also specifies the hard disk to which the boot loader should be installed, such as (hd0 ).
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service