grub无法引导win7

启动讨论 grub/grub2/syslinux/grub4dos/Lilo
回复
leehb
帖子: 6
注册时间: 2017-07-06 15:17
系统: Debian 8

grub无法引导win7

#1

帖子 leehb » 2017-07-06 15:49

笔记本是双硬盘,win7装在固态硬盘上,机械硬盘分出了一部分安装Debian8,前一阵Debian除了故障重装,装完后启动项没有win7了,利用grub修复也没有解决,求助各位大神:
我的win7是mbr安装,Debian是UEFI安装,
下面是我的/boot/grub/grub.cfg:

============================= sda7/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 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,gpt3'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt3 --hint-efi=hd0,gpt3 --hint-baremetal=ahci0,gpt3 82d7d012-58c2-4ccf-ada1-b1fe3a732453
else
search --no-floppy --fs-uuid --set=root 82d7d012-58c2-4ccf-ada1-b1fe3a732453
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=zh_CN
insmod gettext
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ] ; then
set timeout=-1
else
if [ x$feature_timeout_style = xy ] ; then
set timeout_style=menu
set timeout=5
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
set timeout=5
fi
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
insmod part_gpt
insmod ext2
set root='hd0,gpt3'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt3 --hint-efi=hd0,gpt3 --hint-baremetal=ahci0,gpt3 82d7d012-58c2-4ccf-ada1-b1fe3a732453
else
search --no-floppy --fs-uuid --set=root 82d7d012-58c2-4ccf-ada1-b1fe3a732453
fi
insmod png
if background_image /usr/share/images/desktop-base/lines-grub.png; then
set color_normal=white/black
set color_highlight=black/white
else
set menu_color_normal=cyan/blue
set menu_color_highlight=white/blue
fi
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
function gfxmode {
set gfxpayload="${1}"
}
set linux_gfx_mode=
export linux_gfx_mode
menuentry 'Debian GNU/Linux' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-82d7d012-58c2-4ccf-ada1-b1fe3a732453' {
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
set root='hd0,gpt7'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt7 --hint-efi=hd0,gpt7 --hint-baremetal=ahci0,gpt7 06f48d35-38c4-4cc8-a202-92fc4be7f408
else
search --no-floppy --fs-uuid --set=root 06f48d35-38c4-4cc8-a202-92fc4be7f408
fi
echo '载入 Linux 3.16.0-4-amd64 ...'
linux /vmlinuz-3.16.0-4-amd64 root=UUID=82d7d012-58c2-4ccf-ada1-b1fe3a732453 ro quiet
echo '载入初始化内存盘...'
initrd /initrd.img-3.16.0-4-amd64
}
submenu 'Advanced options for Debian GNU/Linux' $menuentry_id_option 'gnulinux-advanced-82d7d012-58c2-4ccf-ada1-b1fe3a732453' {
menuentry 'Debian GNU/Linux,Linux 3.16.0-4-amd64' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.16.0-4-amd64-advanced-82d7d012-58c2-4ccf-ada1-b1fe3a732453' {
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
set root='hd0,gpt7'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt7 --hint-efi=hd0,gpt7 --hint-baremetal=ahci0,gpt7 06f48d35-38c4-4cc8-a202-92fc4be7f408
else
search --no-floppy --fs-uuid --set=root 06f48d35-38c4-4cc8-a202-92fc4be7f408
fi
echo '载入 Linux 3.16.0-4-amd64 ...'
linux /vmlinuz-3.16.0-4-amd64 root=UUID=82d7d012-58c2-4ccf-ada1-b1fe3a732453 ro quiet
echo '载入初始化内存盘...'
initrd /initrd.img-3.16.0-4-amd64
}
menuentry 'Debian GNU/Linux, with Linux 3.16.0-4-amd64 (recovery mode)' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.16.0-4-amd64-recovery-82d7d012-58c2-4ccf-ada1-b1fe3a732453' {
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
set root='hd0,gpt7'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt7 --hint-efi=hd0,gpt7 --hint-baremetal=ahci0,gpt7 06f48d35-38c4-4cc8-a202-92fc4be7f408
else
search --no-floppy --fs-uuid --set=root 06f48d35-38c4-4cc8-a202-92fc4be7f408
fi
echo '载入 Linux 3.16.0-4-amd64 ...'
linux /vmlinuz-3.16.0-4-amd64 root=UUID=82d7d012-58c2-4ccf-ada1-b1fe3a732453 ro single
echo '载入初始化内存盘...'
initrd /initrd.img-3.16.0-4-amd64
}
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###

### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/30_uefi-firmware ###
menuentry 'System setup' $menuentry_id_option 'uefi-firmware' {
fwsetup
}
### 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 ###
--------------------------------------------------------------

我按照网上说的办法在### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###之间添加了win7的启动项之后,然后运行update-grub,显示下面的结果:

root@localhost:/boot/grub# update-grub
Generating grub configuration file ...
Found background image: /usr/share/images/desktop-base/desktop-grub.png
Found linux image: /boot/vmlinuz-3.16.0-4-amd64
Found initrd image: /boot/initrd.img-3.16.0-4-amd64
Adding boot menu entry for EFI firmware configuration
done
然后我再打开/boot/grub/grub.cfg查看,发现### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###之间的win7的启动项又消失了,之前的改动没有任何效果。

另外这一句:Adding boot menu entry for EFI firmware configuration 让我很奇怪,应该是grub.cfg里的

### BEGIN /etc/grub.d/30_uefi-firmware ###
menuentry 'System setup' $menuentry_id_option 'uefi-firmware' {
fwsetup
}
### END /etc/grub.d/30_uefi-firmware ###
这一段导致的,我发现这一句也是删除后再update-grub后又自动恢复。
我的开机启动界面差不多下面的样子:
1.Debian8
2.Debian8 ***mode
3.Setup
其中前两项都正常,第三项我点开后加载的是BIOS界面,我也感到很奇怪,这一项的出现应该跟上面提到的Adding boot menu entry for EFI firmware configuration有关。。
下面是我的电脑的信息:

求助各位大神 :Adore

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
764458024 of the same hard drive for core.img, but core.img can not be
found at this location.
=> Grub2 (v1.99) is installed in the MBR of /dev/sdb and looks at sector 1 of
the same hard drive for core.img. core.img is at this location and looks
in partition 135 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: ntfs
Boot sector type: Windows Vista/7: NTFS
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files:

sda3: __________________________________________________________________________

File system: ext4
Boot sector type: -
Boot sector info:
Operating System: Debian GNU/Linux 8
Boot files: /etc/fstab

sda4: __________________________________________________________________________

File system: ext4
Boot sector type: -
Boot sector info:
Operating System:
Boot files:

sda5: __________________________________________________________________________

File system: ext4
Boot sector type: -
Boot sector info:
Operating System:
Boot files:

sda6: __________________________________________________________________________

File system: swap
Boot sector type: -
Boot sector info:

sda7: __________________________________________________________________________

File system: ext4
Boot sector type: -
Boot sector info:
Operating System:
Boot files: /grub/grub.cfg

sda8: __________________________________________________________________________

File system: vfat
Boot sector type: FAT32
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files:

sda9: __________________________________________________________________________

File system: ext4
Boot sector type: -
Boot sector info:
Operating System:
Boot files:

sdb1: __________________________________________________________________________

File system: ntfs
Boot sector type: Windows Vista/7: NTFS
Boot sector info: No errors found in the Boot Parameter Block.
Operating System: Windows 7
Boot files: /grldr /bootmgr /Boot/BCD
/Windows/System32/winload.exe /grldr

============================ Drive/Partition Info: =============================

Drive: sda _____________________________________________________________________

Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Partition Boot Start Sector End Sector # of Sectors Id System

/dev/sda1 1 976,773,167 976,773,167 ee GPT


GUID Partition Table detected.

Partition Start Sector End Sector # of Sectors System
/dev/sda1 66 314,834,986 314,834,921 Data partition (Windows/Linux)
/dev/sda2 314,834,987 629,407,786 314,572,800 Data partition (Windows/Linux)
/dev/sda3 629,409,792 736,829,439 107,419,648 Data partition (Linux)
/dev/sda4 736,829,440 742,688,767 5,859,328 Data partition (Linux)
/dev/sda5 742,688,768 756,361,215 13,672,448 Data partition (Linux)
/dev/sda6 756,361,216 764,174,335 7,813,120 Swap partition (Linux)
/dev/sda7 764,174,336 766,128,127 1,953,792 Data partition (Linux)
/dev/sda8 766,128,128 770,033,663 3,905,536 EFI System partition
/dev/sda9 770,033,664 976,771,071 206,737,408 Data partition (Linux)

