U盘grub引导isolinux的方法
[
|
2007/10/12 09:32]
|
2007/10/12 09:32]
U盘安装grub的方法,可以参考我的另外一篇日志:
http://www.52zhe.cn/read.php?22
当时情况是这样的,本来应用U盘的grub可以引导到isolinux里面的内核和镜像,进行系统的安装,但是当我想引导到,像是CD1启动时的菜单,包括恢复模式的时候,我意识到,不可以简单的引导内核和镜像。最近研究了一下这个引导安装的问题。才知道到还有syslinux和isolinux的这个东西。这种都是loop的结构。不能分区,这就让我犯难了。怎么办?最后想到解决方法。
做法说明:
为这个diskboot.img在U盘内单独划分一个大小合适的分区,然后用dd命令将这个镜像完整写入那个分区。再用grub的的加载引导其他的启动器方式加载这个分区。
以下以RHEL5为例,首先查看安装好后的U盘情况,主要是grub引导的写法,其实与引导win是一样的。分区步骤略
[root@kook ~]# mount rhel5.iso /mnt -o loop
[root@kook ~]# tree /mnt/images
/mnt/images
|-- README
|-- TRANS.TBL
|-- boot.iso 可刻录成光盘,进行光盘引导。
|-- diskboot.img 本次应用这个,可进行网络安装,亦可网络调用,进入恢复模式。但是无法单独通过此盘进入恢复模式,需调用minstg2.img,尚未解决。
|-- minstg2.img 见上。
|-- pxeboot
| |-- README
| |-- TRANS.TBL
| |-- initrd.img
| `-- vmlinuz
|-- stage2.img 不知道什么情况下被调用。注意下面用file命令查看这四个文件的格式、结构。
`-- xen
|-- TRANS.TBL
|-- initrd.img
`-- vmlinuz
2 directories, 13 files
[root@kook ~]# cd /mnt/images
[root@kook images]# file boot.iso diskboot.img minstg2.img stage2.img
boot.iso: ISO 9660 CD-ROM filesystem data 'Red Hat Enterprise Linux Server' (bootable)
diskboot.img: x86 boot sector, code offset 0x58, OEM-ID " mkdosfs", sectors/cluster 4, root entries 512, sectors 24576 (volumes <=32 MB) , Media descriptor 0xf8, sectors/FAT 24, heads 64, serial number 0x45cb9539, label: " ", FAT (16 bit)
minstg2.img: data
stage2.img: data
[root@kook images]# dd if=diskboot.img of=/dev/sda3
[root@kook images]# fdisk -l /dev/sda
Disk /dev/sda: 1010 MB, 1010826752 bytes
32 heads, 61 sectors/track, 1011 cylinders
Units = cylinders of 1952 * 512 = 999424 bytes
Device Boot Start End Blocks Id System
/dev/sda1 1 951 928145+ 6 FAT16 win下使用 900M
/dev/sda2 952 981 29280 83 Linux grub的boot分区 80M
/dev/sda3 * 982 1011 29280 83 Linux diskboot.img的分区 20M
[root@kook grub]# cat grub.conf
color light-gray/blue
timeout 20
default 0
title Windows 95/98/NT/2000
map (hd0) (hd1)
map (hd1) (hd0)
rootnoverify (hd1,0)
makeactive
chainloader +1
title RHEL 5 ISOLINUX BOOT
rootnoverify (hd0,2)
makeactive
chainloader +1
title RHEL 5 Net Install
root (hd0,1)
kernel /rhel5/vmlinuz root=/dev/hda2 ro single
initrd /rhel5/initrd.img
boot
2008年6月1日新增如下:
后来发现的一个问题,当我将分区设在逻辑分区时,grub会报错为Error 12: Invalid device requested
所以必需将那个想写入U盘镜像的文件写入一个主分区。这又是为什么呢?奇怪了。
本文链接:http://www.52zhe.cn/read.php/109.htm
本文作者:kook(若就博客内所涉及的技术问题交流,请用下面的MSN或Gmail联系我)
联系方式:(MSN:kook#live.com) (Google talk:kookliu)
没有版权:GNU,转载时请注明“转载人”欠本人一顿饭,来日见面之时兑现!谢谢合作!
http://www.52zhe.cn/read.php?22
当时情况是这样的,本来应用U盘的grub可以引导到isolinux里面的内核和镜像,进行系统的安装,但是当我想引导到,像是CD1启动时的菜单,包括恢复模式的时候,我意识到,不可以简单的引导内核和镜像。最近研究了一下这个引导安装的问题。才知道到还有syslinux和isolinux的这个东西。这种都是loop的结构。不能分区,这就让我犯难了。怎么办?最后想到解决方法。
做法说明:
为这个diskboot.img在U盘内单独划分一个大小合适的分区,然后用dd命令将这个镜像完整写入那个分区。再用grub的的加载引导其他的启动器方式加载这个分区。
以下以RHEL5为例,首先查看安装好后的U盘情况,主要是grub引导的写法,其实与引导win是一样的。分区步骤略
[root@kook ~]# mount rhel5.iso /mnt -o loop
[root@kook ~]# tree /mnt/images
/mnt/images
|-- README
|-- TRANS.TBL
|-- boot.iso 可刻录成光盘,进行光盘引导。
|-- diskboot.img 本次应用这个,可进行网络安装,亦可网络调用,进入恢复模式。但是无法单独通过此盘进入恢复模式,需调用minstg2.img,尚未解决。
|-- minstg2.img 见上。
|-- pxeboot
| |-- README
| |-- TRANS.TBL
| |-- initrd.img
| `-- vmlinuz
|-- stage2.img 不知道什么情况下被调用。注意下面用file命令查看这四个文件的格式、结构。
`-- xen
|-- TRANS.TBL
|-- initrd.img
`-- vmlinuz
2 directories, 13 files
[root@kook ~]# cd /mnt/images
[root@kook images]# file boot.iso diskboot.img minstg2.img stage2.img
boot.iso: ISO 9660 CD-ROM filesystem data 'Red Hat Enterprise Linux Server' (bootable)
diskboot.img: x86 boot sector, code offset 0x58, OEM-ID " mkdosfs", sectors/cluster 4, root entries 512, sectors 24576 (volumes <=32 MB) , Media descriptor 0xf8, sectors/FAT 24, heads 64, serial number 0x45cb9539, label: " ", FAT (16 bit)
minstg2.img: data
stage2.img: data
[root@kook images]# dd if=diskboot.img of=/dev/sda3
[root@kook images]# fdisk -l /dev/sda
Disk /dev/sda: 1010 MB, 1010826752 bytes
32 heads, 61 sectors/track, 1011 cylinders
Units = cylinders of 1952 * 512 = 999424 bytes
Device Boot Start End Blocks Id System
/dev/sda1 1 951 928145+ 6 FAT16 win下使用 900M
/dev/sda2 952 981 29280 83 Linux grub的boot分区 80M
/dev/sda3 * 982 1011 29280 83 Linux diskboot.img的分区 20M
[root@kook grub]# cat grub.conf
color light-gray/blue
timeout 20
default 0
title Windows 95/98/NT/2000
map (hd0) (hd1)
map (hd1) (hd0)
rootnoverify (hd1,0)
makeactive
chainloader +1
title RHEL 5 ISOLINUX BOOT
rootnoverify (hd0,2)
makeactive
chainloader +1
title RHEL 5 Net Install
root (hd0,1)
kernel /rhel5/vmlinuz root=/dev/hda2 ro single
initrd /rhel5/initrd.img
boot
2008年6月1日新增如下:
后来发现的一个问题,当我将分区设在逻辑分区时,grub会报错为Error 12: Invalid device requested
所以必需将那个想写入U盘镜像的文件写入一个主分区。这又是为什么呢?奇怪了。
本文链接:http://www.52zhe.cn/read.php/109.htm
本文作者:kook(若就博客内所涉及的技术问题交流,请用下面的MSN或Gmail联系我)
联系方式:(MSN:kook#live.com) (Google talk:kookliu)
没有版权:GNU,转载时请注明“转载人”欠本人一顿饭,来日见面之时兑现!谢谢合作!
Oracle出错:由于输出设备已满或不可用, 归档程序无法归档重做日志。归档日志错误!
常用的帮助命令




楼主如果U分3个区,并且仅sda3是逻辑分区,则sda3应为(hd0,4)。