<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.hacks.be/wiki/index.php?action=history&amp;feed=atom&amp;title=Gentoo_minimal_boot_rescue_on_Qemu</id>
	<title>Gentoo minimal boot rescue on Qemu - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.hacks.be/wiki/index.php?action=history&amp;feed=atom&amp;title=Gentoo_minimal_boot_rescue_on_Qemu"/>
	<link rel="alternate" type="text/html" href="https://www.hacks.be/wiki/index.php?title=Gentoo_minimal_boot_rescue_on_Qemu&amp;action=history"/>
	<updated>2026-04-30T12:09:33Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.1</generator>
	<entry>
		<id>https://www.hacks.be/wiki/index.php?title=Gentoo_minimal_boot_rescue_on_Qemu&amp;diff=126&amp;oldid=prev</id>
		<title>Tom at 13:46, 31 December 2017</title>
		<link rel="alternate" type="text/html" href="https://www.hacks.be/wiki/index.php?title=Gentoo_minimal_boot_rescue_on_Qemu&amp;diff=126&amp;oldid=prev"/>
		<updated>2017-12-31T13:46:30Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 13:46, 31 December 2017&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l61&quot; &gt;Line 61:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 61:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The option &amp;#039;&amp;#039;&amp;#039;isoboot=/install-amd64-minimal-20170907.iso&amp;#039;&amp;#039;&amp;#039; is also required to tell the initrd that it should first look for the iso file, before looking for the image.squashfs which is inside the iso file.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The option &amp;#039;&amp;#039;&amp;#039;isoboot=/install-amd64-minimal-20170907.iso&amp;#039;&amp;#039;&amp;#039; is also required to tell the initrd that it should first look for the iso file, before looking for the image.squashfs which is inside the iso file.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The commented initrd line could be used if the initrd image already contained the virtio drivers (maybe in the future).&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The commented initrd line could be used if the initrd image already contained the virtio drivers (maybe in the future).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;To actually activate the new grub settings:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;source lang=&amp;quot;sh&amp;quot;&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;grub-mkconfig -o /boot/grub/grub.cfg&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/source&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Tom</name></author>
	</entry>
	<entry>
		<id>https://www.hacks.be/wiki/index.php?title=Gentoo_minimal_boot_rescue_on_Qemu&amp;diff=125&amp;oldid=prev</id>
		<title>Tom at 13:45, 31 December 2017</title>
		<link rel="alternate" type="text/html" href="https://www.hacks.be/wiki/index.php?title=Gentoo_minimal_boot_rescue_on_Qemu&amp;diff=125&amp;oldid=prev"/>
		<updated>2017-12-31T13:45:32Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 13:45, 31 December 2017&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l28&quot; &gt;Line 28:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 28:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;find . -print | cpio -o -H newc | xz -9 -C none &amp;gt; /mnt/rescue/gentoo-minimal-20170907.igz&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;find . -print | cpio -o -H newc | xz -9 -C none &amp;gt; /mnt/rescue/gentoo-minimal-20170907.igz&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/source&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/source&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;It&amp;#039;s important to use &amp;#039;&amp;#039;&amp;#039;-C none&amp;#039;&amp;#039;&amp;#039; which omits checksums from the archive. Without the option the kernel seems to have problems decompressing the archive.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Create the grub entry (in /etc/grub.d/40_custom):&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Create the grub entry (in /etc/grub.d/40_custom):&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Tom</name></author>
	</entry>
	<entry>
		<id>https://www.hacks.be/wiki/index.php?title=Gentoo_minimal_boot_rescue_on_Qemu&amp;diff=124&amp;oldid=prev</id>
		<title>Tom: Created page with &quot;Putting a rescue image on the harddisk in case normal boot doesn&#039;t work anymore.  =Where to put files and configure grub= Files can be put in /boot, but in that case it&#039;s not...&quot;</title>
		<link rel="alternate" type="text/html" href="https://www.hacks.be/wiki/index.php?title=Gentoo_minimal_boot_rescue_on_Qemu&amp;diff=124&amp;oldid=prev"/>
		<updated>2017-12-31T13:44:31Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;Putting a rescue image on the harddisk in case normal boot doesn&amp;#039;t work anymore.  =Where to put files and configure grub= Files can be put in /boot, but in that case it&amp;#039;s not...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Putting a rescue image on the harddisk in case normal boot doesn&amp;#039;t work anymore.&lt;br /&gt;
