已装win8.1系统,怎么用grub2引导debian和arch的iso镜像实现硬盘安装?

其他Linux/Unix/BSD/OSX等发行版讨论
回复
aocif32
帖子: 15
注册时间: 2016-03-12 12:36

已装win8.1系统,怎么用grub2引导debian和arch的iso镜像实现硬盘安装?

#1

帖子 aocif32 » 2022-06-15 9:38

硬盘分区情况
EFI,C盘,D盘,空闲空间

C盘安装的是win8.1,EFI分区已经安装了GRUB2,debian,arch的iso放在D盘,网上找的硬盘安装ubuntu的方法是成功了,但debian/arch不行,求解。

目前的grub2配置

ubuntu的正常安装

代码: 全选

menuentry "Ubuntu ISO" --class ubuntu --class os {
    insmod ntfs
    insmod loopback
    set root='(hd0,gpt3)'
    set isofile=/ubuntu-22.04-desktop-amd64.iso
    loopback loop $isofile
    linux    (loop)/casper/vmlinuz  boot=casper iso-scan/filename=$isofile
    initrd    (loop)/casper/initrd
}
debian的虽然能成功引导,前几步选择语言都正常,但检测不到安装介质,导致安装不了

代码: 全选

menuentry "Debian ISO" --class ubuntu --class os {
    insmod ntfs
    insmod loopback
    set root='(hd0,gpt3)'
    set isofile='/debian-live-11.3.0-amd64-kde.iso'
    loopback loop $isofile
    linux    (loop)/d-i/vmlinuz  findiso=$isofile
    initrd    (loop)/d-i/initrd.gz
}

更新一下,已经解决
vmlinuz和initrd.gz要从下面连接下载,不能用iso里的
ftp.debian.org/debian/dists/stable/main/installer-amd64/current/images/hd-media/
放iso的分区要ext4格式等等,ntfs格式不行,检测不出iso

我的情况是这样,vmlinuz和initrd.gz放在了第一个fat32分区(EFI分区)的db目录里,硬盘是GPT分区的
grub2配置

代码: 全选

menuentry "Debian ISO" {
    insmod loopback
    set root='(hd0,gpt1)'
    loopback loop
    linux    /db/vmlinuz
    initrd    /db/initrd.gz
}
上次由 aocif32 在 2022-06-15 22:32,总共编辑 1 次。
头像
astolia
论坛版主
帖子: 6453
注册时间: 2008-09-18 13:11

Re: 已装win8.1系统,怎么用grub2引导debian和arch的iso镜像实现硬盘安装?

#2

帖子 astolia » 2022-06-15 11:50

引用自 https://wiki.debian.org/DebianInstaller ... e_on_a_hdd_...
Q: Running the installer from an iso file on a hdd ...

... requires a kernel, such as vmlinuz, and initrd RAM disk, such as initrd.gz. Can the vmlinuz and initrd.gz in the iso file be extracted and used as in many old examples?

A: No. The vmlinuz and initrd.gz in the iso file serve when booting from an optical drive. When an iso file is used directly from a HDD, "hd-media" vmlinuz and initrd.gz are required. For the Debian stable release the files are in the "hd-media" directory.
另外你可能想尝试一下ventoy。https://www.ventoy.net/cn/index.html
aocif32
帖子: 15
注册时间: 2016-03-12 12:36

Re: 已装win8.1系统,怎么用grub2引导debian和arch的iso镜像实现硬盘安装?

#3

帖子 aocif32 » 2022-06-15 18:06

astolia 写了: 2022-06-15 11:50 引用自 https://wiki.debian.org/DebianInstaller ... e_on_a_hdd_...
Q: Running the installer from an iso file on a hdd ...

... requires a kernel, such as vmlinuz, and initrd RAM disk, such as initrd.gz. Can the vmlinuz and initrd.gz in the iso file be extracted and used as in many old examples?

A: No. The vmlinuz and initrd.gz in the iso file serve when booting from an optical drive. When an iso file is used directly from a HDD, "hd-media" vmlinuz and initrd.gz are required. For the Debian stable release the files are in the "hd-media" directory.
另外你可能想尝试一下ventoy。https://www.ventoy.net/cn/index.html

成功,下载了hd-media的2个文件,专门分了个区sda5(NTFS格式)来放ISO镜像,选择介质时选了sda5还是检测不出ISO文件,试了一下在ubuntu livecd下把sda5格式化成ext4格式,再把ISO放进去就检测了,可以正常安装。

谢谢推荐ventoy。
回复