grub2 引导iso 进行硬盘安装过程的解释。

启动讨论 grub/grub2/syslinux/grub4dos/Lilo
回复
ws94501564
帖子: 22
注册时间: 2011-01-15 23:30

grub2 引导iso 进行硬盘安装过程的解释。

#1

帖子 ws94501564 » 2011-01-19 23:04

如果,你不了解启动过程,请你先看看。
man boot

如果,要启光盘镜像,的话,你得知道你所要安装的系统的live-system是否支持boot from iso。在这里http://michael-prokop.at/blog/2009/05/2 ... via-grub2/有一句
It’s the live system (as for example grml) that has to support this “boot from ISO” feature.
在这文章里,它是gml系统,我去它的官网看过了,它是支持的。可以看看这个
http://git.grml.org/?p=grml-live.git;a= ... xt;hb=HEAD
上grml来看,它是基于debian的。我想ubuntu也是基于debian的,所以也应该支持的。的确,我通过下面的命令验证了这一点
mkdir iso
mount -o loop ubuntu-10.10-desktop-i386.iso ./iso
cat ./iso/boot/grub/loopback.cfg
其中输出了一句
linux /casper/vmlinuz file=/cdrom/preseed/ubuntu.seed boot=casper iso-scan/filename=${iso_path} quiet splash --
这句证明,我们的ubuntu的live-system是支持的boot from iso
当我用不合适的linux 参数进入时,会有initramfs,所以我在google上找了initramfs ,幸好找到了这个
http://git.grml.org/?p=live-initramfs-g ... xt;hb=HEAD
在这里,我看到了这一句:
At boot time it will look for a (read-only) media containing a "/live"
directory where a root filesystems (often a compressed filesystem image like
squashfs) is stored. If found, it will create a writable environment, using
aufs, for Debian like systems to boot from.
所以这也就可以解释,硬盘安装时在grub的配制文中的linux 这一行有一句boot=casper了和file=/cdrom/preseed/ubuntu.seed。
又由于上面的cat的linux 这一行有iso-scan/filename这个参数,我想是ubuntu特有的。和gml的isofrom=是一样。



通过上面的分析,可以得出从硬盘安装方法。
假设,我已经安装了grub。ubuntu-10.10-desktop-i386.iso 为了方便,用ubuntu.iso代替,并放在(hd0,3)里。
进入grub2命令行。

loopback loop (hd0,3)/ubuntu.iso
这是利用grub的回放设备,挂iso,这样可以使你不用把casper文件夹提取出来了。
set root=(loop)
这是设置grub的根目录。
linux /casper/vmlinuz boot=casper iso-scan/filename=/ubuntu.iso
这是让grub挂内核。并传递参数boot=casper 给initramfs
initrid /casper/initrid.lz
boot
头像
dukelec
帖子: 410
注册时间: 2010-08-26 22:20
系统: Gentoo
来自: Canton

Re: grub2 引導iso 進行硬盤安裝過程的解釋。

#2

帖子 dukelec » 2011-01-19 23:53

8.x版本的ubuntu我有試從硬盤安裝系統。。
不過我上次幫同事裝10.10從硬盤引導到試用界面,然後再用桌面那個工具安裝系統到硬盤出錯,好像說存儲iso的那個分區無法卸載。。。又沒重新分區,非死活要卸載所有分區才肯裝。。。最後沒辦法用移動硬盤安裝的。。。

不知道是不是丟了什麼參數給內核。。。。。不知道樓主的方法存不存在我說的問題。。。
ws94501564
帖子: 22
注册时间: 2011-01-15 23:30

Re: grub2 引导iso 进行硬盘安装过程的解释。

#3

帖子 ws94501564 » 2011-01-20 9:19

那非常好解决,用,mount -l /isodevice
头像
Dim
帖子: 640
注册时间: 2009-04-06 15:03

Re: grub2 引导iso 进行硬盘安装过程的解释。

#4

帖子 Dim » 2011-01-20 12:01

收藏,我喜欢用u盘安
,
头像
黄美姬
帖子: 8428
注册时间: 2009-10-08 11:15
来自: 大城市铁岭

Re: grub2 引导iso 进行硬盘安装过程的解释。

#5

帖子 黄美姬 » 2011-01-20 12:58

10.1\11.04我试过都不行,10.04就可以??
我们是命运的妓女,它把我们都嫖了

N卡驱动:http://www.nvidia.cn/Download/index.aspx?lang=cn
极品飞车:http://www.geforce.cn/optimize/optimal- ... ts-450-ops
孤岛危机优化设置:http://www.geforce.cn/optimize/optimal- ... tx-450-ops
:cp /etc/skel/.bashrc ~/
PS1="\[\e]2;\u@\H \w\a\e[32;1m\]\T$\[\e[0m\] "
http://cdimage.ubuntu.com/
http://releases.ubuntu.com/
头像
cameron
帖子: 358
注册时间: 2007-08-10 15:06

Re: grub2 引导iso 进行硬盘安装过程的解释。

#6

帖子 cameron » 2011-01-20 14:55

mark. :em11
头像
TeliuTe
论坛版主
帖子: 7668
注册时间: 2007-11-25 13:29
系统: 16/18/20/w7
来自: 新疆博乐
联系:

