我有一个Windows 7/11.10双引导系统,使用Grub 2作为默认的引导程序。然而,我想将Windows引导程序设置为默认(Grub的“dos”界面让我妹妹害怕得要命),这样当我启动电脑时会有以下引导选项: 1. Windows 7 2. Ubuntu
注意:如果能提供一个反向操作的过程,使Grub再次成为默认的引导程序,将会很感激。
我有一个Windows 7/11.10双引导系统,使用Grub 2作为默认的引导程序。然而,我想将Windows引导程序设置为默认(Grub的“dos”界面让我妹妹害怕得要命),这样当我启动电脑时会有以下引导选项: 1. Windows 7 2. Ubuntu
注意:如果能提供一个反向操作的过程,使Grub再次成为默认的引导程序,将会很感激。
sudo gedit /etc/default/grub
GRUB_DEFAULT=2
sudo update-grub
bcdedit
。 - Frank Nsudo update-grub
sudo gedit /etc/default/grub
GRUB_DEFAULT=”Windows 7 (loader) on /dev/sda1″
警告:仅仅设置'GRUB_DEFAULT=n',在内核更新后等情况下无法生效。
(保存文件并关闭。)
C. 更新 grub 设置
sudo update-grub
现在,启动时将自动默认为MS Windows。
第2部分:(可选项)
隐藏Grub2菜单,并使用默认菜单选项。
描述:这将同时隐藏启动菜单并缩短(通常为10秒的)超时时间。计算机将在启动时自动启动默认选项。
注意:用户只需按住Shift键(在启动时)即可再次看到Grub2菜单。
步骤:
D. 编辑设置文件
sudo gedit /etc/default/grub
GRUB_HIDDEN_TIMEOUT=0
sudo update-grub
Ubuntu
,否则GRUB2根本不会运行。 - Eliah KaganGrub2可以被设置为默认启动任何系统,但要更改它们出现的顺序将会很困难。
也可以隐藏grub引导菜单(针对您的姐妹),只需按下shift键即可显示。我建议在此处谨慎。详情请参见此处。
有两种方法可以使用编辑grub文件来设置默认启动。
这些方法在Ubuntu Communuity Documentation Grub2 page中有描述。
这两种方法是:
启动上次启动的任何操作系统,“保存的方法”
这是我使用的方法。它让我决定我要使用哪个系统,并允许我重新启动到该系统,当我正在更新时非常方便。
默认启动特定的操作系统,这就是您确切的问题
user@YourComputer:~$ grep menuentry /boot/grub/grub.cfg
menuentry 'Ubuntu, with Linux 2.6.35-31-generic' --class ubuntu --class gnu-linux --class gnu --class os {
menuentry 'Ubuntu, with Linux 2.6.35-31-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
menuentry 'Ubuntu, with Linux 2.6.35-30-generic' --class ubuntu --class gnu-linux --class gnu --class os {
menuentry 'Ubuntu, with Linux 2.6.35-30-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
menuentry "Memory test (memtest86+)" {
menuentry "Memory test (memtest86+, serial console 115200)" {
menuentry "Windows NT/2000/XP (loader) (on /dev/sda1)" {
menuentry "Ubuntu, with Linux 2.6.32-34-generic (on /dev/sdb1)" {
menuentry "Ubuntu, with Linux 2.6.32-34-generic (recovery mode) (on /dev/sdb1)" {
menuentry "Ubuntu, with Linux 2.6.32-33-generic (on /dev/sdb1)" {
menuentry "Ubuntu, with Linux 2.6.32-33-generic (recovery mode) (on /dev/sdb1)" {
menuentry "Windows Vista (loader) (on /dev/sdc1)" {
user@YourComputer:~$ sudo nano -B /etc/default/grub
然后nano编辑器将会打开,这样(对于我来说)...
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
GRUB_DEFAULT=saved
#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_DEFAULT="delayacct"
GRUB_CMDLINE_LINUX=""
# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"
# 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
GRUB_GFXMODE=1280x800
GRUB_GFXPAYLOAD_LINUX=1280x800x8
# 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 entries
#GRUB_DISABLE_LINUX_RECOVERY="true"
# Uncomment to get a beep at grub start
GRUB_INIT_TUNE="480 440 1"
GRUB_SAVEDEFAULT=true
GRUB_BACKGROUND=/usr/share/images/grub/Apollo_17_The_Last_Moon_Shot_Edit1.tga
重要的最后一步
现在您需要运行update-grub命令来更新/boot/grub目录中系统生成的grub.cfg文件。
在计算机上输入sudo update-grub,如果需要,输入密码...
user@YourComputer:~$ sudo update-grub
Generating grub.cfg ...
Found background: /usr/share/images/grub/Apollo_17_The_Last_Moon_Shot_Edit1.tga
Found linux image: /boot/vmlinuz-2.6.35-31-generic
Found initrd image: /boot/initrd.img-2.6.35-31-generic
Found linux image: /boot/vmlinuz-2.6.35-30-generic
Found initrd image: /boot/initrd.img-2.6.35-30-generic
Found memtest86+ image: /boot/memtest86+.bin
Found Windows NT/2000/XP (loader) on /dev/sda1
Found Ubuntu 10.04.3 LTS (10.04) on /dev/sdb1
Found Windows Vista (loader) on /dev/sdc1
done
关于nano的注意事项
nano在终端中使用非常简单。使用箭头键进行移动。输入你的添加内容,删除不需要的内容。
"-B"(或"--backup")选项会将之前的版本备份为当前文件名加上~后缀。在遇到可怕的误触效应时非常方便。
编辑完成后,按下Crtl-O可以保存你的修改,按下Enter。 关闭而不保存,按下Ctrl-X。 这些和其他选项都显示在终端屏幕底部,^表示Ctrl
^G Get Help ^O WriteOut ^R Read File ^Y Prev Page ^K Cut Text ^C Cur Pos
^X Exit ^J Justify ^W Where Is ^V Next Page ^U UnCut Text ^T To Spell
bootrec /fixmbr
。bootrec /fixboot
。
fixmbr
和fixboot
命令。 - Anonymous