频道栏目
首页 > 资讯 > Linux > 正文

制作centos6的启动光盘boot.iso

19-02-03        来源:[db:作者]  
收藏   我要投稿
思路:参考ISO光盘文件,制作boot6.iso

1、将光盘isoliunx目录复制到data/myiso目录下,ks6-mini.cfg文件复制到/data/myiso/ksdir下,结构如下:

[root@Centos6 ~]# tree /data/myiso

/data/myiso

├── isolinux

│ ├── boot.cat

│ ├── boot.msg

│ ├── grub.conf

│ ├── initrd.img

│ ├── isolinux.bin

│ ├── isolinux.cfg

│ ├── memtest

│ ├── splash.jpg

│ ├── TRANS.TBL

│ ├── vesamenu.c32

│ └── vmlinuz

└── ksdir

└── ks6-mini.cfg

2 directories, 12 files

2、修改isolinux.cfg文件

cd isolinux/

vim isolinux.cfg

内存检测删掉

本地安装留下,且留作默认项(重要)

救援模式删掉

增加桌面安装

label desktop

kernel vmlinuz

append initrd=initrd.img ks=cdrom:/ksdir/ks6_desktop.cfg

增加最小化安装

label mini

kernel vmlinuz

append initrd=initrd.img ks=cdrom:/ksdir/ks6_mini.cfg 效果如下:

[root@Centos6 isolinux]# vim isolinux.cfg

default vesamenu.c32

#prompt 1

timeout 600

display boot.msg

menu background splash.jpg

menu title Welcome to CentOS 6.10!

menu color border 0 #ffffffff #00000000

menu color sel 7 #ffffffff #ff000000

menu color title 0 #ffffffff #00000000

menu color tabmsg 0 #ffffffff #00000000

menu color unsel 0 #ffffffff #00000000

menu color hotsel 0 #ff000000 #ffffffff

menu color hotkey 7 #ffffffff #ff000000

menu color scrollbar 0 #ffffffff #00000000

label linux

menu label ^Install or upgrade an existing system

menu default

kernel vmlinuz

append initrd=initrd.img

label vesa

menu label Install system with ^basic video driver

kernel vmlinuz

append initrd=initrd.img nomodeset

label local

menu label Boot from ^local drive

localboot 0xffff

label desktop

kernel vmlinuz

append initrd=initrd.img ks=cdrom:/ksdir/ks6_desktop.cfg

label mini

kernel vmlinuz

append initrd=initrd.img ks=cdrom:/ksdir/ks6_mini.cf

3、.生成boot.iso文件

mkisofs -R -J -T -v --no-emul-boot --boot-load-size 4 --boot-info-table -V "CentOS 6.9 x86_64 boot" -b isolinux/isolinux.bin -c isolinux/boot.cat -o /root/boot.iso /data/myiso/ 效果如下:

[root@Centos6 ~]# mkisofs -R -J -T -v --no-emul-boot --boot-load-size 4 --boot-info-table -V "CentOS 6.9 x86_64 boot" -b isolinux/isolinux.bin -c isolinux/boot.cat -o /root/boot.iso /data/myiso/

I: -input-charset not specified, using utf-8 (detected in locale settings)

genisoimage 1.1.9 (Linux)

Scanning /data/myiso/

Scanning /data/myiso/ksdir

Scanning /data/myiso/isolinux

Excluded: /data/myiso/isolinux/TRANS.TBL

Excluded by match: /data/myiso/isolinux/boot.cat

Writing: Initial Padblock Start Block 0

Done with: Initial Padblock Block(s) 16

Writing: Primary Volume Descriptor Start Block 16

Done with: Primary Volume Descriptor Block(s) 1

Writing: Eltorito Volume Descriptor Start Block 17

Size of boot image is 4 sectors -> No emulation

Done with: Eltorito Volume Descriptor Block(s) 1

Writing: Joliet Volume Descriptor Start Block 18

Done with: Joliet Volume Descriptor Block(s) 1

