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
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’
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:
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.
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?
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.