$( "#cnblogs_post_body" ).catalog()
centos系统中内置一个livecd系统
1:准备一个livecd的系统
[root@localhost iso]# ls /usr/iso/CentOS-7-x86_64-LiveGNOME-1804.iso
/usr/iso/Redflag-Asianux-7-x86_64-LiveCD.iso
2:修改grub.cfg文件
menuentry 'livecd test3' --class centos --class gnu-linux --class gnu --class os{
load_video
insmod gzio
insmod part_msdos
insmod xfs
insmod lvm
set isolabel=Redflag-Asianux-7-x86_64-LiveCD //此次根据
set isofile="(lvmid/cioN9O-T7CK-sA2p-efJL-1lsF-xfi4-OABdWp/K7Uj70-n41e-Dzsr-Jawx-8wMD-YzLd-EGE9OW)/usr/iso/Redflag-Asianux-7-x86_64-LiveCD.iso"
loopback loop $isofile
linux (loop)/isolinux/vmlinuz0 boot=isolinux.bin iso-scan/filename=/usr/iso/Redflag-Asianux-7-x86_64-LiveCD.iso root=live:LABEL=$isolabel ro rd.live.image quiet rhgb
initrd (loop)/isolinux/initrd0.img
}
3:isolabel查看方法
[ll@localhost iso]$ file Redflag-Asianux-7-x86_64-LiveCD.iso
Redflag-Asianux-7-x86_64-LiveCD.iso: # ISO 9660 CD-ROM filesystem data 'Redflag-Asianux-7-x86_64-LiveCD' (bootable)
4:isofile的查看方法
[ll@localhost iso]$ sudo grub2-probe --target=drive CentOS-7-x86_64-LiveGNOME-1804.iso
[sudo] ll 的密码:
(lvmid/cioN9O-T7CK-sA2p-efJL-1lsF-xfi4-OABdWp/K7Uj70-n41e-Dzsr-Jawx-8wMD-YzLd-EGE9OW)