I read grub2 allows booting from an ISO image (at least for most live-cds). How can I add such an entry to my grub configuration? Please mention all files to modify and all commands to run since I haven't used grub2 before upgrading.
-
possibly related: [freenas grub2 booting iso](http://unix.stackexchange.com/q/4202/863) – Tobias Kienzler Jan 05 '11 at 15:17
-
Isn't that a duplicate? What's different about it? – Michael Mrozek Jan 05 '11 at 15:29
-
@Michael Mrozek♦: That question doesn't state what its OP already knows about grub2, while my question is ground zero. Also I don't know if that question is specific to freenas only – Tobias Kienzler Jan 05 '11 at 15:35
-
2I think [this answer](http://unix.stackexchange.com/questions/665/installing-grub-2-on-a-usb-flash-drive/1041#1041) to [Installing Grub (2) on a USB flash drive](http://unix.stackexchange.com/q/665/863) answers most of it - if it does I'll probably add an answer myself later – Tobias Kienzler Jan 05 '11 at 15:43
2 Answers
For Grub 2
menu entries such as the Kubuntu example below have been known to work.
menuentry "Try kubuntu-16.04.1-desktop-amd64.iso - 64 bit live" {
loopback loop /kubuntu-16.04.1-desktop-amd64.iso
linux (loop)/casper/vmlinuz.efi boot=casper iso-scan/filename=/kubuntu-16.04.1-desktop-amd64.iso splash --
initrd (loop)/casper/initrd.lz
}
The content between the quotes on the first line is what you will see on the menu.
The second line mounts the named ISO on the loopback device.
The third line specifies the name of the Linux kernel executable.
The fourth line specifies the initial RAM disk. The initial RAM disk (initrd) is an initial root file system that is mounted prior to when the real root file system is available and contains the necessary modules to boot the real root file system.
You will likely have to check the content of the specific ISO you wish to boot to obtain the specific filenames for vmlinuz on the linux line and initrd on the intird line as these can vary from one distribution to another, and also insure that you are providing the full path to the ISO on the loopback line
- 807
- 1
- 8
- 20
As far as I know while grub2 supports iso files and booting from CD it does not support loading systems from one yet.
cdboot module is compiled from cdboot.S which is support of booting from CD but not loading kernels (at least as of 1.98).
- 16,578
- 11
- 57
- 93