在用GRUB2安装manjaro linux之后,我格式化了SSD并安装了Windows7。在GRUB2中没有Windows7子菜单。所以我被执行了update-grub
,它没有返回错误,但是没有找到Windows7,所以我通过编辑添加了它/etc/grub.d/40_custom
:
#!/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.
submenu "Windows 7" {
regexp -s root '\((.+)\)' "$cmdpath"
chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}
如何在grub中添加Windows7?我的磁盘分区为:
NAME FSTYPE LABEL UUID MOUNTPOINT
sda
├─sda1 ntfs System Reserved 6874CCE474CCB65A
├─sda2 ntfs 34F0E721F0E6E7D6
├─sda3 vfat 52FA-B552 /boot/efi
└─sda4 ext4 da2e349a-50aa-4bda-9770-32d431bb0881 /
sdb
├─sdb1 ntfs My Files F26C58206C57DDC3
├─sdb2 ntfs Windows Programs 0EBA345BBA34418F
└─sdb3 ext4 a6064200-2841-4f0b-8c69-7fbe41993fd4 /home
sda1和sda2由Windows7安装程序自动创建。我猜sda1是Windows引导程序,并且在sda2上安装了Windows
>>> sudo mount /dev/sda1 /mnt
>>> ls /mnt
Boot bootmgr BOOTSECT.BAK 'System Volume Information'
>>> sudo mount /dev/sda2 /mnt
>>> ls /mnt
Boot 'Documents and Settings' Portable 'Program Files (x86)' Users
bootmgr pagefile.sys ProgramData '$Recycle.Bin' Windows
BOOTSECT.BAK PerfLogs 'Program Files' 'System Volume Information'
hd0的分区是mbr,不是gpt。我用正确的分区类型重新安装了两个操作系统,这解决了问题
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句