首先,要使用ISO文件,当然,硬盘上得有,所以先下载好ISO文件存放在某个分区,比如/HOME目录(最好不要发那个在根分区,如果根分区空间不够的话,同样也别放在/boot分区,因为你给/boot分区的指定的空间也可能是不大的)。
接着我们的GRUB2要建立 menuentry , 但是我们需要操作系统ISO里的两个文件,即 内核和文件系统镜像(kernel, initrd image)。
内核的链接文件是 vmlinuz ,镜像文件的链接是initrd.img
On other bootable Linux ISOs and utility CDs, these files may be located in other folders and may be named differently (vmlinuz0, initramfs, etc). Note that some non-Ubuntu ISOs contain an initrd image with a.gz extension rather than the .lz extension now used by Ubuntu.
在linux的图形界面中查看ISO文件的内容
你在linux中使用 解压缩工具(Archive Manager)查看ISO文件里的内容。
如果你要在终端中查看的话(输入命令,回车之后会弹出图形界面),可以使用 “file-roller ”或者“ gksu file-roller ” 这两个命令。
如果要在LINUX命令行终端直接查看的话:
可以把ISO镜像挂载到系统,通过通常查看文件的方式来查看ISO中的内容。
sudo mount -o loop /home/username/Downloads/ubuntu-desktop-amd64.iso /mnt/iso/
示例:
-
sudo mkdir /mnt/iso # Optional - the ISO file can be mounted on an existing mount point if desired. sudo mount -o loop /<path>/<filename>.iso /mnt/iso gksu nautilus /mnt/iso sudo umount /mnt/iso # When finished inspecting the contents.
通过 GRUB终端中的GRUB命令 来查看ISO
ls |
显示grub已知的分区; Display partitions known to GRUB. |
ls (hdX,Y)/ |
显示X硬盘上Y分区中的的某个文件夹; Display the contents of the / folder on /dev/sdXY |
To mount an ISO via the GRUB terminal, determine the location/path of the ISO file, then:
通过GRUB终端的命令挂载 ISO镜像 :
-
loopback loop (hdX,Y)/<path>/<filename.iso>
Example: loopback loop (hd0,5)/my_isos/ubuntu-12.04-desktop-amd64.iso
Once mounted via the above command, the ISO can be inspected using thels command. The ISO will be mounted on