Boot ISO With Grub: Difference between revisions
No edit summary |
No edit summary |
||
Line 25: | Line 25: | ||
In /etc/grub.d/40_custom add: | In /etc/grub.d/40_custom add: | ||
> menuentry "GNU Radio Linux (ISO)" {<br /> | <pre>> menuentry "GNU Radio Linux (ISO)" {<br /> | ||
> set isofile="/gnuradio.iso"<br /> | > set isofile="/gnuradio.iso"<br /> | ||
> loopback loop (hd1,4)$isofile<br /> | > loopback loop (hd1,4)$isofile<br /> | ||
Line 31: | Line 31: | ||
> initrd (loop)/casper/initrd.lz<br /> | > initrd (loop)/casper/initrd.lz<br /> | ||
> } | > } | ||
</pre> | |||
You most likely need to tweak the grub entry. | You most likely need to tweak the grub entry. | ||
<pre> | |||
> set isofile="/gnuradio.iso" | > set isofile="/gnuradio.iso" | ||
</pre> | |||
This is the path relative to the partition, where your ISO file is stored. I named the ISO something simple, so it's easy to update, without the need to update grub. | This is the path relative to the partition, where your ISO file is stored. I named the ISO something simple, so it's easy to update, without the need to update grub. | ||
<pre> | |||
> loopback loop (hd1,4)$isofile | > loopback loop (hd1,4)$isofile | ||
</pre> | |||
This line specifies which partition to use. In my setup, I have two hard disks. Where /dev/sdb is my main disk for my Linux OS. | This line specifies which partition to use. In my setup, I have two hard disks. Where /dev/sdb is my main disk for my Linux OS. | ||
To make it boot, I need to tell grub where to look. hd1 specifies it is my second disk /dev/sdb, and ,4 specifies it is partition 4. Which is /dev/sdb4. | To make it boot, I need to tell grub where to look. hd1 specifies it is my second disk /dev/sdb, and ,4 specifies it is partition 4. Which is /dev/sdb4. | ||
<pre> | |||
> linux (loop)/casper/vmlinuz.efi boot=casper iso-scan/filename=$isofile noprompt noeject<br /> | > linux (loop)/casper/vmlinuz.efi boot=casper iso-scan/filename=$isofile noprompt noeject<br /> | ||
> initrd (loop)/casper/initrd.lz | > initrd (loop)/casper/initrd.lz | ||
</pre> | |||
These two lines tells how to boot the ISO. You can figure these out by mounting the ISO file (not covered here) and checking the boot folders. | |||
The last thing you need to do, is update grub, to apply the changes. On Arch you do this: | The last thing you need to do, is update grub, to apply the changes. On Arch you do this: | ||
<pre> | |||
> grub-mkconfig -o /boot/grub/grub.cfg | > grub-mkconfig -o /boot/grub/grub.cfg | ||
</pre> | |||
If you run a Debian flavored distribution, you're most likely looking for this: | If you run a Debian flavored distribution, you're most likely looking for this: | ||
<pre> | |||
> update-grub | > update-grub | ||
</pre> | |||
Now you should be able to reboot and see a new entry in grub. | Now you should be able to reboot and see a new entry in grub. | ||
Sources: | Sources: | ||
http://ubuntuforums.org/showthread.php?t=1549847&page=3<br /> | [[http://ubuntuforums.org/showthread.php?t=1549847&page=3]]<br /> | ||
https://help.ubuntu.com/community/Grub2/ISOBoot/Examples<br /> | [[https://help.ubuntu.com/community/Grub2/ISOBoot/Examples]]<br /> | ||
https://wiki.archlinux.org/index.php/GRUB | [[https://wiki.archlinux.org/index.php/GRUB]] |
Revision as of 15:38, 18 March 2017
Boot ISO With Grub
The ISO must be placed on an EXT4 formatted partition!.
Before you begin, create a backup of your grub.cfg
> cp /boot/grub/grub.cfg{,.bak}
Locate the partition you want to use for the ISO.
> [mj@gnu ~]$ df -h<br /> > Filesystem Size Used Avail Use% Mounted on<br /> > /dev/sdb2 15G 3.5G 12G 24% /<br /> > /dev/sdb3 21G 4.5G 16G 23% /home<br /> > '''/dev/sdb4 20G 5.3G 14G 29% /var/iso'''<br /> > /dev/sdb1 511M 37M 475M 8% /boot
It will return a list of partitions, and where they are mounted. In this case, I have a dedicated partition for ISO files.
My ISO file is named
gnuradio.iso
and resides in
/var/iso
When you add your entry in grub, it is very important to add the path of the ISO relative to the partition. In this case, the ISO file is in the root of the partition. This is not relative to your system's root.
In /etc/grub.d/40_custom add:
> menuentry "GNU Radio Linux (ISO)" {<br /> > set isofile="/gnuradio.iso"<br /> > loopback loop (hd1,4)$isofile<br /> > linux (loop)/casper/vmlinuz.efi boot=casper iso-scan/filename=$isofile toram noprompt noeject<br /> > initrd (loop)/casper/initrd.lz<br /> > }
You most likely need to tweak the grub entry.
> set isofile="/gnuradio.iso"
This is the path relative to the partition, where your ISO file is stored. I named the ISO something simple, so it's easy to update, without the need to update grub.
> loopback loop (hd1,4)$isofile
This line specifies which partition to use. In my setup, I have two hard disks. Where /dev/sdb is my main disk for my Linux OS.
To make it boot, I need to tell grub where to look. hd1 specifies it is my second disk /dev/sdb, and ,4 specifies it is partition 4. Which is /dev/sdb4.
> linux (loop)/casper/vmlinuz.efi boot=casper iso-scan/filename=$isofile noprompt noeject<br /> > initrd (loop)/casper/initrd.lz
These two lines tells how to boot the ISO. You can figure these out by mounting the ISO file (not covered here) and checking the boot folders.
The last thing you need to do, is update grub, to apply the changes. On Arch you do this:
> grub-mkconfig -o /boot/grub/grub.cfg
If you run a Debian flavored distribution, you're most likely looking for this:
> update-grub
Now you should be able to reboot and see a new entry in grub.
Sources: