ISO Booting with Grub 2

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post please read how to get help
Post Reply
linuxwhacko
Level 1
Level 1
Posts: 5
Joined: Thu Feb 24, 2011 11:46 am

ISO Booting with Grub 2

Post by linuxwhacko » Thu Feb 24, 2011 11:51 am

edited the 40_custom file in /etc/grub.d

Code: Select all

#!/bin/sh
echo "Adding 40_custom.">&2
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.

menuentry "Lucid ISO" {
loopback loop (hd0,8)/boot/iso/Fedora-14-i386-DVD.iso
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/iso/Fedora-14-i386-DVD.iso noprompt noeject
initrd (loop)/casper/initrd.img
}
then
sudo update-grub2

after rebooting
choose Lucid ISO and got

file not found
no such disk
you need to load the kernel first

i am using Linux mint 10 and its on sda8.

used the link
http://ubuntuforums.org/showthread.php?t=1549847
for the help

do i need to change the file permissions of boot and casper folder
or there is some other problem ?

Habitual
Level 13
Level 13
Posts: 4870
Joined: Sun Nov 21, 2010 8:31 pm
Location: 0.0.0.0

Re: ISO Booting with Grub 2

Post by Habitual » Thu Feb 24, 2011 12:09 pm


linuxwhacko
Level 1
Level 1
Posts: 5
Joined: Thu Feb 24, 2011 11:46 am

Re: ISO Booting with Grub 2

Post by linuxwhacko » Thu Feb 24, 2011 12:35 pm

thanks for the reply Habitual
but the link you gave is for grub legacy and i am using grub 2

it was not of much help

Habitual
Level 13
Level 13
Posts: 4870
Joined: Sun Nov 21, 2010 8:31 pm
Location: 0.0.0.0

Re: ISO Booting with Grub 2

Post by Habitual » Thu Feb 24, 2011 2:24 pm

I believe that the technique described there contains a clue to what needs to be done to make this work.

I am not certain that

Code: Select all

loopback loop (hd0,8)/boot/iso/Fedora-14-i386-DVD.iso
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/iso/Fedora-14-i386-DVD.iso noprompt noeject
In your 40_custom will work.

"Copy the files called initrd.img and vmlinuz to your /boot directory (you will need to be root to write files to the boot directory)"
I'd copy them as initrd_fedora.img and vmlinuz_fedora to /boot and then modify the custom_40 to point to those files.

I'd try this in 40_custom:

Code: Select all

loopback loop (hd0,8)/boot/iso/Fedora-14-i386-DVD.iso
linux /boot/vmlinuz_fedora
initrd /boot/initrd_fedora.img
Found this using Google, it deals with booting an ISO with Grub2.
http://michael-prokop.at/blog/2009/05/2 ... via-grub2/
and
http://ubuntuforums.org/showthread.php?t=1549847

linuxwhacko
Level 1
Level 1
Posts: 5
Joined: Thu Feb 24, 2011 11:46 am

Re: ISO Booting with Grub 2

Post by linuxwhacko » Fri Feb 25, 2011 10:40 am

i have changed the 40_custom to this

Code: Select all

menuentry "Lucid ISO" {
loopback loop (hd0,8)/boot/iso/Fedora-14-i386-DVD.iso
linux (loop)/boot/vmlinuz boot=boot iso-scan/filename=/boot/iso/Fedora-14-i386-DVD.iso noprompt noeject
initrd (loop)/boot/initrd.img
}

still,when i choose Lucid ISO at the grub menu
the computer restarts,

what to do ?

AlbertP
Level 16
Level 16
Posts: 6719
Joined: Sun Jan 30, 2011 12:38 pm
Location: Utrecht, The Netherlands

Re: ISO Booting with Grub 2

Post by AlbertP » Fri Feb 25, 2011 11:11 am

menuentry "ISO" {
map /iso-file.iso (hd32)
root (hd32)
kernel /boot/vmlinuz arguments
initrd /boot/initrd.img
}

OR:

menuentry "ISO" {
map /iso-file.iso (hd32)
chainloader (hd32)+1
}

