我看见双启动 - 安装的 arch 和 windows 条目在 grub 上消失我有相同/类似的问题。我有 Grub,它只显示 Debian 设置,而不显示 MS-Windows。我也尝试了以下但没有成功 -
[$] sudo grub-install /dev/sda
[sudo] password for shirish:
Installing for i386-pc platform.
Installation finished. No error reported.
然后 -
[$] sudo grub-mkconfig -o /boot/grub/grub.cfg
Generating grub configuration file ...
Found background image: /usr/share/images/desktop-base/desktop-grub.png
D000001: cmpversions a='0:4.9.0-2-amd64' b='0:4.9.0-1-amd64' r=1
Found linux image: /boot/vmlinuz-4.9.0-2-amd64
Found initrd image: /boot/initrd.img-4.9.0-2-amd64
Found linux image: /boot/vmlinuz-4.9.0-1-amd64
Found initrd image: /boot/initrd.img-4.9.0-1-amd64
Found memtest86+ image: /boot/memtest86+.bin
Found memtest86+ multiboot image: /boot/memtest86+_multiboot.bin
Found GRUB Invaders image: /boot/invaders.exec
done
上面告诉我它无法找到 MS-Windows 分区。
parted -l
这是-的输出
l: ATA ST1000DM003-9YN1 (scsi)
Disk /dev/sda: 1000GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1 32.3kB 52.4GB 52.4GB primary ntfs
2 52.4GB 1000GB 948GB extended lba
5 52.4GB 105GB 52.4GB logical ntfs
6 105GB 305GB 200GB logical ext4 boot
7 305GB 405GB 100GB logical ext4
8 405GB 995GB 590GB logical ext4
9 995GB 1000GB 5348MB logical linux-swap(v1)
Model: Seagate BUP Slim BK (scsi)
Disk /dev/sdb: 2000GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1 1049kB 2000GB 2000GB primary ntfs
and then lsblk output -
[$] sudo lsblk -f
NAME FSTYPE LABEL UUID MOUNTPOINT
sda
├─sda1 ntfs WIN xxxxxxxxxxxxxxxxxxxx
├─sda2
├─sda5 ntfs Data xxxxxxxxxxxxxxxxxxxx
├─sda6 ext4 xxxxxxxxxxxxxxxxxxxx /
├─sda7 ext4 xxxxxxxxxxxxxxxxxxxx /home
├─sda8 ext4 xxxxxxxxxxxxxxxxxxxx/data
└─sda9 swap xxxxxxxxxxxxxxxxxxxx [SWAP]
sdb iso9660 ISOIMAGE 2015-06-04-16-30-00-00
└─sdb1 ntfs Seagate-Slim-Backup xxxxxxxxxxxxxxxxxxxx /media/shirish/Seagate-Slim-Backup
sr0
我还没有分享 UUID 信息。出于安全和隐私考虑。
我/boot/grub/grub.cfg
没有提到任何 MS-Windows
[$] cat
[$]
如何让 MS-Windows 再次出现在菜单上?
我什至尝试过 osprober 但无济于事:(
[$] cat /usr/share/doc/os-prober/README
我什至尝试过os-prober
自述文件 -
$ sudo cat /usr/share/doc/os-prober | grep
$
我什至尝试了自述文件,但没有成功,来自自述文件 0
Tests that require the partition to be mounted can be placed in
30 /usr/lib/os-probes/mounted/. These tests are passed the following
31 parameters: partition, mount point, filesystem.
$ sudo mount /dev/sda1 /usr/lib/os-probes/mounted/
并尝试过类似的事情 -
[$] sudo os-prober partition /dev/sda1 /usr/lib/os-probes/mounted/
[sudo] password for shirish:
[$]
然后我以 sudo 身份运行 os-prober -
[$] sudo os-prober
然后跑了——
┌─[shirish@debian] - [/boot] - [10119]
└─[$] sudo grub-mkconfig -o /boot/grub/grub.cfg
Generating grub configuration file ...
Found background image: /usr/share/images/desktop-base/desktop-grub.png
Found linux image: /boot/vmlinuz-4.9.0-2-amd64
Found initrd image: /boot/initrd.img-4.9.0-2-amd64
Found memtest86+ image: /boot/memtest86+.bin
Found memtest86+ multiboot image: /boot/memtest86+_multiboot.bin
Found GRUB Invaders image: /boot/invaders.exec
done
可以看出,它没有找到 MS-Windows 分区,它是永远丢失还是有出路?
遗憾的是不得不卸载它:(
[$] sudo umount /usr/lib/os-probes/mounted/
[$]
完全没有想法,看来 Windows 引导加载程序已经全部完成,否则我们应该有一些输出?
/etc/grub.d/40_custom
这是GAD3R分享后的样子——
#!/bin/sh
exec tail -n +3 $0
# 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.
menuentry "Windows" {
insmod part_msdos
insmod ntfs
set root='(hd0,msdos1)'
chainloader +1
}
在提出 GAD3R 的建议后,我得到 -
[$] cat /etc/default/grub | grep GRUB_DISABLE_OS_PROBER
11 GRUB_DISABLE_OS_PROBER=false
并运行 update-grub 我得到以下信息 -
[$] sudo update-grub
Generating grub configuration file ...
Found background image: /usr/share/images/desktop-base/desktop-grub.png
Found linux image: /boot/vmlinuz-4.9.0-2-amd64
Found initrd image: /boot/initrd.img-4.9.0-2-amd64
Found memtest86+ image: /boot/memtest86+.bin
Found memtest86+ multiboot image: /boot/memtest86+_multiboot.bin
Found GRUB Invaders image: /boot/invaders.exec
没有变化,所以仍然有问题:(
答案1
编辑你的/etc/grub.d/40_custom
如下:
menuentry "Windows" {
insmod part_msdos
insmod ntfs
set root='(hd0,msdos1)'
chainloader +1
}
将以下行添加到您的/etc/default/grub
:
GRUB_DISABLE_OS_PROBER=false
跑步:
update-grub