LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Anyone tried grub2 to boot of an iso? (https://www.linuxquestions.org/questions/linux-newbie-8/anyone-tried-grub2-to-boot-of-an-iso-741740/)

niravshah 07-21-2009 12:40 PM

Anyone tried grub2 to boot of an iso?
 
Hi

Has anyone tried and has been successful in installing grub2 to boot of an iso .
I read that it is possible but could not get it to work.
I am just wondering if its even possible to boot an iso from a flash drive using grub2.

pljvaldez 07-21-2009 01:25 PM

I haven't tried it, but here's a recent set of directions someone made that appears to work.

Hopefully drive lettering changes don't cause a problem. I assume grub2 will be referencing the USB drive regardless of whether it is /dev/sdb or /dev/sdc, etc.

niravshah 07-21-2009 01:58 PM

Quote:

Originally Posted by pljvaldez (Post 3615507)
I haven't tried it, but here's a recent set of directions someone made that appears to work.

Hopefully drive lettering changes don't cause a problem. I assume grub2 will be referencing the USB drive regardless of whether it is /dev/sdb or /dev/sdc, etc.

Well this helped me a lot but the only thing i could not figure out why is the linux and initrd entry different for each iso
What i mean is how should I figure out that ?
Should i put the same thing that is there in isolinux.conf file?????

linus72 07-21-2009 02:44 PM

Yes
that's basically right
you gotta copy the kernel and initrd from the iso to usb
whereever the kernel/initrd are at in the iso, then re-create that same folder

like, if kernel initrd is in /boot folder
then put kernel initrd in /boot folder of usb

to see which kernel/initrd are in the iso
make a folder to mount the iso on named "mnt"
make a folder to copy the kernel intrd, etc to from iso, named iso
become root and
mount the iso

"mount -o loop name-of-iso.iso mnt"
now you can llok in the folder "mnt" and the contents of the iso will be there

to copy kernel/initrd from iso
"cp -a mnt/kernel-name iso"
copy kernel to folder iso

just remember to UNMOUNT the mnt folder
"umount mnt"

niravshah 07-21-2009 04:19 PM

Quote:

Originally Posted by linus72 (Post 3615605)
Yes
that's basically right
you gotta copy the kernel and initrd from the iso to usb
whereever the kernel/initrd are at in the iso, then re-create that same folder

like, if kernel initrd is in /boot folder
then put kernel initrd in /boot folder of usb

to see which kernel/initrd are in the iso
make a folder to mount the iso on named "mnt"
make a folder to copy the kernel intrd, etc to from iso, named iso
become root and
mount the iso

"mount -o loop name-of-iso.iso mnt"
now you can llok in the folder "mnt" and the contents of the iso will be there

to copy kernel/initrd from iso
"cp -a mnt/kernel-name iso"
copy kernel to folder iso

just remember to UNMOUNT the mnt folder
"umount mnt"

yes yes yes !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

I got it to work man
I tried it with ubuntu ISO and it worked

Now i am going to try with the iso i have hopefully that will work too
this sounds pretty awesome

Thanks to this forum now i atleast know that this is possible

I still might need ur help below is the isolinux.cfg file content of my iso


default linux
prompt 1
timeout 600
display boot.msg
F1 boot.msg
F2 options.msg
F3 general.msg
F4 param.msg
F5 rescue.msg
label linux
kernel vmlinuz
append initrd=initrd.img
label text
kernel vmlinuz
append initrd=initrd.img text
label bnc
kernel vmlinuz
append initrd=initrd.img ks=cdrom:/bnc.cfg
label rdc
kernel vmlinuz
append initrd=initrd.img ks=cdrom:/rdc.cfg
label local
localboot 1
label memtest86
kernel memtest
append -
----------------------------------------------------------------------
I know this is pretty complex but how can i get this to work ?
or can i get this file itself to boot??

linus72 07-21-2009 04:52 PM

lol
so that's good huh?

You wanna try a distro that will boot from iso using grub or grub2?
?

so, what do you wanna know about the isolinux.cfg?

you using a fat32 usb or ext3?

niravshah 07-21-2009 04:55 PM

Quote:

Originally Posted by linus72 (Post 3615605)
Yes
that's basically right
you gotta copy the kernel and initrd from the iso to usb
whereever the kernel/initrd are at in the iso, then re-create that same folder

like, if kernel initrd is in /boot folder
then put kernel initrd in /boot folder of usb

to see which kernel/initrd are in the iso
make a folder to mount the iso on named "mnt"
make a folder to copy the kernel intrd, etc to from iso, named iso
become root and
mount the iso

"mount -o loop name-of-iso.iso mnt"
now you can llok in the folder "mnt" and the contents of the iso will be there

to copy kernel/initrd from iso
"cp -a mnt/kernel-name iso"
copy kernel to folder iso

just remember to UNMOUNT the mnt folder
"umount mnt"


i get error saying "you may need to load the kernel first"
my grub.cfg looks like this

menuentry "nirav rpd" {
loopback loop /boot/iso/rpd_nirav.iso
linux (loop)/isolinux/vmlinuz --
initrd (loop)/isolinux/initrd.img
}

linus72 07-21-2009 04:57 PM

what iso is it?
some distro's won't run from usb

where are the "append" options??

niravshah 07-21-2009 04:58 PM

Quote:

Originally Posted by linus72 (Post 3615715)
lol
so that's good huh?

You wanna try a distro that will boot from iso using grub or grub2?
?

so, what do you wanna know about the isolinux.cfg?

you using a fat32 usb or ext3?

i am using grub2
how do i get the exact same option od isolinux.cfg into grub
i mean when i boot from grub it should appear as if i have booted for a bootable dvd made from the iso

i m using ext3 usb

linus72 07-21-2009 05:17 PM

ok
to CONVERT a isolinux.cfg entry to a menu.lst grub entry


puppy isolinux.cfg entry
Code:

label puppyr
menu label RescuePuppy49 RestoreSave
kernel vmlinuz
append initrd=initrd.gz pmedia=cd pfix=copy

puppy grub menu.lst entry

Code:

title RescuePuppy49 RestoreSave
root (hdx,x)
kernel /vmlinuz pmedia=cd pfix=copy
initrd /initrd.gz

you must move the "append" line in isolinux.cfg to the kernel line in menu.lst
so, replace

Code:

label puppyr
menu label RescuePuppy49 RestoreSave

with this

Code:

title RescuePuppy49 RestoreSave
and then place the "kernel options/bootcodes" at the kernel line
not the initrd line

isolinux.cfg kernel line

Code:

kernel vmlinuz
grub menu.lst kernel line

Code:

kernel /vmlinuz pmedia=cd pfix=copy
dig?

niravshah 07-21-2009 05:38 PM

Quote:

Originally Posted by linus72 (Post 3615749)
ok
to CONVERT a isolinux.cfg entry to a menu.lst grub entry


puppy isolinux.cfg entry
Code:

label puppyr
menu label RescuePuppy49 RestoreSave
kernel vmlinuz
append initrd=initrd.gz pmedia=cd pfix=copy

puppy grub menu.lst entry

Code:

title RescuePuppy49 RestoreSave
root (hdx,x)
kernel /vmlinuz pmedia=cd pfix=copy
initrd /initrd.gz

you must move the "append" line in isolinux.cfg to the kernel line in menu.lst
so, replace

Code:

label puppyr
menu label RescuePuppy49 RestoreSave

with this

Code:

title RescuePuppy49 RestoreSave
and then place the "kernel options/bootcodes" at the kernel line
not the initrd line

isolinux.cfg kernel line

Code:

kernel vmlinuz
grub menu.lst kernel line

Code:

kernel /vmlinuz pmedia=cd pfix=copy
dig?


its a RHEL distro with my software in it
Also did u see my isolinux.cfg file its just kernel line and in append line it has initrd = initrd.img


Also where if i use menu.lst how can i use the loop option for iso that i absolutely want.

niravshah 07-22-2009 11:32 AM

Quote:

Originally Posted by niravshah (Post 3615767)
its a RHEL distro with my software in it
Also did u see my isolinux.cfg file its just kernel line and in append line it has initrd = initrd.img


Also where if i use menu.lst how can i use the loop option for iso that i absolutely want.

?????????????

anandogc 08-03-2010 09:53 AM

booting Ubuntu 10.04 iso using grub2
 
I use this in grub.cfg to boot an Ubuntu 10.04 iso
menuentry "Ubuntu 10.04 Live ISO" {
loopback loop (hd0,4)/ISO/ubuntu-10.04-desktop-i386.iso
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/ISO/ubuntu-10.04-desktop-i386.iso file=(loop)/preseed/ubuntu.seed quiet splash --
initrd (loop)/casper/initrd.lz
}


All times are GMT -5. The time now is 11:30 PM.