如何把一个32GU把光盘制作成iso一个可以安装多个不同版本的Linux系统ISO镜像文件

如何在同一个U盘刻录多个不同版本Linux系统ISO文件_百度知道
色情、暴力
我们会通过消息、邮箱等方式尽快将举报结果通知您。
如何在同一个U盘刻录多个不同版本Linux系统ISO文件
我有更好的答案
不是在U盘刻录,是把不同版本的系统ISO文件存放在U盘的同一个文件夹里,然后把U盘做成u启动盘就可以了。
电脑应用维护者
为您推荐:
其他类似问题
换一换
回答问题,赢新手礼包U盘引导多个linux镜像安装,同时支持BIOS和UEFI模式 - 为程序员服务
U盘引导多个linux镜像安装,同时支持BIOS和UEFI模式
步骤一: 格式化U盘
注意点: bios_grub标记的分区
步骤二: 安装grub到U盘
步骤三: 添加grub菜单
前言: 生命不息,折腾不止。在折腾中进步,在踩坑中成长。
# 准备开整
* U盘一枚(4G容量以上,备份好数据,一会可能要重新格式化) * 可用的任意操作系统,64位(32位就不要折腾UEFI了) * [UEFI](https://zh.wikipedia.org/wiki/統一可延伸韌體介面)与[ESP](https://en.wikipedia.org/wiki/EFI_System_partition)预备知识,限于篇幅就不详细介绍了,自己看文档原理
USB启动的原理就不多做讲解了,有兴趣的话找找相关的文档,介绍很多,也很详细,跟硬盘引导过程差不多。注意的是BIOS+MBR模式和UEFI+GPT模式是不同的。
# 基本步骤 先说一下我的环境,金士顿16G U盘一个,操作系统是Deepin bit,基于Ubuntu 14.04,其他类似的系统可以类比。Linux系统本来就使用grub引导(不要在CentOS/RHEL 6及以下版本折腾了,那个是Grub Legacy,已经不维护了),折腾起来要比其他操作系统方便的多,软件仓库就有grub相关的软件包,也不需要单独安装太多东西。Windows下可以用[grub2win](http://sourceforge.net/projects/grub2win),原理是一样的。
## 步骤一: 格式化U盘 想要支持UEFI引导,GPT是不可少了,而且GPT是兼容MBR了。所以第一步需要先将U盘格式化为GPT分区,这样efi文件可以和MBR共存,实现UEFI和BIOS双支持。
如果U盘已经是
Linux下支持GPT分区的工具: parted, gdisk。大致的步骤就是使用gdisk(命令和操作方式几乎和fdisk完全一样,只是支持GPT),或parted对U盘重新分区,然后标记ESP。如果用gdisk,只要给分区标记EF00编号即可,如果用parted,给分区boot标记即可。命令行就不演示了,很简单,我这边截图使用图形化工具gparted分区,同样结果也是GPT分区。
图形化的gparted操作也很简单,建立GPT分区表,分区,格式化为FAT32(**注: 尽管ESP支持多种分区,但是为了通用性与兼容性还是建议FAT32**),标记分区为boot
![创建分区表](https://static.oschina.net/uploads/img/14656_KBPI.png “创建分区表”) ![分区表类型GPT](https://static.oschina.net/uploads/img/14810_mYTe.png “GPT”) ![输入图片说明](https://static.oschina.net/uploads/img/22013_WuC1.png “在这里输入图片标题”) ![输入图片说明](https://static.oschina.net/uploads/img/2.png “在这里输入图片标题”) ![输入图片说明](https://static.oschina.net/uploads/img/22801_ho77.png “在这里输入图片标题”)
这样U盘处理就完成了,使用gdisk或parted显示一下U盘的信息,看到这样的信息就是OK的 “`bash $ sudo gdisk -l /dev/sdb
# 根据你的U盘的名字修改dev设备 GPT fdisk (gdisk) version 0.8.8
Partition table scan:
MBR: protective
# &========================= 保护性的MBR,这个是GPT兼容MBR的一种设计
BSD: not present
APM: not present
GPT: present
# &========================= 看这里,已经是GPT了
Found valid GPT with protective MBR; using GPT.
# &========== 这里的显示也说明是GPT分区 Disk /dev/sdb:
sectors, 14.7 GiB Logical sector size: 512 bytes Disk identifier (GUID): 022EE53E--CFA24730 Partition table holds up to 128 entries First usable sector is 34, last usable sector is
Partitions will be aligned on 2048-sector boundaries Total free space is 4029 sectors (2.0 MiB)
Start (sector)
End (sector)
# &======== 这里很关键,看Code是EF00,想要分区成为ESP必须设置这个标记,如果手工用gdisk别忘了这一步
$ sudo parted /dev/sdb print Model: Kingston DataTraveler 3.0 (scsi) 磁盘 /dev/sdb: 15.7GB Sector size (logical/physical): 512B/512B 分区表:gpt
# &======= GPT分区 Disk Flags:
# &===== ESP已经设置成功 “`
### 注意点: bios_grub标记的分区
**这个要特别强调,bios_grub标记的分区必须存在,否则BIOS模式下无法使用**。
有关bios_grub标记的分区说明: /community/Installation/UEFI-and-BIOS#Make_a_system_bootable_in_UEFI_as_well_as_BIOS
这里我简单提及一下这个标记的作用。上面提到过,GPT兼容MBR,如果要让grub在GPT上使用MBR模式安装的话,需要设置这个标记。按照ubuntu官方文档(上面那个文档,想了解详细的话必看!),这个分区有以下几个特点:
* 1MB容量 * 不需要格式化 * 设置bios_grub标记
如果用gdisk, parted, gparted这些工具分区的时候,你会发现总会有一个1MB的剩余空间,就是干这个用的,现在,我只需要给这个剩余空间分区,并打上bios_grub标记就行了(EF02),不用格式化。parted操作也类似
“`bash sudo gdisk /dev/sdb # 下面可以看到gdisk的操作几乎和fdisk完全一样,熟悉fdisk可以无压力上手
GPT fdisk (gdisk) version 0.8.8
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present
Found valid GPT with protective MBR; using GPT.
Command (? for help): n Partition number (2-128, default 2):
First sector (34-, default = ) or {+-}size{KMGTP}:
Last sector (36350, default = ) or {+-}size{KMGTP}:
Current type is ‘Linux filesystem’ Hex code or GUID (L to show codes, Enter = 8300): EF02 Changed type of partition to ‘BIOS boot partition’
Command (? for help): p Disk /dev/sdb:
sectors, 14.7 GiB Logical sector size: 512 bytes Disk identifier (GUID): 0086B5EF-81D9-4BD1-816C-AD1EADCD2338 Partition table holds up to 128 entries First usable sector is 34, last usable sector is
Partitions will be aligned on 2048-sector boundaries Total free space is 2014 sectors (1007.0 KiB)
Start (sector)
End (sector)
1007.5 KiB
BIOS boot partition # &== EF02对应的就是bios_grub这个标记
Command (? for help): w
Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING PARTITIONS!!
Do you want to proceed? (Y/N): y OK; writing new GUID partition table (GPT) to /dev/sdb. Warning: The kernel is still using the old partition table. The new table will be used at the next reboot. The operation has completed successfully.
sudo parted /dev/sdb print sudo gdisk /dev/sdb GPT fdisk (gdisk) version 0.8.8
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present
Found valid GPT with protective MBR; using GPT.
Command (? for help): n Partition number (2-128, default 2):
First sector (34-, default = ) or {+-}size{KMGTP}:
Last sector (36350, default = ) or {+-}size{KMGTP}:
Current type is ‘Linux filesystem’ Hex code or GUID (L to show codes, Enter = 8300): EF02 Changed type of partition to ‘BIOS boot partition’
Command (? for help): p Disk /dev/sdb:
sectors, 14.7 GiB Logical sector size: 512 bytes Disk identifier (GUID): 0086B5EF-81D9-4BD1-816C-AD1EADCD2338 Partition table holds up to 128 entries First usable sector is 34, last usable sector is
Partitions will be aligned on 2048-sector boundaries Total free space is 2014 sectors (1007.0 KiB)
Start (sector)
End (sector)
1007.5 KiB
BIOS boot partition
Command (? for help): w
Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING PARTITIONS!!
Do you want to proceed? (Y/N): y OK; writing new GUID partition table (GPT) to /dev/sdb. Warning: The kernel is still using the old partition table. The new table will be used at the next reboot. The operation has completed successfully.
$ sudo parted /dev/sdb print Model: Kingston DataTraveler 3.0 (scsi) 磁盘 /dev/sdb: 15.7GB Sector size (logical/physical): 512B/512B 分区表:gpt Disk Flags:
BIOS boot partition
# &== 要的就是这个! “`
至此分区的步骤就完成了。如果你已经是GPT分区了,就不用重新分区了,只要处理成ESP就行了
## 步骤二: 安装grub到U盘
这一步相比上一步已经简单许多了,但还是有一个小坑需要注意。先贴命令:
“`bash $ sudo mount /dev/sdb1 /mnt -o uid=$USER,gid=$USER
# 没什么好说的,挂载U盘使用,加上uid和gid参数只是为了编辑文件不需要sudo而已
# grub安装到MBR $
sudo grub-install –target=i386-pc –recheck –boot-directory=/mnt/boot /dev/sdb Installing for i386-pc platform. Installation finished. No error reported.
# grub安装到ESP,特别注意–removable参数,安装到移动设备上一定要用这个参数 $ sudo grub-install –target x86_64-efi –efi-directory /mnt –boot-directory=/mnt/boot –removable Installing for x86_64-efi platform. Installation finished. No error reported. “`
命令没有任何难度,但是有几个坑需要特别注意:
* Ubuntu的分包问题
grub默认的target是i386-pc,这个target包含在“grub-pc“这个包,如果你的系统使用BIOS+MBR安装,这个包默认是存在的。x86_64-efi这个target包含在“grub-efi“这个包,只有你的系统使用UEFI+GPT方式安装这个包才会存在。如果某个target报错,错误信息类似于“grub-install: error: /usr/lib/grub/x86_64-efi/modinfo.sh doesn’t exist. Please specify –target or –directory.“ 这样的话,就需要安装“grub-pc“或“grub-efi“之后再试。
* 安装到ESP要加–removable这个参数
这个参数专门针对于可移动设备,一定要加
* bios_grub标记的分区
如果按照上面的分区过程操作了,增加了这个标记的分区,安装grub的时候会自动识别这个标记的分区并成功安装grub,否则报错: “` Installing for i386-pc platform. grub-install: warning: this GPT partition label contains no BIOS Boot P embedding won’t be possible. grub-install: warning: 无法嵌入。在此次安装中 GRUB 只能通过使用块列表安装。但是块列表是不可信赖的,不推荐使用。. grub-install:错误: will not proceed with blocklists. “`
## 步骤三: 添加grub菜单
如果前面都没问题的话,最后就只剩下添加grub菜单了。在“/mnt/boot/grub“这个目录下,新建“grub.cfg“配置文件就行了。grub2的语法很复杂,图省事就从网上各种摘抄拼接就行了。比如我把linux发行版的iso镜像都扔到了“boot/iso“这个目录,于是乎我的“grub.cfg“成了这样:
“` # path to the partition holding ISO images (using UUID) probe -u $root –set=rootuuid set imgdevpath=”/dev/disk/by-uuid/$rootuuid”
# define globally (i.e outside any menuentry) insmod search_fs_uuid search –no-floppy –set=isopart –fs-uuid $rootuuid insmod all_video
menuentry “Linux Mint cinnamon 64bit ISO” {
set isofile=/boot/iso/linuxmint-17.2-cinnamon-64bit.iso
loopback loop ($isopart)$isofile
linux (loop)/casper/vmlinuz file=/cdrom/preseed/linuxmint.seed boot=casper iso-scan/filename=$isofile noeject noprompt splash locale=zh_CN.UTF-8 —
initrd (loop)/casper/initrd.lz }
menuentry “Ubuntu Desktop 64bit ISO” {
set isofile=/boot/iso/ubuntu-14.04.3-desktop-amd64+mac.iso
loopback loop ($isopart)$isofile
linux (loop)/casper/vmlinuz file=/cdrom/preseed/ubuntu.seed boot=casper iso-scan/filename=$isofile noeject noprompt splash locale=zh_CN.UTF-8 —
initrd (loop)/casper/initrd.lz }
menuentry “UbuntuKylin Desktop 64bit ISO” {
set isofile=/boot/iso/ubuntukylin-14.04.3-desktop-amd64.iso
loopback loop ($isopart)$isofile
linux (loop)/casper/vmlinuz.efi boot=casper iso-scan/filename=$isofile noeject noprompt splash locale=zh_CN.UTF-8 —
initrd (loop)/casper/initrd.lz }
menuentry “Ubuntu Server 64bit ISO” {
set isofile=/boot/iso/ubuntu-14.04.3-server-amd64+mac.iso
loopback loop ($isopart)$isofile
set gfxpayload=keep
linux (loop)/install/vmlinuz file=/cdrom/preseed/ubuntu-server.seed iso-scan/filename=$isofile quiet —
initrd (loop)/install/initrd.gz }
menuentry “Deepin 2014 ISO” {
set isofile=/boot/iso/deepin_2014.3_amd64.iso
loopback loop ($isopart)$isofile
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=$isofile noeject noprompt splash locale=zh_CN.UTF-8 —
initrd (loop)/casper/initrd.lz } “`
根据自己的需求增删改改就行了。想进一步美化的话,grub2关于美化的文档也很多,就不赘述了。
**注意:** 不要使用虚拟机测试,因为虚拟机不能完整模拟主板。因此不一定能引导你的U盘,让你误以为制作失败了。尽可能用真机去测试引导。
最后,贴一个效果图,可以看到BIOS模式和UEFI都可以引导了
![输入图片说明](https://static.oschina.net/uploads/img/41102_kARa.png “在这里输入图片标题”)![输入图片说明](https://static.oschina.net/uploads/img/41118_klAd.png “在这里输入图片标题”)
补充: 稍作美化一下效果,只不过那个从本地硬盘启动还没实现,需要看看别人怎么写的。
![输入图片说明](https://static.oschina.net/uploads/img/54815_lXGF.jpg “在这里输入图片标题”)
# 参考文献 * [Multiboot USB drive - ArchWiki](https://wiki.archlinux.org/index.php/Multiboot_USB_drive) * [Grub2/ISOBoot - Community Help Wiki - Official Ubuntu](/community/Grub2/ISOBoot) * [grub2 loopback booting ubuntu server iso](/questions/128995/grub2-loopback-booting-ubuntu-server-iso)
前言: 生命不息,折腾不止。在折腾中进步,在踩坑中成长。
U盘一枚(4G容量以上,备份好数据,一会可能要重新格式化)
可用的任意操作系统,64位(32位就不要折腾UEFI了)
预备知识,限于篇幅就不详细介绍了,自己看文档原理
USB启动的原理就不多做讲解了,有兴趣的话找找相关的文档,介绍很多,也很详细,跟硬盘引导过程差不多。注意的是BIOS+MBR模式和UEFI+GPT模式是不同的。
先说一下我的环境,金士顿16G U盘一个,操作系统是Deepin bit,基于Ubuntu 14.04,其他类似的系统可以类比。Linux系统本来就使用grub引导(不要在CentOS/RHEL 6及以下版本折腾了,那个是Grub Legacy,已经不维护了),折腾起来要比其他操作系统方便的多,软件仓库就有grub相关的软件包,也不需要单独安装太多东西。Windows下可以用
,原理是一样的。
步骤一: 格式化U盘
想要支持UEFI引导,GPT是不可少了,而且GPT是兼容MBR了。所以第一步需要先将U盘格式化为GPT分区,这样efi文件可以和MBR共存,实现UEFI和BIOS双支持。
如果U盘已经是
Linux下支持GPT分区的工具: parted, gdisk。大致的步骤就是使用gdisk(命令和操作方式几乎和fdisk完全一样,只是支持GPT),或parted对U盘重新分区,然后标记ESP。如果用gdisk,只要给分区标记EF00编号即可,如果用parted,给分区boot标记即可。命令行就不演示了,很简单,我这边截图使用图形化工具gparted分区,同样结果也是GPT分区。
图形化的gparted操作也很简单,建立GPT分区表,分区,格式化为FAT32(
注: 尽管ESP支持多种分区,但是为了通用性与兼容性还是建议FAT32
),标记分区为boot
这样U盘处理就完成了,使用gdisk或parted显示一下U盘的信息,看到这样的信息就是OK的
$ sudo gdisk -l /dev/sdb
# 根据你的U盘的名字修改dev设备
GPT fdisk (gdisk) version 0.8.8
Partition table scan:
MBR: protective
# &========================= 保护性的MBR,这个是GPT兼容MBR的一种设计
BSD: not present
APM: not present
GPT: present
# &========================= 看这里,已经是GPT了
Found valid GPT with protective MBR; using GPT.
# &========== 这里的显示也说明是GPT分区
Disk /dev/sdb:
sectors, 14.7 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 022EE53E--CFA24730
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is
Partitions will be aligned on 2048-sector boundaries
Total free space is 4029 sectors (2.0 MiB)
Start (sector)
End (sector)
# &======== 这里很关键,看Code是EF00,想要分区成为ESP必须设置这个标记,如果手工用gdisk别忘了这一步
$ sudo parted /dev/sdb print
Model: Kingston DataTraveler 3.0 (scsi)
磁盘 /dev/sdb: 15.7GB
Sector size (logical/physical): 512B/512B
分区表:gpt
# &======= GPT分区
Disk Flags:
# &===== ESP已经设置成功
注意点: bios_grub标记的分区
这个要特别强调,bios_grub标记的分区必须存在,否则BIOS模式下无法使用
有关bios_grub标记的分区说明:
这里我简单提及一下这个标记的作用。上面提到过,GPT兼容MBR,如果要让grub在GPT上使用MBR模式安装的话,需要设置这个标记。按照ubuntu官方文档(上面那个文档,想了解详细的话必看!),这个分区有以下几个特点:
不需要格式化
设置bios_grub标记
如果用gdisk, parted, gparted这些工具分区的时候,你会发现总会有一个1MB的剩余空间,就是干这个用的,现在,我只需要给这个剩余空间分区,并打上bios_grub标记就行了(EF02),不用格式化。parted操作也类似
sudo gdisk /dev/sdb
# 下面可以看到gdisk的操作几乎和fdisk完全一样,熟悉fdisk可以无压力上手
GPT fdisk (gdisk) version 0.8.8
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present
Found valid GPT with protective MBR; using GPT.
Command (? for help): n
Partition number (2-128, default 2):
First sector (34-, default = ) or {+-}size{KMGTP}:
Last sector (36350, default = ) or {+-}size{KMGTP}:
Current type is 'Linux filesystem'
Hex code or GUID (L to show codes, Enter = 8300): EF02
Changed type of partition to 'BIOS boot partition'
Command (? for help): p
Disk /dev/sdb:
sectors, 14.7 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 0086B5EF-81D9-4BD1-816C-AD1EADCD2338
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is
Partitions will be aligned on 2048-sector boundaries
Total free space is 2014 sectors (1007.0 KiB)
Start (sector)
End (sector)
1007.5 KiB
BIOS boot partition # &== EF02对应的就是bios_grub这个标记
Command (? for help): w
Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!
Do you want to proceed? (Y/N): y
OK; writing new GUID partition table (GPT) to /dev/sdb.
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot.
The operation has completed successfully.
sudo parted /dev/sdb print
sudo gdisk /dev/sdb
GPT fdisk (gdisk) version 0.8.8
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present
Found valid GPT with protective MBR; using GPT.
Command (? for help): n
Partition number (2-128, default 2):
First sector (34-, default = ) or {+-}size{KMGTP}:
Last sector (36350, default = ) or {+-}size{KMGTP}:
Current type is 'Linux filesystem'
Hex code or GUID (L to show codes, Enter = 8300): EF02
Changed type of partition to 'BIOS boot partition'
Command (? for help): p
Disk /dev/sdb:
sectors, 14.7 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 0086B5EF-81D9-4BD1-816C-AD1EADCD2338
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is
Partitions will be aligned on 2048-sector boundaries
Total free space is 2014 sectors (1007.0 KiB)
Start (sector)
End (sector)
1007.5 KiB
BIOS boot partition
Command (? for help): w
Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!
Do you want to proceed? (Y/N): y
OK; writing new GUID partition table (GPT) to /dev/sdb.
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot.
The operation has completed successfully.
$ sudo parted /dev/sdb print
Model: Kingston DataTraveler 3.0 (scsi)
磁盘 /dev/sdb: 15.7GB
Sector size (logical/physical): 512B/512B
分区表:gpt
Disk Flags:
BIOS boot partition
# &== 要的就是这个!
至此分区的步骤就完成了。如果你已经是GPT分区了,就不用重新分区了,只要处理成ESP就行了
步骤二: 安装grub到U盘
这一步相比上一步已经简单许多了,但还是有一个小坑需要注意。先贴命令:
$ sudo mount /dev/sdb1 /mnt -o uid=$USER,gid=$USER
# 没什么好说的,挂载U盘使用,加上uid和gid参数只是为了编辑文件不需要sudo而已
# grub安装到MBR
sudo grub-install --target=i386-pc --recheck --boot-directory=/mnt/boot /dev/sdb
Installing for i386-pc platform.
Installation finished. No error reported.
# grub安装到ESP,特别注意--removable参数,安装到移动设备上一定要用这个参数
$ sudo grub-install --target x86_64-efi --efi-directory /mnt --boot-directory=/mnt/boot --removable
Installing for x86_64-efi platform.
Installation finished. No error reported.
命令没有任何难度,但是有几个坑需要特别注意:
Ubuntu的分包问题grub默认的target是i386-pc,这个target包含在
这个包,如果你的系统使用BIOS+MBR安装,这个包默认是存在的。x86_64-efi这个target包含在
这个包,只有你的系统使用UEFI+GPT方式安装这个包才会存在。如果某个target报错,错误信息类似于
grub-install: error: /usr/lib/grub/x86_64-efi/modinfo.sh doesn't exist. Please specify --target or --directory.
这样的话,就需要安装
之后再试。
安装到ESP要加–removable这个参数 这个参数专门针对于可移动设备,一定要加
bios_grub标记的分区 如果按照上面的分区过程操作了,增加了这个标记的分区,安装grub的时候会自动识别这个标记的分区并成功安装grub,否则报错:
Installing for i386-pc platform.
grub-install: warning: this GPT partition label contains no BIOS Boot P embedding won't be possible.
grub-install: warning: 无法嵌入。在此次安装中 GRUB 只能通过使用块列表安装。但是块列表是不可信赖的,不推荐使用。.
grub-install:错误: will not proceed with blocklists.
步骤三: 添加grub菜单
如果前面都没问题的话,最后就只剩下添加grub菜单了。在
/mnt/boot/grub
这个目录下,新建
配置文件就行了。grub2的语法很复杂,图省事就从网上各种摘抄拼接就行了。比如我把linux发行版的iso镜像都扔到了
这个目录,于是乎我的
# path to the partition holding ISO images (using UUID)
probe -u $root --set=rootuuid
set imgdevpath="/dev/disk/by-uuid/$rootuuid"
# define globally (i.e outside any menuentry)
insmod search_fs_uuid
search --no-floppy --set=isopart --fs-uuid $rootuuid
insmod all_video
menuentry "Linux Mint cinnamon 64bit ISO" {
set isofile=/boot/iso/linuxmint-17.2-cinnamon-64bit.iso
loopback loop ($isopart)$isofile
linux (loop)/casper/vmlinuz file=/cdrom/preseed/linuxmint.seed boot=casper iso-scan/filename=$isofile noeject noprompt splash locale=zh_CN.UTF-8 --
initrd (loop)/casper/initrd.lz
menuentry "Ubuntu Desktop 64bit ISO" {
set isofile=/boot/iso/ubuntu-14.04.3-desktop-amd64+mac.iso
loopback loop ($isopart)$isofile
linux (loop)/casper/vmlinuz file=/cdrom/preseed/ubuntu.seed boot=casper iso-scan/filename=$isofile noeject noprompt splash locale=zh_CN.UTF-8 --
initrd (loop)/casper/initrd.lz
menuentry "UbuntuKylin Desktop 64bit ISO" {
set isofile=/boot/iso/ubuntukylin-14.04.3-desktop-amd64.iso
loopback loop ($isopart)$isofile
linux (loop)/casper/vmlinuz.efi boot=casper iso-scan/filename=$isofile noeject noprompt splash locale=zh_CN.UTF-8 --
initrd (loop)/casper/initrd.lz
menuentry "Ubuntu Server 64bit ISO" {
set isofile=/boot/iso/ubuntu-14.04.3-server-amd64+mac.iso
loopback loop ($isopart)$isofile
set gfxpayload=keep
linux (loop)/install/vmlinuz file=/cdrom/preseed/ubuntu-server.seed iso-scan/filename=$isofile quiet --
initrd (loop)/install/initrd.gz
menuentry "Deepin 2014 ISO" {
set isofile=/boot/iso/deepin_2014.3_amd64.iso
loopback loop ($isopart)$isofile
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=$isofile noeject noprompt splash locale=zh_CN.UTF-8 --
initrd (loop)/casper/initrd.lz
根据自己的需求增删改改就行了。想进一步美化的话,grub2关于美化的文档也很多,就不赘述了。
不要使用虚拟机测试,因为虚拟机不能完整模拟主板。因此不一定能引导你的U盘,让你误以为制作失败了。尽可能用真机去测试引导。
最后,贴一个效果图,可以看到BIOS模式和UEFI都可以引导了
补充: 稍作美化一下效果,只不过那个从本地硬盘启动还没实现,需要看看别人怎么写的。
其大无外,其小无内!
原文地址:, 感谢原作者分享。
您可能感兴趣的代码

我要回帖

更多关于 怎么把照片制作成视频 的文章

 

随机推荐