小智 7
是的,你会认为这样的事情会奏效:
menuentry "Boot Windoze" {
search -f "--set-root /Winblows.iso"
drivemap "/Winblows.iso" '(hd32)'
drivemap '--hook' ''
set root='(hd32)'
chainloader +1
}
Run Code Online (Sandbox Code Playgroud)
但 Windows 会对此犹豫不决。
如果您碰巧有至少 4GB 的 RAM,您可以选择在memdisk 中加载整个 DVD iso并启动它。为此,请下载SysLinux 并将memdisk
文件解压缩到您的boot
目录中。然后你需要像这样向 Grub2 添加代码
menuentry "Boot Windoze" {
search -f "--set-root /Winblows.iso"
insmod memdisk
linux16 /boot/memdisk iso
initrd16 /Winblows.iso
}
Run Code Online (Sandbox Code Playgroud)
但是,我什至不打算测试代码,因为将 3+ GB 的数据放入 RAM 是完全错误的(从理想的角度来看)。不,我真的想要你想要的东西,但最后我使用Windows 7 USB/DVD 下载工具将 Windows 安装放在 USB 上的一个分区上并链接到它。抱歉,我似乎没有任何其他方式可以看到。
使用 grub legacy 或 grub2 引导实际的 ISO 将不起作用,但使用较旧的 Windows 版本(即 XP)可以将 i386 文件夹从 ISO 解压缩到 U 盘,然后使用grub4dos调用引导加载程序:
title windows installer via setupldr.bin
find --set-root /i386/setupldr.bin
chainloader /i386/setupldr.bin
Run Code Online (Sandbox Code Playgroud)
或者
title windows installer via /bootsect.bin
find --set-root /i386/setupldr.bin
chainloader /bootsect.bin
Run Code Online (Sandbox Code Playgroud)
这可能不适用于较新的 Windows 版本或较新的硬件,但也可以选择..
使用 grub2 显然这样的东西可以适用于Windows 7:
menuentry "Windows 7 (bootmgr)" --class windows --class os {
insmod part_msdos
insmod ntfs
insmod ntldr
### A: either use this line or the next one, but not both
set root='(hd0,msdos1)'
### B:
### search --no-floppy --fs-uuid --set=root ____INSERT_PARTITION_UUID_HERE___
ntldr ($root)/bootmgr
}
Run Code Online (Sandbox Code Playgroud)
选项A假设您的可启动 U 盘/硬盘是第一个设备,并且具有 msdos 样式的分区表。调整以匹配您的配置。如果您的引导设备有 GPT 分区表,那么您很可能需要使用(hd0,gpt1)
(一般来说 GPT 设置起来比较棘手)。
选项B使用驱动器的唯一 UUID,可以在 Linuxsudo blkid
或 OSX 上查看,例如diskutil info disk0s1
(或磁盘实用程序 > 信息)。
最终条目可能如下所示:
menuentry "Windows 7 installer" --class windows --class os {
insmod part_msdos
insmod ntfs
insmod ntldr
search --no-floppy --fs-uuid --set=root 0E239BC6-F960-3107-89CF-1C97F78BB46B
ntldr /bootmgr
}
Run Code Online (Sandbox Code Playgroud)
从技术上讲,从 Windows.iso
文件安装是不可能的。您可以从.iso
使用 grub启动,但之后 Windows 将失去与安装位置的联系,或者它无法启动。所以grub
& Windows 都应该知道挂载和启动。目前 Windows 不支持。
因此,您需要将 的内容提取/复制.iso
到分区的根目录,然后使用grub
.
归档时间: |
|
查看次数: |
59708 次 |
最近记录: |