Writing: End Volume Descriptor Start Block 19

Done with: End Volume Descriptor Block(s) 1

Writing: Version block Start Block 20

Done with: Version block Block(s) 1

Writing: Path table Start Block 21

Done with: Path table Block(s) 4

Writing: Joliet path table Start Block 25

Done with: Joliet path table Block(s) 4

Writing: Directory tree Start Block 29

Done with: Directory tree Block(s) 3

Writing: Joliet directory tree Start Block 32

Done with: Joliet directory tree Block(s) 3

Writing: Directory tree cleanup Start Block 35

Done with: Directory tree cleanup Block(s) 0

Writing: Extension record Start Block 35

Done with: Extension record Block(s) 1

Writing: The File(s) Start Block 36

22.21% done, estimate finish Fri Feb 1 05:06:43 2019

44.31% done, estimate finish Fri Feb 1 05:06:41 2019

66.49% done, estimate finish Fri Feb 1 05:06:40 2019

88.60% done, estimate finish Fri Feb 1 05:06:40 2019

Total translation table size: 5380

Total rockridge attributes bytes: 1912

Total directory bytes: 4096

Path table size(bytes): 40

Done with: The File(s) Block(s) 22396

Writing: Ending Padblock Start Block 22432

Done with: Ending Padblock Block(s) 150

Max brk space used 1a000

22582 extents written (44 MB)

4、将boot.iso文件导出系统,新开一台虚拟机,挂载boot.iso,并设置光盘引导启动,在root下可以找到 boot.iso

[root@Centos6 isolinux]# ls /root

anaconda-ks.cfg boot.iso install.log install.log.syslog

sz boot.iso到桌面,

在虚拟机电源处点击“打开电源时进入固件”,即可设置,

5、开机成功,显示我们通过isolinux.cfg修改过的菜单选项,默认本地安装,选择其他选项将进行对应系统的自动安装

注: 假设你想备份一个叫做 /home/joeuser/ 的目录,但是不想包括子目录 /home/joeuser/junk/,因为其中包括的都是不必要的文件。你想创建一个叫做 backup.iso 的映像,然后把它刻写到 CD-R(W) 去,因而你能够在办公时在你的 Red Hat Linux PC 上使用,旅行时在你的 Windows 便携电脑上使用。这个目的可以通过使用 mkisofs ,运行以下命令来达到:mkisofs -o backup.iso -x /home/joeuser/junk/ -J -R -A -V -v /home/joeuser/

mkisofs(make iso file system)

功能说明:建立ISO 9660映像文件。

语法:mkisofs [-adDfhJlLNrRTvz][-print-size][-quiet][-A <应用程序ID>][-abstract < 摘要文件>][-b <开机映像文件>][-biblio ][-c <开机文件名称>] [-C <盘区编号,磁区编号>][-copyright <版权信息文件>][-hide <目录或文件名>] [-hide-joliet <文件或目录名>][-log-file <记录文件>][-m <目录或文件名>] [-M <开机映像文件>][-o <映像文件>][-p <数据处理人>][-P <光盘发行人>] [-sysid <系统ID >][-V <光盘ID >][-volset <卷册集ID>][-volset-size <光盘总数>][-volset-seqno <卷册序号>][-x <目录>][目录或文件]

补充说明:mkisofs可将指定的目录与文件做成ISO 9660格式的映像文件,以供刻录光盘。

参数:

-a或--all mkisofs通常不处理备份文件。使用此参数可以把备份文件加到映像文件中。

-A<应用程序ID>或-appid<应用程序ID> 指定光盘的应用程序ID。

-abstract<摘要文件> 指定摘要文件的文件名。

-b<开机映像文件>或-eltorito-boot<开机映像文件> 指定在制作可开机光盘时所需的开机映像文件。

-biblio 指定ISBN文件的文件名,ISBN文件位于光盘根目录下,记录光盘的ISBN。

-c<开机文件名称> 制作可开机光盘时,mkisofs会将开机映像文件中的全-eltorito-catalog<开机文件名称>全部内容作成一个文件。