Drive: sdb _____________________________________________________________________

Disk /dev/sdb: 119.2 GiB, 128035676160 bytes, 250069680 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Partition Boot Start Sector End Sector # of Sectors Id System

/dev/sdb1 * 63 250,067,789 250,067,727 7 NTFS / exFAT / HPFS


"blkid" output: ________________________________________________________________

Device UUID TYPE LABEL

/dev/sda1 000EF40800028FBE ntfs 文档
/dev/sda2 CCC0D172C0D1636E ntfs 娱乐
/dev/sda3 82d7d012-58c2-4ccf-ada1-b1fe3a732453 ext4
/dev/sda4 a58acc41-e7d9-429f-9bca-9376b27eea37 ext4
/dev/sda5 0b504b34-ef21-4962-a8e2-158991624280 ext4
/dev/sda6 3e0ad058-447a-429b-abd2-2293e5588178 swap
/dev/sda7 06f48d35-38c4-4cc8-a202-92fc4be7f408 ext4
/dev/sda8 C40C-6DCE vfat
/dev/sda9 2f935ce0-12fa-4971-ae33-75e8d9b4f7c8 ext4
/dev/sdb1 6E0E36220E35E3AD ntfs Win7

================================ Mount points: =================================

Device Mount_Point Type Options

/dev/sda3 / ext4 (rw,relatime,errors=remount-ro,data=ordered)
/dev/sda4 /tmp ext4 (rw,relatime,data=ordered)
/dev/sda5 /var ext4 (rw,relatime,data=ordered)
/dev/sda7 /boot ext4 (rw,relatime,data=ordered)
/dev/sda8 /boot/efi vfat (rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=utf8,shortname=mixed,errors=remount-ro)
/dev/sda9 /home ext4 (rw,relatime,data=ordered)
/dev/sdb1 /media/lee/Win7 fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096,uhelper=udisks2)


=============================== sda3/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/sda3 during installation
UUID=82d7d012-58c2-4ccf-ada1-b1fe3a732453 / ext4 errors=remount-ro 0 1
# /boot was on /dev/sda7 during installation
UUID=06f48d35-38c4-4cc8-a202-92fc4be7f408 /boot ext4 defaults 0 2
# /boot/efi was on /dev/sda8 during installation
UUID=C40C-6DCE /boot/efi vfat umask=0077 0 1
# /home was on /dev/sda9 during installation
UUID=2f935ce0-12fa-4971-ae33-75e8d9b4f7c8 /home ext4 defaults 0 2
# /tmp was on /dev/sda4 during installation
UUID=a58acc41-e7d9-429f-9bca-9376b27eea37 /tmp ext4 defaults 0 2
# /var was on /dev/sda5 during installation
UUID=0b504b34-ef21-4962-a8e2-158991624280 /var ext4 defaults 0 2
# swap was on /dev/sda6 during installation
UUID=3e0ad058-447a-429b-abd2-2293e5588178 none swap sw 0 0
--------------------------------------------------------------------------------

=================== sda3: Location of files loaded by Grub: ====================

GiB - GB File Fragment(s)
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: grub无法引导win7

#2

帖子 poloshiao » 2017-07-06 17:06

我的win7是mbr安装,Debian是UEFI安装
建議 Debian 也在 Legacy Bios (亦稱 MBR) 安裝
头像
TeliuTe
论坛版主
帖子: 7668
注册时间: 2007-11-25 13:29
系统: 16/18/20/w7
来自: 新疆博乐
联系:

Re: grub无法引导win7

#3

帖子 TeliuTe » 2017-07-06 21:02

开机f12(或其他)切换,或者统一引导方式
leehb
帖子: 6
注册时间: 2017-07-06 15:17
系统: Debian 8

Re: grub无法引导win7

#4

帖子 leehb » 2017-07-06 21:21

