Pan*_*dya 13 iso bootable system-installation
我知道我可以创建/刻录可启动 CD/DVD 或 live USB,并且可以从中启动/安装。但是假设我目前正在运行 GNU/Linux 并且我有另一个 GNU/Linux 的 ISO 文件要安装在我的硬盘上,那么我可以直接从硬盘上的 ISO 引导并尝试/安装那个 GNU/Linux 操作系统吗? ?
Pan*_*dya 17
是的,您可以通过向GRUB
引导加载程序菜单添加菜单项来实现此目的。
您可以通过编辑添加自定义 GRUB 菜单项/etc/grub.d/40_custom
,
自定义菜单项示例:
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 "Trisquel ISO" {
set isofile="/Operating_Systems/Trisquel_7.0_i686/trisquel_7.0_i686.iso"
loopback loop (hd0,5)$isofile
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=$isofile quiet splash
initrd (loop)/casper/initrd
}
Run Code Online (Sandbox Code Playgroud)
说明与说明:
该命令set
用于将 ISO 文件的路径存储到一个变量中,这里是isofile
.
loopback
用于从文件系统映像制作设备。为此,必须指定设备和图像文件。这里我们用(hd0,5)$isofile
其中的(hd0,5)
where 代表磁盘的第五个分区。
linux
命令用于从文件加载 Linux 内核 ( vmlinuz )。将Linux内核的路径放在ISO中。
读取/提取 ISO 的内容以获取内核示例的路径:
$ 7z l trisquel_7.0_i686.iso | grep vmlinu
2014-10-29 21:41:43 ..... 5841680 5841680 casper/vmlinuz
2014-11-03 00:45:09 ..... 5844176 5844176 casper/vmlinuz.netinst
Run Code Online (Sandbox Code Playgroud)
所以,/casper/vmlinuz
在这里使用。
initrd
命令用于为 Linux 内核映像加载初始 ramdisk,并在内存中的 Linux 设置区设置适当的参数。
initrd
ISO中。读取/提取 ISO 的内容以获取以下路径initrd
:
$ 7z l trisquel_7.0_i686.iso | grep initrd
2014-11-03 00:45:19 ..... 16851900 16851900 casper/initrd
2014-11-03 00:45:09 ..... 9398592 9398592 casper/initrd.netinst
Run Code Online (Sandbox Code Playgroud)附加参数(例如)boot=casper iso-scan/filename=$isofile noprompt noeject
可能特定于 GNU/Linux 发行版,并因其他 Linux 系列而异。您可以从这里找到不同系列/发行版的一些配置。
注意:某些发行版使用initrd.gz
或initrd.lz
取决于使用的算法/压缩。
编辑后/etc/grub.d/40_custom
,GRUB需要更新update-grub2
命令。重新启动后,您会在 GRUB 屏幕上找到您添加的自定义菜单项。您可以使用 GNU/Linux 发行版的 Live 环境。
为了从 ISO 执行安装,安装程序可能需要卸载任何已安装的分区;即说另一个系统安装在/isodevice
,那么你可以umount -l /isodevice
。
归档时间: |
|
查看次数: |
7382 次 |
最近记录: |