-C<盘区编号,盘区编号> 将许多节区合成一个映像文件时,必须使用此参数。

-copyright<版权信息文件> 指定版权信息文件的文件名。

-d或-omit-period 省略文件后的句号。

-D或-disable-deep-relocation ISO 9660最多只能处理8层的目录,超过8层的部分,RRIP会自动将它们设置成ISO 9660兼容的格式。使用-D参数可关闭此功能。

-f或-follow-links 忽略符号连接。

-h 显示帮助。

-hide<目录或文件名> 使指定的目录或文件在ISO 9660或Rock RidgeExtensions的系统中隐藏。

-hide-joliet<目录或文件名> 使指定的目录或文件在Joliet系统中隐藏。

-J或-joliet 使用Joliet格式的目录与文件名称。

-l或-full-iso9660-filenames 使用ISO 9660 32字符长度的文件名。

-L或-allow-leading-dots 允许文件名的第一个字符为句号。

-log-file<记录文件> 在执行过程中若有错误信息,预设会显示在屏幕上。

-m<目录或文件名>或-exclude<目录或文件名> 指定的目录或文件名将不会房入映像文件中。

-M<映像文件>或-prev-session<映像文件> 与指定的映像文件合并。

-N或-omit-version-number 省略ISO 9660文件中的版本信息。

-o<映像文件>或-output<映像文件> 指定映像文件的名称。

-p<数据处理人>或-preparer<数据处理人> 记录光盘的数据处理人。

-print-size 显示预估的文件系统大小。

-quiet 执行时不显示任何信息。

-r或-rational-rock 使用Rock Ridge Extensions,并开放全部文件的读取权限。

-R或-rock 使用Rock Ridge Extensions。

-sysid<系统ID> 指定光盘的系统ID。

-T或-translation-table 建立文件名的转换表,适用于不支持Rock Ridge Extensions的系统上。

-v或-verbose 执行时显示详细的信息。

-V<光盘ID>或-volid<光盘ID> 指定光盘的卷册集ID。

-volset-size<光盘总数> 指定卷册集所包含的光盘张数。

-volset-seqno<卷册序号> 指定光盘片在卷册集中的编号。

-x<目录> 指定的目录将不会放入映像文件中。

-z 建立通透性压缩文件的SUSP记录,此记录目前只在Alpha机器上的Linux有效。

使用:mkisofs -l -R -J -T -V system-sp2 -o system.iso system/

扩展资料一: 在GRUB中,可以利用 stage2_eltorito 来制作启动光盘:

mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table -o grub.iso iso

stage2_eltorito和menu.lst应该放在光盘的/boot/grub目录里。

在GRUB4DOS中,可以利用 grldr 来制作启动光盘。制作方法有两种:

mkisofs -R -b grldr -no-emul-boot -boot-load-seg 0x1000 -o bootable.iso iso_root

mkisofs -R -b grldr -no-emul-boot -boot-load-size 4 -o grldr.iso iso_root

grldr和menu.lst应该放在光盘的根目录里。

第一种方法告诉 BIOS,希望它能够装入整个 GRLDR 文件到内存。装入内存后,BIOS 还应该正确设置堆栈,使得不至于把堆栈设置到 GRLDR 的程序体内,造成冲突。一般情况下,BIOS 做到这一点很容易,因为它可以设置堆栈指针为装入的起始地址。但也不排除存在 BUGGY BIOS 的可能性。

有些 BIOS 不完全符合可启动的 CDROM 规范,比如 VirtualPC 的就是的。这类 BIOS 只是装入了一部分 GRLDR 扇区到内存,典型的可能只装入了一个扇区(2048 字节的大扇区)到内存。不过我们的代码已经替这些 BUGGY BIOS 打了补丁。只要这些 BIOS 能够设置正确的堆栈,不至于和装入内存中的 GRLDR 扇区数据产生冲突就 OK 了。

也就是说,上述第一种制作光盘的方法,应该没有多大问题了。这种方法很有可能适应于所有的 BIOS。