Debian系统已经用了很久了,不想在重装了,有没有好的解决办法
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: grub无法引导win7

#5

帖子 poloshiao » 2017-07-07 8:58

sda3/etc/fstab
# /etc/fstab: static file system information.
1. 在 /etc/fstab 沒有掛載 /dev/sdb1
Mount points:
Device Mount_Point Type Options
/dev/sdb1 /media/lee/Win7 fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096,uhelper=udisks2)
2. 所以 開機程序 沒有掛載 /dev/sdb1 開機登入 圖形界面後 才掛載成 移動裝置
3-1. 掛載成 移動裝置 在開機進程到登入 圖形界面 完成 以前 有許多 權限上的限制 會導致失敗
前一阵Debian除了故障重装,装完后启动项没有win7了,利用grub修复也没有解决,求助各位大神:
3. 試試 把 /dev/sdb1 掛載到 /etc/fstab 然後 重開機
3-1. ntfs 掛載在 /etc/fstab 注意掛載參數
https://wiki.debian.org/NTFS
ntfs-3g
/dev/sda1 /mnt/windows ntfs-3g rw,uid=1000,gid=1000,dmask=0002,fmask=0003 0 0
3-2. /mnt/windows 表示開機進程穩定掛載點 /media/lee/Win7 表示 移動裝置掛載點
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: grub无法引导win7

#6

帖子 poloshiao » 2017-07-07 11:13

Boot Info Script 0.61 [1 April 2012]
Debian是UEFI安装
我按照网上说的办法在### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###之间添加了win7的启动项之后,然后运行update-grub,显示下面的结果:
1. 在 UEFI 下安裝 grub 2 的套件 跟 在 Legacy Bios (或稱 MBR) 下安裝 grub 2 的套件 不同
1-1. 意思是 重新產生 grub 2 開機選單 (/boot/grub/grub.cfg) 指令 不是使用 update-grub 而是 使用 grub2-mkconfig
1-2. 參閱
24.5.4. Creating a Custom Menu
5. Rebuild the grub.cfg file by running the grub2-mkconfig -o command as follows:
On UEFI-based machines, issue the following command as root:

代码: 全选

sudo grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg
leehb
帖子: 6
注册时间: 2017-07-06 15:17
系统: Debian 8

Re: grub无法引导win7

#7

帖子 leehb » 2017-07-07 13:55

[quote]