Re: grub2 引导iso 进行硬盘安装过程的解释。

#7

帖子 TeliuTe » 2011-01-20 15:18

学习一下
上次用g4d引导debian5可以启动,但是选择安装以后,探测不到 cd-rom
头像
nmsfan
帖子: 18958
注册时间: 2009-10-16 22:46
来自: finland

Re: grub2 引导iso 进行硬盘安装过程的解释。

#8

帖子 nmsfan » 2011-01-20 15:25

无痛,不开刀
不错
我一直用vmlinuz和initrd.gz引导debian安装,很好很强大 :em04 :em04
>>>>推Ubuntu 桌面培训~~<<<<
>>>>想加入/了解gimp汉化吗,点我吧~<<<<
——————————————————————
不推荐wubi,也不推荐你给别人推荐wubi…………
随心而为的感觉真好……
强推mayhem!!
强推ensiferum
头像
qy117121
论坛版主
帖子: 50528
注册时间: 2007-12-14 13:40
系统: Winbuntu
来自: 志虚国乌由市
联系:

Re: grub2 引导iso 进行硬盘安装过程的解释。

#9

帖子 qy117121 » 2011-01-21 14:54

学习下,一直用的g4d
渠月 · QY   
本人只会灌水,不负责回答问题
无聊可以点一下→ http://u.nu/ubuntu

Ubuntu 20.04 快速设置指南,请配合浏浏览器自动翻译使用

邮箱 chuan@ubuntu.org.cn
头像
dukelec
帖子: 410
注册时间: 2010-08-26 22:20
系统: Gentoo
来自: Canton

Re: grub2 引导iso 进行硬盘安装过程的解释。

#10

帖子 dukelec » 2011-01-22 21:10

ws94501564 写了:那非常好解决,用,mount -l /isodevice
i use the command "sudo umount -l -r -f /isodevice" ..problem solved..
头像
hai1212
帖子: 136
注册时间: 2009-09-15 10:26
系统: Ubuntu、WIN7、XP、WIN8
联系:

Re: grub2 引导iso 进行硬盘安装过程的解释。

#11

帖子 hai1212 » 2014-05-21 20:51

黄美姬 写了:10.1\11.04我试过都不行,10.04就可以??
偶的12.04(Ubuntu12.04-desktop-amd64.iso)也不行。

代码: 全选

menuentry "安装乌班图 Ubuntu" {
   insmod part_msdos
   insmod fat
   insmod loopback
   loopback loop0 (hd0,1)/Ubuntu12.04-desktop-amd64.iso
   set root=(loop0)
   linux /casper/vmlinuz boot=casper iso-scan/filename=/Ubuntu12.04-desktop-amd64.iso ro quiet splash locale=zh_CN.UTF-8
   initrd /casper/initrd.lz
}
[/color]
newstar888
帖子: 4
注册时间: 2014-05-30 0:05
系统: ubuntukylin 14

Re: grub2 引导iso 进行硬盘安装过程的解释。

#12

帖子 newstar888 » 2014-05-30 22:29

我的是用GRUB4DOS引导U盘ubuntukylin-14.04-desktop-amd64.iso
32G U盘格式FAT32 bootice将U盘主引导与分区引导记录都做成GRUB for DOS,将grub的三个文件(grub badgrub grldr)和 menu放到U盘根目录,将iso镜像内casper内的initzd.lz和vmlinuz.efi解压到U盘根目录(不修改iso镜像文件)
menu内加入相应启动代码如下:(其中filename=iso文件位置#我的直接放在U盘根目录)

title Install UbuntuKylin

root (hd0,0)

kernel /vmlinuz.efi boot=casper iso-scan/filename=/ubuntukylin-14.04-desktop-amd64.iso ro quiet splash locale=zh_CN.UTF-8
initrd /initrd.lz
boot

不过以相同方法引导我下载的ubuntukylin-14.04-desktop-i386.iso失败
上次由 newstar888 在 2014-05-31 14:17,总共编辑 1 次。
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: grub2 引导iso 进行硬盘安装过程的解释。

#13

帖子 poloshiao » 2014-05-31 13:18

以相同方法引导我下载的ubuntukylin-14.04-desktop-i386.iso失败
參考
http://blog.ilc.edu.tw/blog/blog/25793/ ... 489/497043
头像
TeliuTe
论坛版主
帖子: 7668
注册时间: 2007-11-25 13:29
系统: 16/18/20/w7
来自: 新疆博乐
联系:

Re: grub2 引导iso 进行硬盘安装过程的解释。

#14

帖子 TeliuTe » 2014-05-31 14:15

i386里面没有.efi

代码: 全选

title Install Ubuntu/Linux 
root (hd0,0)
kernel /vmlinuz boot=casper iso-scan/filename=/ubuntu-14.04-desktop-i386.iso quiet splash ro locale=zh_CN.UTF-8 noprompt --
initrd /initrd.lz 
newstar888
帖子: 4
注册时间: 2014-05-30 0:05
系统: ubuntukylin 14

Re: grub2 引导iso 进行硬盘安装过程的解释。

#15

帖子 newstar888 » 2014-05-31 22:17

谢谢楼上(14楼TeliuTe)提醒!没错,i386内没有efi,我没注意到这个问题,我的menu加了efi,所以没引导成功。
回复