&lt;br /&gt;
=Where to put files and configure grub=&lt;br /&gt;
Files can be put in /boot, but in that case it&amp;#039;s not possible from within the rescue boot to do anything with the boot partition as it will have the iso image mounted. To avoid this, an additional partition was created and mounted as /mnt/rescue (location doesn&amp;#039;t matter).&lt;br /&gt;
In theory, only the iso image is needed. Copy install-amd64-minimal-20170907.iso to /mnt/rescue.&lt;br /&gt;
&lt;br /&gt;
As it&amp;#039;s running on Qemu there&amp;#039;s an additional problem that the virtio modules are not present in the initrd. To add these, the initrd has to be unpacked, the virtio modules added and repacked. First mount the iso image:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sh&amp;quot;&amp;gt;&lt;br /&gt;
mount -o loop /mnt/rescue/install-amd64-minimal-20170907.iso /mnt/tmp&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Extract the initrd:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sh&amp;quot;&amp;gt;&lt;br /&gt;
mkdir /tmp/initrd&lt;br /&gt;
cd /tmp/initrd&lt;br /&gt;
xzcat /mnt/tmp/isolinux/gentoo.igz | cpio -ivmud&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mount the squashfs image and copy the modules, to add disk support at least virtio_blk.ko and virtio_pci.ko have to be added:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sh&amp;quot;&amp;gt;&lt;br /&gt;
mount -o loop /mnt/tmp/image.squashfs /mnt/tmp2&lt;br /&gt;
cp /mnt/tmp2/lib/modules/4.12.5-gentoo/kernel/drivers/block/virtio_blk.ko /tmp/initrd/lib/modules/4.12.5-gentoo/kernel/drivers/block/&lt;br /&gt;
cp /mnt/tmp2/lib/modules/4.12.5-gentoo/kernel/drivers/virtio/virtio* /tmp/initrd/lib/modules/4.12.5-gentoo/kernel/drivers/virtio/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Repack the initrd:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sh&amp;quot;&amp;gt;&lt;br /&gt;
find . -print | cpio -o -H newc | xz -9 -C none &amp;gt; /mnt/rescue/gentoo-minimal-20170907.igz&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the grub entry (in /etc/grub.d/40_custom):&lt;br /&gt;
&amp;lt;source&amp;gt;&lt;br /&gt;
menuentry &amp;quot;Gentoo minimal 20170907&amp;quot; {&lt;br /&gt;
	insmod gzio&lt;br /&gt;
	insmod part_gpt&lt;br /&gt;
	insmod ext2&lt;br /&gt;
	search --no-floppy --fs-uuid --set=boot cddcff7f-81ef-45e9-9329-66056308b7bb&lt;br /&gt;
	search --no-floppy --fs-uuid --set=rescue 80eb8826-6e3e-4b7a-aa82-bfc59e4e9eb7&lt;br /&gt;
	loopback loop ($rescue)/&amp;quot;install-amd64-minimal-20170907.iso&amp;quot;&lt;br /&gt;
	linux (loop)/isolinux/gentoo root=/dev/ram0 init=/linuxrc dokeymap looptype=squashfs loop=/image.squashfs cdroot initrd=($boot)/gentoo-minimal-20170907.igz doload=virtio_pci,virtio_blk vga=791 isoboot=/install-amd64-minimal-20170907.iso&lt;br /&gt;
#	initrd (loop)/isolinux/gentoo.igz&lt;br /&gt;
	initrd ($rescue)/gentoo-minimal-20170907.igz&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
menuentry &amp;quot;Gentoo minimal 20170907 nofb&amp;quot; {&lt;br /&gt;
	insmod gzio&lt;br /&gt;
	insmod part_gpt&lt;br /&gt;
	insmod ext2&lt;br /&gt;
	search --no-floppy --fs-uuid --set=boot cddcff7f-81ef-45e9-9329-66056308b7bb&lt;br /&gt;
	search --no-floppy --fs-uuid --set=rescue 80eb8826-6e3e-4b7a-aa82-bfc59e4e9eb7&lt;br /&gt;
	loopback loop ($rescue)/&amp;quot;install-amd64-minimal-20170907.iso&amp;quot;&lt;br /&gt;
	linux (loop)/isolinux/gentoo root=/dev/ram0 init=/linuxrc dokeymap looptype=squashfs loop=/image.squashfs cdroot initrd=($boot)/gentoo-minimal-20170907.igz doload=virtio_pci,virtio_blk isoboot=/install-amd64-minimal-20170907.iso&lt;br /&gt;
#	initrd (loop)/isolinux/gentoo.igz&lt;br /&gt;
	initrd ($rescue)/gentoo-minimal-20170907.igz&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the above block, the UUIDs are for the boot and rescue partition respectively.&lt;br /&gt;
Also required is the option &amp;#039;&amp;#039;&amp;#039;doload=virtio_pci,virtio_blk&amp;#039;&amp;#039;&amp;#039; which will tell the initrd to actually load these modules.&lt;br /&gt;
The option &amp;#039;&amp;#039;&amp;#039;isoboot=/install-amd64-minimal-20170907.iso&amp;#039;&amp;#039;&amp;#039; is also required to tell the initrd that it should first look for the iso file, before looking for the image.squashfs which is inside the iso file.&lt;br /&gt;
The commented initrd line could be used if the initrd image already contained the virtio drivers (maybe in the future).&lt;/div&gt;</summary>
		<author><name>Tom</name></author>
	</entry>
</feed>