I am saying this from memory and it might be wrong.
Registered Linux User #528502
Image
Feel free to correct me if I'm trying to write in Spanish, French or German.

User avatar
viking777
Level 14
Level 14
Posts: 5121
Joined: Mon Dec 01, 2008 11:21 am

Re: ISO Booting with Grub 2

Post by viking777 » Fri Feb 25, 2011 11:25 am

When grub2 first come out I wrestled with its iso boot options for ages, I think I got it to boot one iso after trying about 10 in total (and I never did find out why that one worked and the others didnt). Like everything to do with grub2 it is obscure to the point of being unworkable.

If you want to have a look at an iso quickly and easily just install qemu-kvm then run

Code: Select all

kvm -m 800 -cdrom  /path to iso
It doesn't get any easier than that. the -m 800 option means you have allocated 800Mb of memory to it - adjust that to suit.

Just one word of warning though, if you use Virtualbox then kvm is not compatible with it so in order to run Vbox you have to run this command first:

Code: Select all

sudo rmmod kvm_intel
Then you can start Vbox (the module will reload next time you boot). A glitch admittedly, but a small price to pay in my opinion, and since I have learnt how good qemu-kvm is the only time I need to start Vbox is to run Windows XP and that doesn't happen much these days.
Fujitsu Lifebook AH532. Intel i5 processor, 6Gb ram, Intel HD3000 graphics, Intel Audio/wifi. Realtek RTL8111/8168B Ethernet.Lubuntu 13.10,Ubuntu12.10 (Unity), Mint16 (Cinnamon), Manjaro (Xfce).

linuxwhacko
Level 1
Level 1
Posts: 5
Joined: Thu Feb 24, 2011 11:46 am

Re: ISO Booting with Grub 2

Post by linuxwhacko » Sun Feb 27, 2011 9:04 am

viking777 thanks for reply
i tried your method
and got the message cannot find media

is there some other solution as i want to install fedora 14 using grub2 on my pc

User avatar
viking777
Level 14
Level 14
Posts: 5121
Joined: Mon Dec 01, 2008 11:21 am

Re: ISO Booting with Grub 2

Post by viking777 » Sun Feb 27, 2011 9:16 am

linuxwhacko wrote:viking777 thanks for reply
i tried your method
and got the message cannot find media

is there some other solution as i want to install fedora 14 using grub2 on my pc
Well if it can't find the media you must have typed the wrong address - I can't help you with that, you should know where you put it.
Fujitsu Lifebook AH532. Intel i5 processor, 6Gb ram, Intel HD3000 graphics, Intel Audio/wifi. Realtek RTL8111/8168B Ethernet.Lubuntu 13.10,Ubuntu12.10 (Unity), Mint16 (Cinnamon), Manjaro (Xfce).

AlbertP
Level 16
Level 16
Posts: 6719
Joined: Sun Jan 30, 2011 12:38 pm
Location: Utrecht, The Netherlands

Re: ISO Booting with Grub 2

Post by AlbertP » Sun Feb 27, 2011 9:22 am

Fedora 14 does not use Grub 2, it uses the old Grub legacy. You need to install Grub 2 manually then.
Registered Linux User #528502
Image
Feel free to correct me if I'm trying to write in Spanish, French or German.

User avatar
viking777
Level 14
Level 14
Posts: 5121
Joined: Mon Dec 01, 2008 11:21 am

Re: ISO Booting with Grub 2

Post by viking777 » Sun Feb 27, 2011 11:37 am

AlbertP wrote:Fedora 14 does not use Grub 2, it uses the old Grub legacy. You need to install Grub 2 manually then.
Wow, that surprises me I thought Fedora was supposed to be a cutting edge distro? I don't like it myself so I never take any notice of it, but if they are still using grub1 maybe I should given how I feel about grub2:D
Fujitsu Lifebook AH532. Intel i5 processor, 6Gb ram, Intel HD3000 graphics, Intel Audio/wifi. Realtek RTL8111/8168B Ethernet.Lubuntu 13.10,Ubuntu12.10 (Unity), Mint16 (Cinnamon), Manjaro (Xfce).

