How to boot a openSUSE DVD from hard disk with Grub2

This will show you how to boot openSUSE DVD image from your hard disk instead of using a usb or dvd. You can do an install/upgrade/rescue just like if you booted a DVD.

Prerequisites:

-openSUSE installed with Grub2
-DVD image on an unencrypted partition that you won’t need to format during installation

Step 1:

Append the following to /etc/grub.d/40_custom (as root):

menuentry "**openSUSE 12.3 DVD**" {
  set isofile=**/openSUSE-12.3-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
}

You only need to edit the bold areas.

Change the menu entry to whatever you like.

The root=(hd0,1) is the partition your iso image on. In my case, it’s /dev/sda1. It’s a 5GB partition where I keep my DVD image. If yours is on /dev/sda3, then change it to root=(hd0,3).

The isofile is the path to your iso file. In my case, it’s located on the root of /dev/sda1.
Let’s say you have a separate home partition and your iso is at /home/user/openSUSE-12.3-DVD-x86_64.iso. You would need to change it to isofile=/user/openSUSE-12.3-DVD-x86_64.iso (leave out the home).

Change the x86_64 to i386 if you’re using 32 bit.

Step 2:

You need to update grub2 to recognize your new menu entry.
Open up Yast -> Boot Loader.
All you have to do is click OK without changing anything.
There’s a command line method instead of using Yast but I forgot what it was.

That’s it. Now you can reboot and select the new entry from Grub2. The DVD will boot up and work just like normal.

**This does not work with Live images. Let me know if you know how to do it.
**I use ext4 for my partitions. You may need to make adjustments if you use something like ntfs.

cool idea. i am curious as to why live images are not working. Does this approach reduce installation time ?

I don’t think there’s any noticeable difference in speed compared to using a usb stick. I’ve never used an actual DVD so I don’t know about that.
I use this method because it’s convenient. I don’t always have a spare usb stick to use.

I tried using a Live image over a year ago. I don’t remember the details but it wouldn’t boot up.

I found out how to boot a live image. It boots up and seems to work fine but I haven’t installed from it yet.

menuentry "openSUSE 12.3 Gnome Live HDD" {
  set isofile=/openSUSE-12.3-GNOME-Live-x86_64.iso
  set arch=x86_64
  set rootdevice=/dev/sda1
  set root=(hd0,1)
  loopback loop $isofile
  linux (loop)/boot/$arch/loader/linux isofrom=$rootdevice:$isofile
  initrd (loop)/boot/$arch/loader/initrd
}

Change the four “set” lines as needed then update grub2.

This works great, Thanks londy.

I have loaded up the latest rescue DVD and it boots fine. One wierd thing I noticed was an error for finding LSB and Virtualbox modules is that part of the rescue DVD or are we using the initrd image from the install boot folder, something else maybe?

Anyway, I love it. I used to always have the install DVD loaded in a partition in my macbook and G4 macs, it is handy sometimes.

Oh yea, I have marked Grub2 and all it friends as taboo in Yast2 software so I am hoping an upgrade will not wipe out the 40_custom file.

i’ve setup the following for live kde


menuentry "openSUSE KDE Live" {
  set isofile=/distros/openSUSE-Factory-KDE-Live-x86_64-Build0725-Media.iso
  set arch=x86_64
  set rootdevice=/dev/sdc3
  set root=(hd3,3)
  loopback loop $isofile
  linux (loop)/boot/$arch/loader/linux isofrom=$rootdevice:$isofile
  initrd (loop)/boot/$arch/loader/initrd
}

it starts to load but stops with error message

Failed to find MBR identifier
rebootException: reboot in 120 sec…

That’s an old iso you’re using, Factory from 18th of September. Download the stable release

the same happens even if i use openSUSE-13.1-KDE-Live-x86_64.iso


ls -lah /data/media/distros/ | grep SUSE
-rwxrwxrwx. 1 root root 942M Nov  6 17:56 openSUSE-13.1-KDE-Live-x86_64.iso
-rwxrwxrwx. 1 root root 912M Sep 18 03:38 openSUSE-Factory-KDE-Live-x86_64-Build0725-Media.iso

It looks like they require two additional parameters for 13.1.
I haven’t installed from it yet but it boots up to the desktop. I’ll probably install it this weekend.

menuentry "openSUSE 13.1 Gnome Live HDD" {
  set isofile=/openSUSE-13.1-GNOME-Live-x86_64.iso
  set arch=x86_64
  set rootdevice=/dev/sda1
  set root=(hd0,1)
  loopback loop $isofile
  linux (loop)/boot/$arch/loader/linux isofrom=$rootdevice:$isofile isofrom_device=$rootdevice isofrom_system=$isofile
  initrd (loop)/boot/$arch/loader/initrd
}

I installed 13.1 from the live kde image. It installed without any problems.

Hi londy, are there any limitations to do installation by this method?

For example, can I install OpenSUSE by using live image that i put at /dev/sda3 to an unused /dev/sda5 partition? Or is it necessary to put .iso file on another drive?
And what if /dev/sda5 is my existing OpenSUSE partition and I install over it?

The requirements for the live image is the same as the dvd image. Just store the iso on a partition you won’t format. So if you’ll install the system on /dev/sda5, then don’t put the iso there.

And what if /dev/sda5 is my existing OpenSUSE partition and I install over it?

Yes.

Thank you,

I asked this because I have been tried boot elementaryOS iso with Ubuntu grub2. It loaded successfully but always failed on installing even after I moved the iso to an external hard drive. It seems that it can not install on the same drive where grub2 is installed as it always spitted “Unable to Unmount” error.

when you boot this from the hard drive, is the live image able to be updated?

On Sat, 21 Jun 2014 13:56:02 +0000, TakeIT2 wrote:

> when you boot this from the hard drive, is the live image able to be
> updated?

No, because to the system, the ISO is a DVD, not a writable medium.

Jim


Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

For example, can I install OpenSUSE by using live image that i put at /dev/sda3 to an unused /dev/sda5 partition? Or is it necessary to put .iso file on another drive?
And what if /dev/sda5 is my existing OpenSUSE partition and I install over it? iso file=/user/openSUSE-12.3-DVD-x86_64.iso (leave out the home).
Change the x86_64 to i386 if you’re using 32 bit.
Step 2:
You need to update grub2 to recognize your new menu entry.
Open up Yast -> Boot Loader.
All you have to do is click OK without changing anything.
There’s a command line method instead of using Yast but I forgot what it was.
That’s it. Now you can reboot and select the new entry from Grub2. The DVD will boot up and work just like normal.
Monded?

For NTFS paritions, you have to add insmod ntfs like below.

menuentry "OpenSUSE Leap 42.1 on sdb1" {
        insmod ntfs
        insmod iso9660
  
        set isofile="openSUSE-Leap-42.1-DVD-x86_64.iso"
        loopback loop (hd1,1)/$isofile
        linux (loop)/boot/x86_64/loader/linux install=hd:$isofile
        initrd (loop)/boot/x86_64/loader/initrd
  }

cool idea!