第二种方法本身就只要求 BIOS 装入一个 CDROM 扇区到内存(等同于 4 个 512 字节的小扇区)。这种方法是最保守的,没有理由会失败了。微软的 win2000 启动光盘就是这么做的,isolinux 和 stage2_eltorito 也都是这么做的。如果这种方法失败了,那么 win2000,isolinux 和 stage2_eltorito 应该都会失败的。

对于第二种方法,我们不需要 -boot-info-table 这个参数。但是允许你用这个参数(用了和没用是一样的,我们的引导代码将忽略由这个参数所传递的数据结构)。

对于第一种方法也一样,不需要 -boot-info-table 这个参数,同时也是允许你用这个参数(用了和没用是一样的,我们的引导代码将忽略由这个参数所传递的数据结构)。

这样,stage2_eltorito 就可以完全用 grldr 来代替了。

扩展资料二:

实例分析:

mkisofs -r -T -J -V "make iso " -b /isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -v -o myiso.iso ./myCD

这个实例是用来制作一个安装盘。每一项的功能可以根据上面的选项得知。

其是 -no-emul-boot:Boot image is 'no emulation' image即非模拟模式启动

-boot-load-size:Set numbers of load sectors 即设置载入部分的数量

-boot-info-table:Patch boot image with info table 在启动的图像中显示信息

制作一个通用的ISO镜像

mkisofs -a -l -J -L -r -o filename.iso /directory

这样就能做出一个在windows和linux(或者其他UNIX)上面都能使用的ISO镜像了。

-a或--all mkisofs通常不处理备份文件。使用此参数可以把备份文件加到映像文件中。

-l或-full-iso9660-filenames 使用ISO 9660 32字符长度的文件名

-L或-allow-leading-dots 允许文件名的第一个字符为句号。

-J或-joliet 使用Joliet格式的目录与文件名称。

-r或-rational-rock 使用Rock Ridge Extensions,并开放全部文件的读取权限。

-o<映像文件>或-output<映像文件> 指定映像文件的名称。

扩展资料三

要做 Unix/Linux 下的数据盘或者开机启动盘,必须使用 Unix Rock Ridge 格式(mkisofs -r), 这种格式可以保存文件相关的权限

要所DOS/WIN下的光盘,用Joliet格式(-J)

最简单的光盘生成ISO-----------只有-o –v两个基本参数

最简单的光盘生成ISO-----------只有-o –v两个基本参数

[root@mail home]# ls

clamav guan guant iei simscan yu

[root@mail home]# mkisofs -o test.iso -v /home/guan /home/guant

可以后跟多个目录做source

mkisofs 2.0 (i686-pc-linux-gnu)

Scanning /home/guan

Scanning /home/guan/.kde

Scanning /home/guan/.kde/Autostart

Scanning /home/guan/sun

Scanning /home/guan/t1

Scanning /home/guan/t1/temp

Scanning /home/guan/t1/temp/t11

Scanning /home/guant/t2/temp/t11

Scanning /home/guant/t2/temp/t11/t111

../../article/20220623/file.html (../../article/20220623/file.html)

../../article/20220623/file.html (../../article/20220623/file.html)

Using NTRAC000.DOC;1 for /home/guan/newiei/Ntracker v9 r1.doc (nTracker Deployment Guide (2006-11-22).doc)

Using PRESE000.PPT;1 for /home/guan/newiei/Presentation3.ppt (Presentation2.ppt)

Using CISCO000.MHT;1 for /home/guan/newiei/Cisco IOS NetFlow Configuration Guide, Release 12_4 - Configuring NetFlow

Aggregation Caches - Cisco Systems.mht (Cisco IOS Switching Services ConfigurationGuide, Release12_2 - Configuring Multiprotocol Label Switching [Cisco IOS Software Releases 12_2 Mainline] - Cisco Systems.mht)

Writing: Initial Padbock Start Block 0

Done with: Initial Padbock Block(s) 16