linuxwhacko
Level 1
Level 1
Posts: 5
Joined: Thu Feb 24, 2011 11:46 am

Re: ISO Booting with Grub 2

Post by linuxwhacko » Sun Feb 27, 2011 4:01 pm

sorry viking777,
i got a different message

fedora setup started in Qemu
but during the installation process,i got a dialog box saying:

Code: Select all

-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
                         No disks Found
--------------------------------------------------------------------------------------
              no usable disks have been found

                    ----------         -----------------------
                    --back----      ----exit installer----
                    -----------        --------------------------
-----------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------

wayne128
Level 10
Level 10
Posts: 3412
Joined: Tue Jul 13, 2010 12:15 am

Re: ISO Booting with Grub 2

Post by wayne128 » Sun Feb 27, 2011 6:33 pm

I do not have any experience using this method of boot from iso.

So just read the start of the link that said

This thread will detail how to place a menu entry in Grub 2 to allow booting an ISO file stored on your computer without a CD/DVD. Not all ISOs will work with Grub 2. The ISO must be constructed in a manner to allow this method of booting. Currently the Ubuntu family ISOs (9.10 and later), Gparted CD, Parted Live CD, and SystemRescue CD, among others, support this feature.

Since you are trying out a ubuntu procedure on Fedora, the key question is whether Fedora iso is consturcted in a manner to allow this method of booting.

Habitual
Level 13
Level 13
Posts: 4870
Joined: Sun Nov 21, 2010 8:31 pm
Location: 0.0.0.0

Re: ISO Booting with Grub 2

Post by Habitual » Sun Feb 27, 2011 8:38 pm

Code: Select all

isoinfo -d -i /path/to/filename.iso | grep bootable
isoinfo -d -i /path/to/iso will tell you plenty about the file in question.

User avatar
viking777
Level 14
Level 14
Posts: 5121
Joined: Mon Dec 01, 2008 11:21 am

Re: ISO Booting with Grub 2

Post by viking777 » Mon Feb 28, 2011 5:15 am

linuxwhacko wrote:sorry viking777,
i got a different message

fedora setup started in Qemu
but during the installation process,i got a dialog box saying:

Code: Select all

-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
                         No disks Found
--------------------------------------------------------------------------------------
              no usable disks have been found

                    ----------         -----------------------
                    --back----      ----exit installer----
                    -----------        --------------------------
-----------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------
Now I wonder if that is something to do with Fedora's LVM setup? As I said earlier Fedora is one of the few distros on Linux that I totally ignore. I have tried it in the past and at that time it insisted on using a Logical Volume setup procedure. As I don't understand LVM all that well I found this annoying (as I couldn't find a way to alter it - there probably is one, I just couldn't find it). I don't know if this still happens by default, but if it does it might have something to do with it not working in kvm. Anyway Fedora is the most boring distro in the world so you aren't missing much :lol:

EDIT. Actually that doesn't seem to be the case, this is taken from the Fedora website:
Testing ISO Images

Type, in the proper directory

$ qemu -cdrom -m 512M <isoname>.iso
But I notice they are using 'qemu' for the command not 'kvm' as I do - you could try that I suppose.

EDIT2. No that isn't going to work because if your system is the same as mine it has no command 'qemu' only 'kvm'. I give in :lol:
Fujitsu Lifebook AH532. Intel i5 processor, 6Gb ram, Intel HD3000 graphics, Intel Audio/wifi. Realtek RTL8111/8168B Ethernet.Lubuntu 13.10,Ubuntu12.10 (Unity), Mint16 (Cinnamon), Manjaro (Xfce).

AlbertP
Level 16
Level 16
Posts: 6719
Joined: Sun Jan 30, 2011 12:38 pm
Location: Utrecht, The Netherlands

Re: ISO Booting with Grub 2

Post by AlbertP » Mon Feb 28, 2011 2:55 pm

I have used Fedora in the past, what I found annoying was the small 5GB /home partition, even on a 60GB HDD, and that GParted did not support LVM's. By the way, you can boot Fedora from Mint's Grub 2. I recall you can uncheck installing Grub 1 in the installer, and just run update-grub from Mint or another Grub 2 distro to get Fedora into Grub.

