How to Boot from 13.1 ISO image direct from hard drive using Grub2

Hello,

and it’s come, 13.1 long term support, most fans OpenSuse like me making preparation to install or upgrade,
so it’s easy way to boot installation DVD direct from Grub2 menu, if you have already running OpenSuse or another distro with
Grub2 on your boot disk, and it’s relatively easy,
based on https://forums.opensuse.org/english/get-technical-help-here/how-faq-forums/unreviewed-how-faq/484223-how-boot-opensuse-dvd-hard-disk-grub2.html with few my findigs,

just put code posted below to /etc/grub.d/40_custom

#!/bin/shexec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.

menuentry "openSUSE 13.1 x86-64 DVD" {
  insmod loopback
  insmod udf
  insmod iso9660
  insmod gzio
  insmod part_msdos
  insmod ext2
# full path to iso image
  set isofile=/home/isos/openSUSE-13.1-DVD-x86_64.iso
# first disk no partitions, second have grub2 on mbr, boot from bios boot menu 
  set root=(hd0,1)
  loopback loop $isofile
# .../linux "install" it may contain install, upgrade, rescue - install start installation process
 linux (loop)/boot/x86_64/loader/linux install=hd:$isofile
  initrd (loop)/boot/x86_64/loader/initrd
}

after save this file execute from root console or sudo -s

grub2-mkconfig -o /boot/grub2/grub.cfg

for OpenSuse, mostly update-grub for another distro,

and this one is for clonezilla live,it’s can help make backup for sometimes times not working upgrade :slight_smile:

menuentry "Clonezilla live" {insmod loopback
insmod iso9660
# boot-dev/full_path_to_iso
set isofile="/home/isos/clonezilla-live-2.2.0-29-amd64.iso"
loopback loop $isofile
linux (loop)/live/vmlinuz boot=live live-config noswap nolocales edd=on nomodeset ocs_live_run=\"ocs-live-general\" ocs_live_extra_param=\"\" keyboard-layouts=\"\" ocs_live_batch=\"no\" locales=\"\" vga=788 ip=frommedia nosplash toram=filesystem.squashfs findiso=$isofile
initrd (loop)/live/initrd.img
}

I hope some one have find this usefull.

Thank You

Regards
Czeslaw M.

So I gave this a try, but it is not working for me. The basic error is the ISO file is not found. Anyone else get this to work by chance?

Thank You,

Whee did you put it? on boot home is not mounted

Most crytical part is below


set root=(hdx.y)

is working for me, with “dev/hdb” and first partition is “/home” - i mean no separate partition for “Home directory”,
“hdb” have grub2 on “mbr”, when bios boot um my pc i using bios boot menu to boot form second drive “hdb”.

path to iso looks for me like this (/dev/hdb)/home/isos/opensuse.ios, hdb become firs device (hd0.y) and
/home/isos is on first partition on this drive with ext4 file system.

If you have separate “Home directory” the (hdx.y), ‘y’ means partition contain “home directory” and depends of your “hd’s/partitions” combination,
btw u can play with this parameters manually when grub2 menu comes up pres ‘e’ modify any parameters you like, when done pres ‘F10’

I hope this will help you.

thanks

Regards
Czeslaw M.

Have you seen autoiso.cfg (part of current grub2 sources)? May be you could contribute your code for detection of openSUSE ISOs there …

grub.git - Unnamed repository; edit this file ‘description’ to name the repository.

OK, it works like a champ now. I elected to use the new rescue CD ISO image. Here is the code I placed into the file /etc/grub.d/40_custom as root:

#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.

# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.

menuentry "openSUSE 13.1 Rescue-CD x86-64 DVD" {
  insmod loopback
  insmod udf
  insmod iso9660
  insmod gzio
  insmod part_msdos
  insmod ext2set root=(hd0,3)
# full path to iso image, I placed it in the root boot folder.
  set isofile=/boot/openSUSE-13.1-Rescue-CD-x86_64-Build0091-Media.iso
# Where is your Root Partition?  hd0=1st disk and 3=3rd Partition. !Important!
  set root=(hd0,3)
  loopback loop $isofile
# .../linux "install" it may contain install, upgrade, rescue - install start installation process
 linux (loop)/boot/x86_64/loader/linux install=hd:$isofile
  initrd (loop)/boot/x86_64/loader/initrd
}

Notice the top line was wrong and I had to split into two lines. Since the command “set root=(hd0,3)” sets the root partition location, I elected to place the rescue ISO image “openSUSE-13.1-Rescue-CD-x86_64-Build0091-Media.iso” in the /boot folder which is in my root openSUSE 13.1 partition.

I am using my grub2cmd bash script for this edit process you can find here:

GNU Grub2 Command Listing Helper with --help & Input - Blogs - openSUSE Forums

Thanks for your fine post here.

Thank You,

Hello,

since it is not work with OpneSuse 13.1 installed, this is a version to load ISO image from OpenSuse 13.1 with GPT + LVM + Btrfs (or any modern Linux distribution with LVM manger)

menuentry "openSUSE 13.1 DVD" {
  insmod loopback
  insmod udf
  insmod iso9660
  insmod gzio
  insmod part_gpt
  insmod btrfs
  insmod lvm
  # hard drive and partition contain folder "/home/isos" eg '/dev/mapper/system-home'
  set isofile=/home/isos/openSUSE-13.1-DVD-x86_64.iso
  set root=(hd0,1)
  loopback loop $isofile
  linux (loop)/boot/x86_64/loader/linux install=hd:$isofile
  initrd (loop)/boot/x86_64/loader/initrd
}

and remember, you always can modify grub2 menu, pres ‘e’, modify what you want and ‘F10’ to boot it.

Regards

Czeslaw M.

I have Opensuse installed on a USB stick, so I can run my OS wherever I go.
I have it formatted with one ext4 partition and one vfat partition
The installation was a normal one, with grub booting the system.
Now I want to add others ISOs to the boot menu… let’s say SystemRescueCD or so.
So the system you describe will fit my goal, but the problem is I will not know if root=(hd0,1) or something totally different because it will depend on the computer I am booting, so Is there any way to set it in a device computer independent way?

regards

This is an (two years) old thread. Do you realy think many people are subscribed to it and will see your post? Also your problem is not exactly the same as the original one as shown in the title.

Please start a new thread of your own, with a good title to draw the attention of people with the right knowledge.

This thread is CLOSED.