2. 所以 開機程序 沒有掛載 /dev/sdb1 開機登入 圖形界面後 才掛載成 移動裝置
3-1. 掛載成 移動裝置 在開機進程到登入 圖形界面 完成 以前 有許多 權限上的限制 會導致失敗
[/quote

谢谢!我发现分区表是这样的,
———————————————————————————————————————————————————————————————————————————————
root@localhost:/home/lee# fdisk -l

Disk /dev/sdb: 119.2 GiB, 128035676160 bytes, 250069680 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xc0a5de19

Device Boot Start End Sectors Size Id Type
/dev/sdb1 * 63 250067789 250067727 119.2G 7 HPFS/NTFS/exFAT

Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 0B001353-5858-9090-8081-828310111213

Device Start End Sectors Size Type
/dev/sda1 66 314834986 314834921 150.1G Microsoft basic data
/dev/sda2 314834987 629407786 314572800 150G Microsoft basic data
/dev/sda3 629409792 736829439 107419648 51.2G Linux filesystem
/dev/sda4 736829440 742688767 5859328 2.8G Linux filesystem
/dev/sda5 742688768 756361215 13672448 6.5G Linux filesystem
/dev/sda6 756361216 764174335 7813120 3.7G Linux swap
/dev/sda7 764174336 766128127 1953792 954M Linux filesystem
/dev/sda8 766128128 770033663 3905536 1.9G EFI System
/dev/sda9 770033664 976771071 206737408 98.6G Linux filesystem

Partition 2 does not start on physical sector boundary.

Partition 3 does not start on physical sector boundary.
——————————————————————————————————————————————————————————————————————————————————

其中sda没有boot项,而sdb有,我怀疑是不是grub安装在了sdb上而把win7的引导信息给覆盖了,
我已经忘了装系统时grub装在哪个盘上了。。。
但是现在还没找到解决的办法,盼望指教。
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: grub无法引导win7

#8

帖子 poloshiao » 2017-07-07 17:42

其中sda没有boot项,而sdb有,我怀疑是不是grub安装在了sdb上而把win7的引导信息给覆盖了,
我已经忘了装系统时grub装在哪个盘上了。。。
1. 你是用 Legacy Bios (或稱 MBR) 的 開機引導 思維 看這個問題
1-1. 實際上 UEFI 的 開機引導 思維 是不同的
Disklabel type: gpt
2. UEFI 開機硬盤 必須是 gpt
/dev/sda8 766128128 770033663 3905536 1.9G EFI System
2-1. 該 gpt 硬盤 必須有一個分割區 稱為 efi system partition (簡稱 esp) fat32
2-2. 安裝 Debian 時 會把 debian 的 uefi 開機檔案 安裝在這個分割區 \EFI\debian\ 路徑內
2-3. 並且掛載為 /boot/efi (vfat)
2-4. 如果忘了掛載為 /boot/efi (vfat) 安裝程式 會自動幫你補上掛載
我怀疑是不是grub安装在了sdb上而把win7的引导信息给覆盖了
3. 如果安裝 Debian 時 你是選擇把 grub 2 開機導引 安裝在 /dev/sdb
那覆蓋掉 win 7 的 mbr 開機導引 是有可能的
3-1. 如果安裝 Debian 時 你是選擇把 grub 2 開機導引 安裝在 /dev/sda
就覆蓋不會發生

4. 還有疑問
請先把下面指令 複製 貼進終端機 執行
4-1. sudo efibootmgr -v
4-2. sudo ls -Al /boot/efi/EFI/debian/
4-3. sudo cat /boot/grub/grub.cfg | grep menuentry
4-4. sudo ls -al /dev/disk/by-uuid/*
4-5. sudo ls -al /dev/disk/by-partuuid/*
把結果全部直接 選取/複製/貼上來
leehb
帖子: 6
注册时间: 2017-07-06 15:17
系统: Debian 8

Re: grub无法引导win7

#9

帖子 leehb » 2017-07-08 18:14


2-1. 該 gpt 硬盤 必須有一個分割區 稱為 efi system partition (簡稱 esp) fat32
2-2. 安裝 Debian 時 會把 debian 的 uefi 開機檔案 安裝在這個分割區 \EFI\debian\ 路徑內
2-3. 並且掛載為 /boot/efi (vfat)
2-4. 如果忘了掛載為 /boot/efi (vfat) 安裝程式 會自動幫你補上掛載
谢谢!
我开机后用grub命令行操作显示如下结果:
_____________________________________________________________
>>ls
>>(hd0,gpt9),...(hd0,gpt1),(hd1)
>>ls -l
>>设备 hd0:no known filesystem detected-...
分区 hd0,gpt9:文件系统类型 ext*-...接着是一些信息
。。。
分区 hd0,gpt1:文件系统类型 ntfs-...接着是一些信息
设备 hd1:no known filesystem detected-...
_______________________________________________________________
我的疑问是:
1.为何grub没能检测到hd0的filesystem,但确能列出hd0的分区表的详细信息?
2.hd1的filesystem也没有被检测到,而且它的分区表也检测不到,会不会这便是grub无法引导win7的原因?
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: grub无法引导win7

#10

帖子 poloshiao » 2017-07-09 9:28

我的win7是mbr安装,Debian是UEFI安装
建議 Debian 也在 Legacy Bios (亦稱 MBR) 安裝
Debian系统已经用了很久了,不想在重装了,有没有好的解决办法
1. 既然你要維持使用 UEFI 請用 UEFI 思維
1-1. 請先參閱
https://wiki.debian.org/UEFI
UEFI
viewtopic.php?p=3193187#p3193187
4. 還有疑問
請先把下面指令 複製 貼進終端機 執行
4-1. sudo efibootmgr -v
4-2. sudo ls -Al /boot/efi/EFI/debian/
4-3. sudo cat /boot/grub/grub.cfg | grep menuentry
4-4. sudo ls -al /dev/disk/by-uuid/*
4-5. sudo ls -al /dev/disk/by-partuuid/*
把結果全部直接 選取/複製/貼上來
回复