我正在尝试设置多重引导 ISO USB 驱动器,但在启动 ISO 文件时收到错误消息。
据我所知,环回设备已正确执行,否则将无法启动 iso。然而,找不到正确的路径。
我不懂为什么。
也许循环设备需要更多选项,或者 GUBB2 需要一些模块。
1.“KDE neon GNU/Linux (.iso)”启动没有任何问题。
2. “Arch Linux (.iso)”给出以下错误消息:
启动命令列表
错误:没有这样的模块。
按任意键继续…
按 Enter 键后会发生以下情况
正在等待启动设备...
等待设备 /dev/disk/by-label/ARCH_202211 30 秒...
错误:'/dev/disk/by-label/ARCH_202211' 设备在 30 秒后未显示。回到
交互式提示。
3.“Windows 10 (.iso)”找不到该文件。
启动命令列表
错误:没有这样的模块。
错误:找不到文件“/efi/boot/bootx64.efi”
按任意键继续...
如果我解压 iso 并将其直接复制到分区上,则使用此命令 (grub.cfg) 时 Windows 启动不会出现问题:
search.fs_uuid 2222-UUID-2222 root hd0,gpt1
set prefix=($root)'/grub'
configfile $prefix/grub.cfg
menuentry 'Windows 10' {
chainloader (${root})/efi/boot/bootx64.efi
}
我的配置
USB驱动器:
fdisk -l /dev/sdb && lsblk -pf /dev/sdb
Disk /dev/sdb: 7.48 GiB, 8021606400 bytes, 15667200 sectors
Disk model: USB storage device
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: gpt
Disk identifier: 0000-UUID-0000
Device Start End Sectors Size Type
/dev/sdb1 2048 206847 204800 100M EFI System
/dev/sdb2 206848 15667166 15460319 7.4G Microsoft basic data
NAME FSTYPE LABEL UUID FSAVAIL FSUSE% MOUNTPOINT
/dev/sdb
├─/dev/sdb1 vfat EFI 1111-UUID-1111
└─/dev/sdb2 ntfs BOOT 2222-UUID-2222
我按照中所述安装了 USB 驱动器GNU GRUB 手册
grub-install --efi-directory=/mnt/EFI --boot-directory=/mnt/BOOT --removable
grub.cfg:
search.fs_uuid 2222-UUID-2222 root hd0,gpt2
set prefix=($root)'/grub'
configfile $prefix/grub.cfg
menuentry "KDE neon GNU/Linux ISO" {
rmmod tpm
set isofile="/KDEneon.iso"
loopback loop (${root})/$isofile
linux (loop)/casper/vmlinuz boot=casper apparmor=0 iso-scan/filename=$isofile noprompt noeject lang=en locale=de_DE.UTF-8
initrd (loop)/casper/initrd
}
menuentry "Arch Linux ISO" {
rmmod tpm
set isofile="/ArchLinux.iso"
loopback loop (${root})/$isofile
search --no-floppy --set=root --label ARCH_202211
linux (loop)/arch/boot/x86_64/vmlinuz-linux archisobasedir=arch archisolabel=ARCH_202211 iso-scan/filename=$isofile noprompt noeject lang=en locale=de_DE.UTF-8
initrd (loop)/arch/boot/intel-ucode.img (loop)/arch/boot/amd-ucode.img (${root})/arch/boot/x86_64/initramfs-linux.img
}
menuentry 'Windows 10 ISO' {
rmmod tpm
set isofile="/Windows10.iso"
loopback loop (${root})/$isofile
chainloader (loop)/efi/boot/bootx64.efi iso-scan/filename=$isofile noprompt noeject
}
menuentry 'Windows 10 Extracted' {
chainloader (${root})/efi/boot/bootx64.efi
}
#menuentry 'memtest' {
#
#}
menuentry 'UEFI Settings' --class uefi {
fwsetup
}
menuentry "Restart" --class reboot {
reboot
}
menuentry "Power Off" --class halt {
halt
}
- - 编辑 - -
我在 USB 驱动器上安装了带有 DD 的 ArchLinux.iso,驱动器如下所示。
sudo dd if=/home/anonymus/Downloads/ArchLinux.iso of=/dev/sdb status=progress
fdisk -l /dev/sdb && lsblk -pf /dev/sdb && cat
Disk /dev/sdb: 7.48 GiB, 8021606400 bytes, 15667200 sectors
Disk model: USB storage device
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: 0000-UUID-0000
Device Boot Start End Sectors Size Id Type
/dev/sdb1 * 64 1570815 1570752 767M 0 Empty
/dev/sdb2 1570816 1601535 30720 15M ef EFI (FAT-12/16/32)
NAME FSTYPE LABEL UUID FSAVAIL FSUSE% MOUNTPOINT
/dev/sdb iso9660 ARCH_202211 2022-11-01-13-53-46-00
├─/dev/sdb1 iso9660 ARCH_202211 2022-11-01-13-53-46-00 0 100% /mnt/ARCH_202211
└─/dev/sdb2 vfat ARCHISO_EFI 55DC-6BC5
Arch Linux grub.cfg
# Load partition table and file system modules
insmod part_gpt
insmod part_msdos
insmod fat
insmod iso9660
# Use graphics-mode output
insmod all_video
insmod font
if loadfont "${prefix}/fonts/unicode.pf2" ; then
insmod gfxterm
set gfxmode="auto"
terminal_input console
terminal_output gfxterm
fi
# Enable serial console
if serial --unit=0 --speed=115200; then
terminal_input --append serial
terminal_output --append serial
fi
# Set default menu entry
default=archlinux
timeout=15
timeout_style=menu
# GRUB init tune for accessibility
play 600 988 1 1319 4
# Menu entries
menuentry "Arch Linux install medium (x86_64, UEFI)" --class arch --class gnu-linux --class gnu --class os --id 'archlinux' {
set gfxpayload=keep
search --no-floppy --set=root --label ARCH_202211
linux /arch/boot/x86_64/vmlinuz-linux archisobasedir=arch archisolabel=ARCH_202211
initrd /arch/boot/intel-ucode.img /arch/boot/amd-ucode.img /arch/boot/x86_64/initramfs-linux.img
}
menuentry "Arch Linux install medium with speakup screen reader (x86_64, UEFI)" --hotkey s --class arch --class gnu-linux --class gnu --class os --id 'archlinux-accessibility' {
set gfxpayload=keep
search --no-floppy --set=root --label ARCH_202211
linux /arch/boot/x86_64/vmlinuz-linux archisobasedir=arch archisolabel=ARCH_202211 accessibility=on
initrd /arch/boot/intel-ucode.img /arch/boot/amd-ucode.img /arch/boot/x86_64/initramfs-linux.img
}
if [ "${grub_platform}" == "efi" ]; then
if [ "${grub_cpu}" == "x86_64" ]; then
menuentry "UEFI Shell" {
insmod chain
search --no-floppy --set=root --label ARCH_202211
chainloader /shellx64.efi
}
elif [ "${grub_cpu}" == "i386" ]; then
menuentry "UEFI Shell" {
insmod chain
search --no-floppy --set=root --label ARCH_202211
chainloader /shellia32.efi
}
fi
menuentry 'UEFI Firmware Settings' --id 'uefi-firmware' {
fwsetup
}
fi
menuentry "System shutdown" --class shutdown --class poweroff {
echo "System shutting down..."
halt
}
menuentry "System restart" --class reboot --class restart {
echo "System rebooting..."
reboot
}