总有人装了Ubuntu仍忘不了Windows。我在刚接触linux 的时候也是这样,不过现在好了很多,如果不是必须要用Windows 的时候,我一般都选择进入Ubuntu。为了那些刚使用Ubuntu的人方便进入Windows,也为了以后有人再问我的时候,我可以很轻松明了的回答ta。特意在此记下GRUB2是如何修改默认引导系统的。
在网上Google或Baidu一下,结果会出来很多,我大致看了一下,绝大部分内容雷同,基本都是让你修改/boot/grub/grub.cfg。没错,无论过程怎么样结果都是grub.cfg被修改。但是在这个文件的开头它已经清清楚楚的告诉你:DO NOT EDIT THIS FILE。grub.cfg不应该手动被修改。
要想知道如何修改GRUB2,首先就应该清楚了解GRUB2是什么东西,是怎么回事。这里 https://wiki.ubuntu.com/Grub2 有比较详细的介绍。A more recent version of the information on this page can be found on https://help.ubuntu.com/community/Grub2 .
为了方便起见,我把如何修改默认引导系统Copy过来,如下:
grub (/etc/default/grub)
This file contains information previously found in the upper section of /boot/grub/menu.lst. It contains settings primarily affecting Grub's menu display. This file can be edited by root to make changes to these settings; they will be imported into grub.cfg when "update-grub" is executed.
<!--<br/ /><br/ />Code highlighting produced by Actipro CodeHighlighter (freeware)<br/ />http://www.CodeHighlighter.com/<br/ /><br/ />--># If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""
# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console
# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480
# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true
# Uncomment to disable generation of recovery mode menu entrys
#GRUB_DISABLE_LINUX_RECOVERY="true"
This file contains information formerly contained in the upper section of Grub Legacy's ''menu.lst'' and items contained on the end of the kernel line. The items in this file can be edited by a user with administrator (root) privileges. Grub developers have have placed explanatory comments within the file itself.
-
GRUB_DEFAULT=0
Sets the default and pre-selected menu entry. Entries may be numeric or saved
-
GRUB_DEFAULT=0
- Sets the default menu entry by menu position. As with Grub Legacy, the first "menuentry" in grub.cfg is 0, the second is 1, etc.
-
GRUB_DEFAULT="Windows XP Professional (on /dev/sda1)"
- Sets the default menu entry by name.
-
GRUB_DEFAULT=saved
- Sets the default menu entry with either whatever was selected on the last boot (if SAVEDEFAULT=true is set and the entry itself contains savedefault), whatever the last grub-set-default command saved or the first entry if nothing has ever been saved or the saved entry can't be found. If the menu is displayed during boot, the previously selected option will be highlighted. If no action is taken, this is selection which will be booted at the end of the timeout, or if the menu is hidden.
-
GRUB_TIMEOUT=10
- No change from Grub Legacy. This is the number of seconds before the default entry is automatically booted.
Setting a value of -1 will display the menu until the user makes a selection (no timeout).
-
GRUB_HIDDEN_TIMEOUT=0
The hidden timeout option is available to single-OS computers - if multiple OS's are known to Grub 2, this option is bypassed.
On single-OS systems, the menu will be hidden unless a # symbol is present at the beginning of this line. ( # GRUB_HIDDEN_TIMEOUT=0 )
-
The default setting initially depends on the presence of other operating systems.
- Another OS Detected: The menu will be displayed. ( The line will begin with a # symbol. )
- No other OS Detected: This setting is not used, as determined by the
- For integers greater than 0, the system will pause, but not display the menu, for the entered number of seconds.
-
0 The menu will not be displayed. There will be no delay.
-
The user may force displaying the menu as the computer boots by holding down the SHIFT key (single-OS computers only).
- During boot, the system will check the SHIFT key status. If it cannot determine the key status, a short delay will enable the user to display the menu by pressing the ESC key.
- If enabled, the splash screen designated in 05_debian_theme will be displayed even if the hidden menu feature is selected.
-
The user may force displaying the menu as the computer boots by holding down the SHIFT key (single-OS computers only).
-
GRUB_HIDDEN_TIMEOUT_QUIET=true
- true - No countdown is displayed. The screen will be blank.
- false - A counter will display on a blank screen for the duration of the GRUB_HIDDEN_TIMEOUT value.
-
GRUB_DISTRIBUTOR=lsb_release -i -s 2> /dev/null || echo Debian
- Determines the descriptive name in the menu entry. (Ubuntu, Xubuntu, Debian, etc.)
-
GRUB_CMDLINE_LINUX
If it exists, this line imports any entries to the end of the linux command line (Grub Legacy's "kernel" line) for both normal and recovery modes. This is similar to the "altoptions" line in menu.lst
-
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
This line imports any entries to the end of the 'linux' line (Grub Legacy's "kernel" line). The entries are appended to the end of the normal mode only. This is similar to the "defoptions" line in menu.lst. If you want a black screen with scrolling boot messages, remove "quiet splash". If you want a grub splash screen with limited messages underneath the Ubuntu logo, use only "splash". < This [only "splash"]will not work in Karmic during boot as the xsplash does not display the messages , but the messages at shutdown will be displayed.
-
#GRUB_TERMINAL=console
- Uncomment to disable graphical terminal (grub-pc only).
-
#GRUB_GFXMODE=640x480
-
Uncomment (remove '#' from beginning of the line) to change (increase) resolution of your boot loader. Use one of classic (4:3 rate):
- GRUB_GFXMODE=640x480 (is used if isn't here a proper value)
- GRUB_GFXMODE=800x600
- GRUB_GFXMODE=1024x768
- GRUB_GFXMODE=1600×1200
-
or make experiments with some others nonstandards like widescreen (16:10 ratio in my case), here is list of most of commonly use Display resolution:
- GRUB_GFXMODE=640x400
- GRUB_GFXMODE=800x500
- GRUB_GFXMODE=1024x640
- GRUB_GFXMODE=1280x800
- GRUB_GFXMODE=1680x1050
- If you don't know what modes are supported by your graphics card, go to the grub command line and run 'vbeinfo'. It will list all available modes. (You might need to run 'insmod vbe' first if the vbe module isn't loaded yet)
-
Uncomment (remove '#' from beginning of the line) to change (increase) resolution of your boot loader. Use one of classic (4:3 rate):
-
GRUB_GFXPAYLOAD_LINUX=640x480x8 [grub2 >= 1.98-1 (Lucid)]
- Use this setting to set the framebuffer resolution (replaces the vga= kernel option). It uses the GFXMODE values with additional color depth. Use 'vbeinfo' from the grub command line to list what modes are available to you.
-
#GRUB_DISABLE_LINUX_UUID=true
- Uncomment this line if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux.
-
GRUB_DISABLE_LINUX_RECOVERY=true
- Add or uncomment this line to prevent "Recovery" mode kernel options from appearing in the menu.
-
GRUB_DISABLE_OS_PROBER=true
- Enables/disables the os-prober check of other partitions for operating systems, including Windows, Linux, OSX and Hurd.
发表评论
-
Ubuntu ISO镜像升级
2009-11-01 09:53 7121、下载Ubuntu alt ... -
Ubuntu9.10 更新源
2009-11-21 20:31 629网易163的更新源 deb ... -
Ubuntu终端汉字的显示
2009-12-18 18:17 1350Ubuntu 终端字体不能显 ... -
非常棒的几款Ubuntu主题
2009-12-18 22:50 830这几款漂亮的主题在网上流传很久了,它们都出自Zgegblog作 ... -
ubuntu 开机自动开启数字小键盘
2009-12-19 11:49 732首先,需 ... -
U盘装Linux(Ubuntu)
2010-04-06 16:03 888把U盘刻成光盘(以ubuntu9.10为例) 前提:电脑支持U ... -
Ubuntu 10.04 (Lucid) 更新源
2010-04-10 22:02 721deb http://mirror.lupaworld.co ... -
轻松安装卸载Linux软件
2010-06-08 09:00 705在Windows下安装 ... -
Ubuntu 10.04(Lucid) 教育网更新源
2010-06-12 22:52 737电子科技大学源(校园网推荐,快)deb http://ubun ... -
超实用的Linux/Unix快捷键大汇总
2010-07-12 12:55 652下述所有命令在Linux/unix的shell下有效,這里以b ... -
How to Chang the root Password
2010-07-25 14:17 624As default Ubuntu has no passwo ... -
Ubuntu 10.04(Lucid) ipv6 更新源
2010-07-29 18:23 714deb http://mirror.switch.c ... -
Linux Change or Rename User Name and UID
2010-08-10 07:25 781Q. How do I change user name (r ... -
How to: Change Hostname
2010-08-18 16:20 626Environment:Ubuntu 10.04(Lucid) ... -
Linux find命令詳解
2010-09-04 14:29 684由于find具有強大的功能,所以它的選項也很多,其中大部分選項 ... -
How to add a user to the sudoers list
2010-09-11 20:54 760How to add a user to the sudoer ... -
Fedora Kernel Headers的安装
2010-09-11 21:07 2892想尝试一下KDE桌面,可是有不想再已有的Ubuntu上安装,于 ... -
Linux ssh安全设置
2010-09-28 21:55 789SSH服务器配置文件是/etc/ssh/sshd_conf。在 ... -
Linux Command
2010-11-20 13:56 1020Linux文件管理命令 1 l ...
相关推荐
GRUB2的配置文件主要位于`/etc/default/grub`,在这里可以设置启动菜单的选项,比如默认操作系统、启动参数等。修改完配置文件后,需要使用`grub2-mkconfig`命令生成新的GRUB配置,然后用`grub2-install`命令将GRUB...
GRUB2(GRand Unified Bootloader 2)是Linux系统中的主流引导加载器,用于管理多重引导,即在一台计算机上安装和启动多个操作系统。这个"grub2多重引导示例镜像"是一个64Mb的磁盘镜像文件,其中包含了GRUB2配置和...
**Grub修改Ubuntu启动项详解** 在早期的Ubuntu版本中,Grub(GRand Unified Bootloader)作为系统启动引导程序,用户可以通过简单的编辑 `/boot/grub/menu.lst` 文件来定制启动选项。然而,随着Grub的升级到Grub 2...
GRUB2(GRand Unified Bootloader 2)是Linux系统中的引导加载器,负责在操作系统启动时选择要加载的内核。它提供了丰富的自定义功能,包括改变开机背景和字体等,以提升用户体验。本话题将详细介绍如何在GRUB2中...
在配置GRUB2时,可能需要了解一些常见的配置命令,例如设置启动时的菜单显示时间(`GRUB_TIMEOUT`)、更改默认启动项(`GRUB_DEFAULT`)、设置启动命令行(`GRUB_CMDLINE_LINUX`)等。此外,GRUB2支持通过在启动时按...
标题中的“Grub_多系统引导”表明了我们要讨论的主题是GRUB(Grand Unified Bootloader)在处理多操作系统引导上的应用。GRUB是一款常见的开源引导加载器,它允许用户在计算机启动时选择要运行的操作系统,这对于有...
2. **默认引导项**:`default`指令指定默认启动的操作系统编号。 3. **隐藏时间**:`timeout`指令设置在启动菜单显示多久后自动选择默认项。 4. **启动菜单条目**:每个`menuentry`表示一个可选的启动项,包括操作...
GRUB2(GRand Unified Bootloader 2)是Linux系统中的多引导加载器,它允许用户在计算机上安装并切换不同的操作系统,如Windows和Linux。GRUB2的强大之处在于其高度可配置性,能帮助用户自定义启动菜单,提供个性化...
### Ubuntu 下修改 GRUB 引导(11.0 以上版本) 在 Ubuntu 系统中,GRUB(Grand Unified Bootloader)作为默认的启动管理器,在计算机启动过程中扮演着非常重要的角色。本文将详细介绍如何在 Ubuntu 11.0 及以上...
GRUB2是一种流行的引导加载程序,广泛用于Linux和其他类Unix系统中。它负责加载操作系统内核到内存中并启动系统。GRUB2相较于其前身GRUB,增加了很多新的特性和改进,提供了更为强大的配置选项和用户界面。 一、...
4. **配置GRUB**:创建或修改`grub.cfg`文件,列出所有要引导的操作系统及其对应的启动参数。 5. **重启并测试**:保存配置后,重启电脑,GRUB应该会显示启动菜单,让你选择要启动的操作系统。 **高级特性:** ...
2. 安装GRUB:在安装Linux的过程中,引导安装程序会自动检测到其他操作系统,并在GRUB配置中添加相应的引导项。 3. 更新GRUB:安装完成后,运行`sudo update-grub`命令,GRUB会扫描所有可用的系统并更新配置。 4. ...
GRUB2 for DOS是一款在DOS环境下使用的GRUB2引导加载器,主要目的是为了帮助用户在计算机上安装和管理Linux与Windows双系统。GRUB2是Grand Unified Bootloader的第二代版本,它提供了比其前辈GRUB更强大的功能和更...
标题 "0050Grub_多系统引导.zip" 暗示了这个压缩包包含的是关于GRUB(Grand Unified Bootloader)多系统引导的教程或资料。GRUB是一款广泛使用的开源多操作系统启动加载器,它允许用户在计算机启动时选择要运行的...
Grub2(GRand Unified Bootloader 2)是Linux系统中的一个引导加载器,它负责在计算机启动时加载操作系统内核。Grub2取代了早期的Grub,提供了更多功能和改进,使得系统引导更加灵活和可定制。 ### 一、Grub2新特性...
2. **引导顺序**:Windows的启动管理器默认优先级可能会高于GRUB,需要在BIOS设置中调整启动设备顺序,确保GRUB先于Windows Boot Manager加载。 3. **错误消息**:遇到错误消息如“GRUB rescue”时,通常需要通过...
GRUB2相较于其前身GRUB1,提供了更多的功能和改进,使得系统引导更加灵活和可定制化。由于GRUB2的复杂性和不断发展,掌握其高级特性对系统管理员和开发者来说至关重要。 **1. 多阶段引导** GRUB2采用多阶段引导机制...
在配置文件中可以设置各种启动参数和菜单项,例如默认引导的操作系统、超时时间、内核参数等。 Grub2的新特性还包括支持rescue模式,该模式可以在系统无法引导时提供帮助。此外,它还支持多种文件系统格式,可以...