boot from iso image without burning a cd rom

Hi,
I wish to try the OpenSuse live cd without burning a cd rom. I do not like virtualization solutions because I appreciate to test a distro in its real speed. And I prefer an hard disk solution instead of a usb installation because in the latter case I must have one usb pen for every distro I want to test.
Many live distros accept the “fromiso” or “from” cheatcode in kernel line which allows to boot directly from the iso file.
Suse and other ones not.
Nevertheless, I have successfully patched Ubuntu initrd following the instruction at page
HOWTO to boot Feisty from an isoimage saved on the harddisk (fromiso patch) - Ubuntu Forums
so that I was able to boot Ubuntu from iso file without burning any cd rom.
So, I ask: can someone suggest a similar procedure for OpenSuse? For Ubuntu, it suffices to modify few code lines. It would be wonderful if the the same thing is possible for OpenSuse.
Thanks in advance for your attention.

— No idea?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

The closest I’ve seen to this is a standard PXE boot, which should work
for any OS (including SUSE, Ubuntu, etc.). This requires a PXE server
but as long as your machine supports booting this way you won’t need to
burn media.

With that said, it’ll be faster/easier/cheaper (time-savings) to just
burn the SUSE mini-ISO or CD1 from any SUSE distro and boot from the
network or via some other medium you have available.

Good luck.

osskuro wrote:
> Hi,
> I wish to try the OpenSuse live cd without burning a cd rom. I do not
> like virtualization solutions because I appreciate to test a distro in
> its real speed. And I prefer an hard disk solution instead of a usb
> installation because in the latter case I must have one usb pen for
> every distro I want to test.
> Many live distros accept the “fromiso” or “from” cheatcode in kernel
> line which allows to boot directly from the iso file.
> Suse and other ones not.
> Nevertheless, I have successfully patched Ubuntu initrd following the
> instruction at page
> ‘HOWTO to boot Feisty from an isoimage saved on the harddisk (fromiso
> patch) - Ubuntu Forums’
> (http://ubuntuforums.org/showthread.php?t=457318)
> so that I was able to boot Ubuntu from iso file without burning any cd
> rom.
> So, I ask: can someone suggest a similar procedure for OpenSuse? For
> Ubuntu, it suffices to modify few code lines. It would be wonderful if
> the the same thing is possible for OpenSuse.
> Thanks in adavance for your attention.
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFJGu8R3s42bA80+9kRAt6KAKCCFUiQtyZMlRDqDUhScpIMJi12IwCdGnAh
CzFCBMWCGrlJ4qDmL1CfsbM=
=Wxjn
-----END PGP SIGNATURE-----

Despite being inactive for almost four years, I thought to share my solution here for benefit of others (this post shows on first page of google search for relevant queries).

I’ve written the following shell script which patches the initrd image of opensuse ISO image adding support for “fromiso” boot parameter:

https://gist.github.com/2107777

You can find example and usage info in the comment of the above script.

Good luck! :slight_smile:

Nice! I’ve wanted something like that for a while. The script assumes, though, that the iso is 64-bit. I made a patch that looks to file name (assuming OpenSuse standard names) and decides on the correct path to use to extract initrd. How do I submit it?

Myrosia

— gist2107777-94036384518242d1e84f0353fbc1528a2378f6a4/suse-fromiso 2012-03-19 11:08:11.000000000 +0000
+++ suse-fromiso 2012-06-15 00:42:50.827060803 +0100
@@ -60,6 +60,15 @@ if -z “$ISOPATH” ]; then
exit 1
fi

+if $ISOPATH =~ .*i[56]86.iso ]]; then

  • ARCH=“i386”
    +elif $ISOPATH =~ .*x86_64.iso ]]; then
  • ARCH=“x86_64”
    +else
  • assume 32 bit is still more common

  • ARCH=“i386”
    +fi

Mount ISO and extract initrd

ISOMNT=$(mktemp -d /tmp/tmpXXXXXX)
@@ -67,7 +76,7 @@ if mount -t iso9660 -o ro,loop "$ISOPATH
then

TMPHOLD=$(mktemp -d /tmp/tmpXXXXXX)
-gzip -d < “$ISOMNT”/boot/x86_64/loader/initrd > “$TMPHOLD”/initrd
+gzip -d < “$ISOMNT”/boot/${ARCH}/loader/initrd > “$TMPHOLD”/initrd
umount “$ISOMNT”

INITDIR=$(mktemp -d /tmp/tmpXXXXXX)

I got this to work for my setup, which is slightly different from what is described in the script instructions. It worked great, but I found instructions slightly confusing, so here are my notes.

My setup is: 2 partitions on the USB stick, a boot partition for the bootloader, plus a separate data partition where isos are stored.
On the data partition, the iso images are in “isos” directory, and the initrd are in “ramdisks” directory.

Specifically, I was using OpenSuse12.1 32 bit KDE live CD, and initrd produced with the script patched with my patch above. So I had 2 files:
isos/openSUSE-12.1-KDE-LiveCD-i686.iso and ramdisks/initrd_livecd_kde_12.1_i686_fromiso

The grub2 boot menu entry that works with this setup is

menuentry “OpenSuse-LiveKDE 12.1 32bit from ISO” {
loopback loop (hd0,2)/isos/openSUSE-12.1-KDE-LiveCD-i686.iso
linux (loop)/boot/i386/loader/linux ramdisk_size=512000 ramdisk_blocksize=4096 splash=silent quiet preloadlog=/dev/null showopts fromiso=isos/openSUSE-12.1-KDE-LiveCD-i686.iso
initrd (hd0,2)/ramdisks/initrd_livecd_kde_12.1_i686_fromiso
}

The important part was that “fromiso” parameter takes a path to the kernel relative to the partition root. The script will work with either 1 or 2 partition setup, but not with 3 or more partitions (not that I think anyone would need that). Also, note “i386” in the path to the loader for the live system.