The only real problem with Grub 1 that I have had, was that it only recognized Windows on /dev/sda1. Grub 2 also sees a Vista bootloader on /dev/sda4, and boots them both fine.
Registered Linux User #528502
Image
Feel free to correct me if I'm trying to write in Spanish, French or German.

User avatar
viking777
Level 14
Level 14
Posts: 5121
Joined: Mon Dec 01, 2008 11:21 am

Re: ISO Booting with Grub 2

Post by viking777 » Tue Mar 01, 2011 5:53 am

AlbertP wrote:
Grub 2 also sees a Vista bootloader on /dev/sda4, and boots them both fine.
One of its biggest problems in my opinion.

Every instance of grub2 that I have ever used on this computer has insisted that I have a windows bootloader on /dev/sda2. /dev/sda2 is a data partition and doesn't contain an operating system of any kind and never has done in its entire life. I did try it out one time and said "OK if you think that is a Windows boot loader you boot it for me". Strangely enough it couldn't, but it still insists that it is there. That is not the only reason I use grub1 still, but it is one of them.
Fujitsu Lifebook AH532. Intel i5 processor, 6Gb ram, Intel HD3000 graphics, Intel Audio/wifi. Realtek RTL8111/8168B Ethernet.Lubuntu 13.10,Ubuntu12.10 (Unity), Mint16 (Cinnamon), Manjaro (Xfce).

AlbertP
Level 16
Level 16
Posts: 6719
Joined: Sun Jan 30, 2011 12:38 pm
Location: Utrecht, The Netherlands

Re: ISO Booting with Grub 2

Post by AlbertP » Tue Mar 01, 2011 12:31 pm

You can remove an OS from /boot/grub/grub.cfg in Grub 2. When you don't run update-grub or grub-mkconfig your partition isn't added.
I think there's something written into the hidden track (the volume boot record) of the partition which is normally used for bootloaders only. Windows might have done this during install. You can format the partition but I think that's not what you want.
Registered Linux User #528502
Image
Feel free to correct me if I'm trying to write in Spanish, French or German.

User avatar
viking777
Level 14
Level 14
Posts: 5121
Joined: Mon Dec 01, 2008 11:21 am

Re: ISO Booting with Grub 2

Post by viking777 » Tue Mar 01, 2011 1:16 pm

AlbertP wrote:You can remove an OS from /boot/grub/grub.cfg in Grub 2. When you don't run update-grub or grub-mkconfig your partition isn't added.
I think there's something written into the hidden track (the volume boot record) of the partition which is normally used for bootloaders only. Windows might have done this during install. You can format the partition but I think that's not what you want.
Thank you for your reply AlbertP. I wasn't actually looking for a solution to this because I already have one - I use a grub1 boot partition to chainload all the grub2 distros. With a 2 second timeout on each grub2 menu I don't have to take any notice of what kind of trash grub2 is writing to grub.cfg . I was just using your point to illustrate my continued frustration with grub2. Just a rant really :lol: But thanks anyway.
Fujitsu Lifebook AH532. Intel i5 processor, 6Gb ram, Intel HD3000 graphics, Intel Audio/wifi. Realtek RTL8111/8168B Ethernet.Lubuntu 13.10,Ubuntu12.10 (Unity), Mint16 (Cinnamon), Manjaro (Xfce).

AlbertP
Level 16
Level 16
Posts: 6719
Joined: Sun Jan 30, 2011 12:38 pm
Location: Utrecht, The Netherlands

Re: ISO Booting with Grub 2

Post by AlbertP » Wed Mar 02, 2011 12:55 pm

A Grub 2 distro can be loaded without problem from Grub 1, you can get the kernel and initrd lines from Grub 2's grub.cfg (the kernel line in Grub 1 is named linux in Grub 2), which you can put into your grub.conf/menu.lst. You don't need chainload, it is only some slower as your computer needs to load both Grub 1 and 2.
Registered Linux User #528502
Image
Feel free to correct me if I'm trying to write in Spanish, French or German.

Post Reply

Return to “Installation & Boot”