Writing: Primary Volume Descriptor Start Block 16

Done with: Primary Volume Descriptor Block(s) 1

Writing: End Volume Descriptor Start Block 17

Done with: End Volume Descriptor Block(s) 1

Writing: The File(s) Start Block 38

10.49% done, estimate finish Fri Jun 15 14:40:41 2007

20.94% done, estimate finish Fri Jun 15 14:40:22 2007

62.83% done, estimate finish Fri Jun 15 14:40:14 2007

73.31% done, estimate finish Fri Jun 15 14:40:20 2007

83.77% done, estimate finish Fri Jun 15 14:40:19 2007

94.25% done, estimate finish Fri Jun 15 14:40:22 2007

Total translation table size: 0

Total rockridge attributes bytes: 0

Total directory bytes: 28672

Path table size(bytes): 168

Done with: The File(s) Block(s) 47695

Writing: Ending pad block Start Block 47733

Done with: Ending pad block Block(s) 27

Max brk space used 21000

47760 extents written (93 Mb)

[root@mail home]#

[root@mail home]# ls -l test.iso

-rw-r--r-- 1 root root 97812480 Jun 15 14:40 test.iso

将linux光盘生成iso文件

别忘了-r,否则做成的盘大写都变成小写,而且所有文件的权限都变成r_x

[root@mm guan]# ls /mnt/cdrom/

autorun RELEASE-NOTES-bn.html

EULA RELEASE-NOTES-de.html

GPL RELEASE-NOTES-en

images RELEASE-NOTES-en.html

isolinux RELEASE-NOTES-es.html

README-it.html RELEASE-NOTES-ru.html

README-ja.html RELEASE-NOTES-ta.html

README-ko.html RELEASE-NOTES-U1-bn.html

README-pa.html RELEASE-NOTES-U1-de.html RPM-GPG-KEY

README-pt_BR.html RELEASE-NOTES-U1-en SRPMS

README-ru.html RELEASE-NOTES-U1-en.html TRANS.TBL

README-ta.html RELEASE-NOTES-U1-es.html

README-zh_CN.html RELEASE-NOTES-U1-fr.html

README-zh_TW.html RELEASE-NOTES-U1-gu.html

RedHat RELEASE-NOTES-U1-hi.html

[root@mm guan]# mkiso -o linux-dev-redhat-as4r4.iso -v -r /mnt/cdrom

iso文件的检验最简单---------直接mount即可,相当于windows下的虚拟光驱

[root@mail home]# mount /home/test.iso /mnt/disk1

mount: /home/test.iso is not a block device (maybe try `-o loop')

[root@mail home]# mount -o loop /home/test.iso /mnt/disk1

[root@mail home]# ls /mnt/disk1

4_root_l _bash_lo _bashrc fggggggg.txt huawei.txt _kde network.txt

_bash_hi _bash_pr del.txt _gtkrc ifcfg_et linux_2_.bz2 newiei sdfsdf.txt

[root@mail home]#

制作linux启动光盘

mkisofs -r -J -T -V "Custom RHEL4 Build" -o /home/guan/custom-RHEL4-dvd.iso \

-b isolinux/isolinux.bin -c isolinux/boot.cat \

-no-emul-boot -boot-load-size 4 -boot-info-table .

-r -J: -rational-rock -joliet

-b:启动image

-c:cat文件

-no-emul-boot

-boot-load-size 4: Set numbers of load sectors

-boot-info-table:Patch boot image with info table

相关TAG标签
上一篇:外链是什么意思,如何做好高质量的外链建设?-qq5b850a864250a的博客-51CTO博客
下一篇:电梯安全以太网口工业移动4G路由上网RS232,RS485数据上传-xmsiyb的博客-51CTO博客
相关文章
图文推荐

关于我们 | 联系我们 | 广告服务 | 投资合作 | 版权申明 | 在线帮助 | 网站地图 | 作品发布 | Vip技术培训 | 举报中心

版权所有: 红黑联盟--致力于做实用的IT技术学习网站