grup 2 ubuntu

GRUB 2 is the default boot loader and manager for Ubuntu since version 9.10 (Karmic Koala). As the computer starts, GRUB 2 either presents a menu and awaits user input or automatically transfers control to an operating system kernel. 作用

GRUB 2 is a descendant of GRUB (GRand Unified Bootloader) 源

It has been completely rewritten to provide the user significantly increased flexibility and performance. GRUB 2 is Free Software (加强)

grub-install -v 版本

GRUB 2's major improvements over the original GRUB include:  优点

  • Scripting support including conditional statements and functions 支持条件和函数
  • Dynamic module loading  动态加载模块
  • Rescue mode  恢复模式
  • Custom Menus  自定义菜单
  • Themes  主题
  • Graphical boot menu support and improved splash capability  图形 splash
  • Boot LiveCD ISO images directly from hard drive  启动 LiveCD 镜像
  • New configuration file structure  新的配置文件结构
  • Non-x86 platform support (such as PowerPC)  支持非x86平台
  • Universal support for UUIDs (not just Ubuntu) 使用UUID

GRUB vs GRUB 2

GRUB 2's default menu will look familiar to GRUB users but there are a great number of differences beneath the surface. 熟悉的菜单

1  On a new installation of Ubuntu 9.10 or later with no other installed operating systems, GRUB 2 will boot directly to the login prompt or Desktop. No menu will be displayed. 直接启动

  • Hold down (right) SHIFT to display the menu during boot. In certain cases, pressing the ESC key may also display the menu.
  • No /boot/grub/menu.lst. It has been replaced by /boot/grub/grub.cfg. 取代menu.lst 配置文件

  • There is no "/find boot/grub/stage1" at the grub prompt. Stage 1.5 has been eliminated.  启动信息消除
  • The main Grub 2 configuration file, normally located in the /boot/grub folder, is grub.cfg. It is the product of various scripts and should not normally be edited directly.  是其他脚本产生的, 不直接编辑

  • grub.cfg is overwritten by certain Grub 2 package updates, whenever a kernel is added or removed, or when the user runs update-grub.   grub.cfg文件被重写

  • The menu list of available Linux kernels is automatically generated by running update-grub.  自动生成

  • The user can create a custom file in which the user can place his own menu entries. This file will not be overwritten. By default, a custom file named 40_custom is available for use in the /etc/grub.d folder.  自定义配置文件 不被重写

  • The primary configuration file for changing menu display settings is called grub and by default is located in the /etc/default folder.  主配置文件

  • There are multiple files for configuring the menu - /etc/default/grub mentioned above, and all the files in the /etc/grub.d/ directory.  从配置文件

  • Partition numbering has changed. The first partition is now 1 rather than 0. The first device/drive is still hd0 by default (no change). These designations can be altered if necessary in the device.map file in the /boot/grub folder.  第一个分区是1而非0

  • Automated searches for other operating systems, such as Windows, are accomplished whenever update-grub is executed. Operating systems found will be placed in the Grub 2 menu.  自动搜索其他的操作系统

  • Changes made in the configuration files will not take effect until the update-grub command is executed. update
     -install 命令

Initial Default 默认的初始化

  • GRUB 2 will boot straight into the default operating system if no other operating system is detected. No menu will be displayed. If another operating system is detected, the GRUB 2 menu will display.

选择启动

  • The default entry is determined by the GRUB_DEFAULT= setting in /etc/default/grub; the first "menuentry" has a value of "0".

原文地址:https://www.cnblogs.com/kwingmei/p/3273647.html