我在 MSI GE60 笔记本电脑上安装了 Windows 8.1;然后使用 GParted 对其进行分区(调整 NTFS 分区的大小)并在我创建的可用空间 /dev/sda8 中安装了 Ubuntu 14.04.1 LTS。
当我登录 Ubuntu 后运行 bootinfoscript 时,输出如下所示(见下文,请原谅我剪切粘贴得比较长)。我遇到的问题是,我没有 grub 启动菜单,无法选择启动哪个操作系统(我以前在旧笔记本电脑上可以毫不费力地使用 8.04 Hardy Heron 和 10.04 来完成此操作)。默认情况下,它会启动到 Ubuntu。我能够启动到 Windows 的唯一方法是,当 MSI 徽标出现时按下删除键,进入 BIOS,然后将选项的值Boot Mode Select
从更改Legacy
为UEFI
。
如果有人有任何想法或建议可以帮助我获得 grub 启动菜单选项,它将为我提供两个操作系统的启动选择,这样我就不必每次想在 Windows 中工作时都进入 BIOS,我将不胜感激。
提前感谢您的时间和想法。
/etc/default/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=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 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
# 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_RECOVERY="true"
# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"
我的 bootinfoscript RESULTS.txt 输出:
Boot Info Script 0.61 [1 April 2012]
============================= Boot Info Summary: ===============================
=> Grub2 (v1.99) is installed in the MBR of /dev/sda and looks at sector
1563601216 of the same hard drive for core.img. core.img is at this
location and looks in partition 112 for .
sda1: __________________________________________________________________________
File system: ntfs
Boot sector type: Windows Vista/7: NTFS
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files:
sda2: __________________________________________________________________________
File system: vfat
Boot sector type: Unknown
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files: /efi/Boot/bootx64.efi
sda3: __________________________________________________________________________
File system:
Boot sector type: -
Boot sector info:
Mounting failed: mount: unknown filesystem type ''
sda4: __________________________________________________________________________
File system: ntfs
Boot sector type: Windows Vista/7: NTFS
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files: /bootmgr /Windows/System32/winload.exe
sda5: __________________________________________________________________________
File system: ntfs
Boot sector type: Windows Vista/7: NTFS
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files:
sda6: __________________________________________________________________________
File system: ntfs
Boot sector type: Windows Vista/7: NTFS
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files:
sda7: __________________________________________________________________________
File system: swap
Boot sector type: -
Boot sector info:
sda8: __________________________________________________________________________
File system: ext3
Boot sector type: -
Boot sector info:
Operating System: Ubuntu 14.04.1 LTS
Boot files: /boot/grub/grub.cfg /etc/fstab
============================ Drive/Partition Info: =============================
Drive: sda _____________________________________________________________________
Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
Partition Boot Start Sector End Sector # of Sectors Id System
/dev/sda1 1 1,953,525,167 1,953,525,167 ee GPT
GUID Partition Table detected.
Partition Start Sector End Sector # of Sectors System
/dev/sda1 2,048 1,230,847 1,228,800 Windows Recovery Environment (Windows)
/dev/sda2 1,230,848 1,845,247 614,400 EFI System partition
/dev/sda3 1,845,248 2,107,391 262,144 Microsoft Reserved Partition (Windows)
/dev/sda4 2,107,392 485,371,844 483,264,453 Data partition (Windows/Linux)
/dev/sda5 485,371,845 777,770,909 292,399,065 Data partition (Windows/Linux)
/dev/sda6 777,770,910 807,105,599 29,334,690 Windows Recovery Environment (Windows)
/dev/sda7 807,106,560 838,746,111 31,639,552 Swap partition (Linux)
/dev/sda8 838,746,112 1,953,523,455 1,114,777,344 Data partition (Windows/Linux)
"blkid" output: ________________________________________________________________
Device UUID TYPE LABEL
/dev/sda1 AE0E04680E042BC1 ntfs WinRE tools
/dev/sda2 7406-CB53 vfat SYSTEM
/dev/sda4 96C60823C6080669 ntfs OS_Install
/dev/sda5 C80809AC08099B18 ntfs DATA
/dev/sda6 D60C0BD60C0BB113 ntfs BIOS_RVY
/dev/sda7 aa389ccf-6371-4229-b25c-9ffcbc08f58a swap
/dev/sda8 467dd323-cfdc-47e0-b151-f1abfaeca221 ext3
================================ Mount points: =================================
Device Mount_Point Type Options
/dev/sda8 / ext3 (rw,errors=remount-ro)
=========================== sda8/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
#
### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
set have_grubenv=true
load_env
fi
if [ "${next_entry}" ] ; then
set default="${next_entry}"
set next_entry=
save_env next_entry
set boot_once=true
else
set default="0"
fi
if [ x"${feature_menuentry_id}" = xy ]; then
menuentry_id_option="--id"
else
menuentry_id_option=""
fi
export menuentry_id_option
if [ "${prev_saved_entry}" ]; then
set saved_entry="${prev_saved_entry}"
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi
function savedefault {
if [ -z "${boot_once}" ]; then
saved_entry="${chosen}"
save_env saved_entry
fi
}
function recordfail {
set recordfail=1
if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
}
function load_video {
if [ x$feature_all_video_module = xy ]; then
insmod all_video
else
insmod efi_gop
insmod efi_uga
insmod ieee1275_fb
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
fi
}
if [ x$feature_default_font_path = xy ] ; then
font=unicode
else
insmod part_gpt
insmod ext2
set root='hd0,gpt8'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt8 --hint-efi=hd0,gpt8 --hint-baremetal=ahci0,gpt8 467dd323-cfdc-47e0-b151-f1abfaeca221
else
search --no-floppy --fs-uuid --set=root 467dd323-cfdc-47e0-b151-f1abfaeca221
fi
font="/usr/share/grub/unicode.pf2"
fi
if loadfont $font ; then
set gfxmode=auto
load_video
insmod gfxterm
set locale_dir=$prefix/locale
set lang=en_US
insmod gettext
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ] ; then
set timeout=-1
else
if [ x$feature_timeout_style = xy ] ; then
set timeout_style=hidden
set timeout=0
# Fallback hidden-timeout code in case the timeout_style feature is
# unavailable.
elif sleep --interruptible 0 ; then
set timeout=0
fi
fi
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
if background_color 44,0,30; then
clear
fi
### END /etc/grub.d/05_debian_theme ###
### BEGIN /etc/grub.d/10_linux ###
function gfxmode {
set gfxpayload="${1}"
if [ "${1}" = "keep" ]; then
set vt_handoff=vt.handoff=7
else
set vt_handoff=
fi
}
if [ "${recordfail}" != 1 ]; then
if [ -e ${prefix}/gfxblacklist.txt ]; then
if hwmatch ${prefix}/gfxblacklist.txt 3; then
if [ ${match} = 0 ]; then
set linux_gfx_mode=keep
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=keep
fi
else
set linux_gfx_mode=text
fi
export linux_gfx_mode
menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-467dd323-cfdc-47e0-b151-f1abfaeca221' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
insmod part_gpt
insmod ext2
set root='hd0,gpt8'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt8 --hint-efi=hd0,gpt8 --hint-baremetal=ahci0,gpt8 467dd323-cfdc-47e0-b151-f1abfaeca221
else
search --no-floppy --fs-uuid --set=root 467dd323-cfdc-47e0-b151-f1abfaeca221
fi
linux /boot/vmlinuz-3.13.0-32-generic root=UUID=467dd323-cfdc-47e0-b151-f1abfaeca221 ro quiet splash $vt_handoff
initrd /boot/initrd.img-3.13.0-32-generic
}
submenu 'Advanced options for Ubuntu' $menuentry_id_option 'gnulinux-advanced-467dd323-cfdc-47e0-b151-f1abfaeca221' {
menuentry 'Ubuntu, with Linux 3.13.0-32-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.13.0-32-generic-advanced-467dd323-cfdc-47e0-b151-f1abfaeca221' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
insmod part_gpt
insmod ext2
set root='hd0,gpt8'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt8 --hint-efi=hd0,gpt8 --hint-baremetal=ahci0,gpt8 467dd323-cfdc-47e0-b151-f1abfaeca221
else
search --no-floppy --fs-uuid --set=root 467dd323-cfdc-47e0-b151-f1abfaeca221
fi
echo 'Loading Linux 3.13.0-32-generic ...'
linux /boot/vmlinuz-3.13.0-32-generic root=UUID=467dd323-cfdc-47e0-b151-f1abfaeca221 ro quiet splash $vt_handoff
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-3.13.0-32-generic
}
menuentry 'Ubuntu, with Linux 3.13.0-32-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.13.0-32-generic-recovery-467dd323-cfdc-47e0-b151-f1abfaeca221' {
recordfail
load_video
insmod gzio
insmod part_gpt
insmod ext2
set root='hd0,gpt8'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt8 --hint-efi=hd0,gpt8 --hint-baremetal=ahci0,gpt8 467dd323-cfdc-47e0-b151-f1abfaeca221
else
search --no-floppy --fs-uuid --set=root 467dd323-cfdc-47e0-b151-f1abfaeca221
fi
echo 'Loading Linux 3.13.0-32-generic ...'
linux /boot/vmlinuz-3.13.0-32-generic root=UUID=467dd323-cfdc-47e0-b151-f1abfaeca221 ro recovery nomodeset
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-3.13.0-32-generic
}
}
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###
### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry 'Memory test (memtest86+)' {
insmod part_gpt
insmod ext2
set root='hd0,gpt8'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt8 --hint-efi=hd0,gpt8 --hint-baremetal=ahci0,gpt8 467dd323-cfdc-47e0-b151-f1abfaeca221
else
search --no-floppy --fs-uuid --set=root 467dd323-cfdc-47e0-b151-f1abfaeca221
fi
knetbsd /boot/memtest86+.elf
}
menuentry 'Memory test (memtest86+, serial console 115200)' {
insmod part_gpt
insmod ext2
set root='hd0,gpt8'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt8 --hint-efi=hd0,gpt8 --hint-baremetal=ahci0,gpt8 467dd323-cfdc-47e0-b151-f1abfaeca221
else
search --no-floppy --fs-uuid --set=root 467dd323-cfdc-47e0-b151-f1abfaeca221
fi
linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###
### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###
### BEGIN /etc/grub.d/30_uefi-firmware ###
### END /etc/grub.d/30_uefi-firmware ###
### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###
### BEGIN /etc/grub.d/41_custom ###
if [ -f ${config_directory}/custom.cfg ]; then
source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
--------------------------------------------------------------------------------
=============================== sda8/etc/fstab: ================================
--------------------------------------------------------------------------------
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda8 during installation
UUID=467dd323-cfdc-47e0-b151-f1abfaeca221 / ext3 errors=remount-ro 0 1
# swap was on /dev/sda7 during installation
UUID=aa389ccf-6371-4229-b25c-9ffcbc08f58a none swap sw 0 0
--------------------------------------------------------------------------------
=================== sda8: Location of files loaded by Grub: ====================
GiB - GB File Fragment(s)
======================== Unknown MBRs/Boot Sectors/etc: ========================
Unknown BootLoader on sda2
00000000 eb 58 90 4d 53 44 4f 53 35 2e 30 00 02 08 5e 1b |.X.MSDOS5.0...^.|
00000010 02 00 00 00 00 f8 00 00 3f 00 ff 00 00 c8 12 00 |........?.......|
00000020 00 60 09 00 51 02 00 00 00 00 00 00 02 00 00 00 |.`..Q...........|
00000030 01 00 06 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000040 80 00 29 53 cb 06 74 4e 4f 20 4e 41 4d 45 20 20 |..)S..tNO NAME |
00000050 20 20 46 41 54 33 32 20 20 20 33 c9 8e d1 bc f4 | FAT32 3.....|
00000060 7b 8e c1 8e d9 bd 00 7c 88 56 40 88 4e 02 8a 56 |{......|[email protected]|
00000070 40 b4 41 bb aa 55 cd 13 72 10 81 fb 55 aa 75 0a |@.A..U..r...U.u.|
00000080 f6 c1 01 74 05 fe 46 02 eb 2d 8a 56 40 b4 08 cd |...t..F..-.V@...|
00000090 13 73 05 b9 ff ff 8a f1 66 0f b6 c6 40 66 0f b6 |.s......f...@f..|
000000a0 d1 80 e2 3f f7 e2 86 cd c0 ed 06 41 66 0f b7 c9 |...?.......Af...|
000000b0 66 f7 e1 66 89 46 f8 83 7e 16 00 75 39 83 7e 2a |f..f.F..~..u9.~*|
000000c0 00 77 33 66 8b 46 1c 66 83 c0 0c bb 00 80 b9 01 |.w3f.F.f........|
000000d0 00 e8 2c 00 e9 a8 03 a1 f8 7d 80 c4 7c 8b f0 ac |..,......}..|...|
000000e0 84 c0 74 17 3c ff 74 09 b4 0e bb 07 00 cd 10 eb |..t.<.t.........|
000000f0 ee a1 fa 7d eb e4 a1 7d 80 eb df 98 cd 16 cd 19 |...}...}........|
00000100 66 60 80 7e 02 00 0f 84 20 00 66 6a 00 66 50 06 |f`.~.... .fj.fP.|
00000110 53 66 68 10 00 01 00 b4 42 8a 56 40 8b f4 cd 13 |Sfh.....B.V@....|
00000120 66 58 66 58 66 58 66 58 eb 33 66 3b 46 f8 72 03 |fXfXfXfX.3f;F.r.|
00000130 f9 eb 2a 66 33 d2 66 0f b7 4e 18 66 f7 f1 fe c2 |..*f3.f..N.f....|
00000140 8a ca 66 8b d0 66 c1 ea 10 f7 76 1a 86 d6 8a 56 |..f..f....v....V|
00000150 40 8a e8 c0 e4 06 0a cc b8 01 02 cd 13 66 61 0f |@............fa.|
00000160 82 74 ff 81 c3 00 02 66 40 49 75 94 c3 42 4f 4f |[email protected]|
00000170 54 4d 47 52 20 20 20 20 00 00 00 00 00 00 00 00 |TMGR ........|
00000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
000001a0 00 00 00 00 00 00 00 00 00 00 00 00 0d 0a 44 69 |..............Di|
000001b0 73 6b 20 65 72 72 6f 72 ff 0d 0a 50 72 65 73 73 |sk error...Press|
000001c0 20 61 6e 79 20 6b 65 79 20 74 6f 20 72 65 73 74 | any key to rest|
000001d0 61 72 74 0d 0a 00 00 00 00 00 00 00 00 00 00 00 |art.............|
000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000001f0 00 00 00 00 00 00 00 00 ac 01 b9 01 00 00 55 aa |..............U.|
00000200
=============================== StdErr Messages: ===============================
cat: /tmp/BootInfo-Wx1Jigrb/Tmp_Log: No such file or directory
编辑:
在注释 amantethy 建议的几行之后,执行 sudo update-grub 的结果如下:
$ sudo update-grub
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.13.0-32-generic
Found initrd image: /boot/initrd.img-3.13.0-32-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
done
答案1
答案是可以找到的这里。您的 GRUB 设置为在启动时隐藏操作系统选择菜单。
基本上,您需要做的是进行以下更改:
- 在两个“隐藏”行前添加#。
打开终端(ctrl+alt+t
),然后输入以下命令:sudo nano /etc/default/grub
。编辑文件以便:
GRUB_HIDDEN_TIMEOUT=0 GRUB_HIDDEN_TIMEOUT_QUIET=true
变成
#GRUB_HIDDEN_TIMEOUT=0
#GRUB_HIDDEN_TIMEOUT_QUIET=true
保存文件(ctrl+x
然后y
保存)然后运行sudo update-grub
。
当您重新启动时,您应该会看到操作系统选择菜单。
答案2
Shift
您可以在系统启动时按下 键来获取 GRUB 菜单。
答案3
我尝试了@oldfred 的建议:
您的 Windows 安装在 UEFI 启动模式下,而 Ubuntu 安装在 BIOS 启动模式下。这两种模式不兼容,您只能从 UEFI/BIOS 菜单进行双启动,并且可能必须打开或关闭 UEFI 或 BIOS 启动设置。Grub 只能在与您启动 grub 相同的启动模式下双启动其他安装。如果驱动器是 gpt 分区,您可以使用 Boot-Repair 将 Ubuntu 的 BIOS 安装转换为 UEFI,如果驱动器处于 UEFI 模式,Windows 需要 gpt 分区
但这可能不起作用,因为启动修复不是针对 14.04.1 LTS 的最新版本(最后出现了一些错误)。所以我最终做了以下事情:
格式化包含 14.04.1 LTS 的分区,然后从 BIOS 重启后重新安装,这次保持 UEFI 模式处于活动状态并禁用快速启动。此操作没有任何问题,并且从一开始就提供了双启动选项。