Notice: 修改完 /etc/default/grub ,需要执行 sudo update-grub 生成 /boot/grub/grub.cfg, 重启后生效 加五角星标注为平常修改的选项, 其他除特殊用途基本不需要修改 ,//后面的为注释: #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 // ★ 设定图形介面分辨率,如不使用默认,把前面 # 去掉,分辨率按需修改 # Uncomment if you don't want GRUB to pass root=UUID=xxx parameter to Linux #GRUB_DISABLE_LINUX_UUID=true // 设置 grub 命令是否使用 UUID ,去掉 # ,使用 root=/dev/sdax 而不用 root=UUDI=xxx # Uncomment to disable generation of recovery mode menu entries #GRUB_DISABLE_RECOVERY=true // 设定是否创建修复模式菜单项 # Uncomment to get a beep at grub start #GRUB_INIT_TUNE=480 440 1
这个问题是之前遇到并解决过的,不过上次是想把默认启动项从ubuntu改为win7,这次是想改回来,所以写篇博文记录一下。 我的系统是ubuntu14.04,所以使用的是grub2(GRand Unified Bootloader)引导。 首先, 进入 /boot/grub 目录 cd /boot/grub/ 打开文件 grub.cfg ,该文件是自动生成的,并且在文件的开头有: # # DO NOT EDIT THIS FILE # # It is automatically generated by grub-mkconfig using templates # from /etc/grub.d and settings from /etc/default/grub # 这就提示我们不要去修改这个文件,如果修改的后果可能就是无法启动系统了。顺便提一句,如果引导无法启动,可以使用ubuntu下的boot repair工具去修复,具体方法google吧。 下面介绍一种简单的修改方法,进入目录 cd /etc/default/ 使用root权限打开 grub 文件,我们可以看到下面的内容: # If you change this file, run 'update-grub' afterwards to update # /boot/grub/grub.cfg. # For full documentation of the options in this file, see: # info -f grub -n 'Simple configuration' GRUB_DEFAULT=4 #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= GRUB_DEFAULT 对应的值如果是0,对应的就是开机启动后引导界面中最上面的那个选项,1对应的是第二个选项,依次类推......在我的系统中win7选项排在第五个位置,所以对应的值是4,如果要改为默认ubuntu启动,只需将4改为0。 然后我们需要输入以下的命令对grub进行更新: sudo update-grub 然后重启系统即可。 当然,在linux中通常解决方法不止一种,还有其他的解决方法,百度应该可以找到。 参考链接 https://help.ubuntu.com/community/Grub2