LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Booting of raw ISO from GRUB/LILO (though preferably GRUB) (https://www.linuxquestions.org/questions/linux-software-2/booting-of-raw-iso-from-grub-lilo-though-preferably-grub-367901/)

Orkie 09-28-2005 02:42 PM

Booting of raw ISO from GRUB/LILO (though preferably GRUB)
 
Does anybody know how (/ if it is possible) to boot a raw ISO file using GRUB or LILO (though I would prefer to use GRUB since that is what I already have installed). I have found some references to a 'bootfrom=' command for GRUB connected to booting KNOPPIX but it seems to just be for KNOPPIX. I would like to boot ISOs for many OSs without burning them to a CD.

Thanks

mickyg 09-29-2005 07:18 AM

I don't think you can because the boot loaders don't refer to a mounted device, in the conf files they use /dev/hda1 instead of / so I don't see how you would be able to reference an ISO on a hard drive without first mounting it.

Having said that, looking at this excert from the knoppix cheatcodes:

knoppix bootfrom=/dev/hda1/KNX.iso Access image, boot from ISO-Image. ***)

you might be able to try the boot option /dev/hda1/whatever.iso providing your iso in on the root of hard drive hda1.

Give it a go, it'll either work, or it won't.


Let us know if it did.

bobbrandt 07-03-2007 07:52 AM

I am doing the same thing, I have a number of small ISOs that I want to use grub on a USB key to launch. That way I can select the ISO I want to run from the grub menu.

I found a few references that gave the following grub code:

grub> map (hdX,Y)/your.iso (hdZ)
grub> map --rehook
grub> chainloader (hdZ)+1
grub> rootnoverify (hdZ)
grub> boot

Problem is I can't find any documentation an what the --rehook switch is (in fact my grub doesn't like it at all)
The next problem is that it doesn't work!

Does anyone else have any ideas?

I didn't think this would be so hard!

Bob

McStarfighter 08-05-2007 04:07 PM

Hello to all,

I search a solution for the same problem and will be very happy to hear something about this.

gnuzilla 10-18-2007 11:39 PM

bootfrom
 
the
"bootfrom=/home/user/foo/bar.iso"

would be the correct way to do this
you have to put in the kernal line

FoU 10-20-2007 10:26 AM

could you explain it thorougly???

McStarfighter 10-21-2007 04:30 AM

Argh... the bootfrom parameter is only possible for KNOPPIX and his derivates. SLAX i.E. hasn't this option ...

bigrigdriver 10-21-2007 08:18 AM

Some three or four years ago I read an atricle suggesting a possible way to boot a liveCD iso from the hard drive. I haven't tried it yet; it's in my *to do one of these days* folder.

1) create a cd sized partition (700 gb or slightly larger) or a dvd sized partition (4.5 gb or thereabouts).

2) format the partition iso9660 (in essence, creating a cd disk on the hard drive).

3) burn the iso to the new partition just as you would burn to cd, specifying cdrom=/dev/hdX,Y (the partition on the drive instead of the cd drive).

4) add an entry in your grub conf file to point the the new partition, something like:
title some_live_cd
root (hdX,Y) # where X,Y is the partition you just created)
chainloader +1

On reboot, you should see the entry for the iso in your grub menu. Grub *should* pass the boot process off to the bootloader in the iso image, resulting in the iso booting just as though it were a livecd in the cd drive.

I repeat: I haven't tried it yet. But, on the surface, it looks like it should work.

If that fails, here is an alternative method to try:
http://www.linuxquestions.org/questi...out-cd-592527/

philip_rhoades 11-26-2008 07:39 AM

Booting of raw ISO from GRUB/LILO (though preferably GRUB)
 
Quote:

Originally Posted by bigrigdriver (Post 2931546)
Some three or four years ago I read an atricle suggesting a possible way to boot a liveCD iso from the hard drive. I haven't tried it yet; it's in my *to do one of these days* folder.

1) create a cd sized partition (700 gb or slightly larger) or a dvd sized partition (4.5 gb or thereabouts).

2) format the partition iso9660 (in essence, creating a cd disk on the hard drive).

3) burn the iso to the new partition just as you would burn to cd, specifying cdrom=/dev/hdX,Y (the partition on the drive instead of the cd drive).

4) add an entry in your grub conf file to point the the new partition, something like:
title some_live_cd
root (hdX,Y) # where X,Y is the partition you just created)
chainloader +1

On reboot, you should see the entry for the iso in your grub menu. Grub *should* pass the boot process off to the bootloader in the iso image, resulting in the iso booting just as though it were a livecd in the cd drive.

I repeat: I haven't tried it yet. But, on the surface, it looks like it should work.

If that fails, here is an alternative method to try:
http://www.linuxquestions.org/questi...out-cd-592527/


How is 2) done?

Also, in 3), "cdrom=/dev/hdX,Y" is not a valid wodim switch.

Ideally, it would be much cleaner if "bootfrom=/home/user/foo/bar.iso" was available in standard grub . .

BTW, I used your alternative method - thanks!

Phil.

croog 12-05-2008 02:53 AM

I have successfully booted from an iso image, thanks to LFS. I'm trying to figure out how to apply what I did for the LFS-Live cd to another iso. according to LFS-Live documentation
Quote:

BOOTING FROM ISO IMAGE

If you want to boot this CD on a computer without a CD-ROM drive, follow the steps below.

Store the ISO image of this CD as a file on a partition formatted with one of the following filesystems: vfat, ntfs, ext2, ext3, ext4, jfs, reiserfs, reiser4, xfs

Copy the boot/isolinux/{linux,initramfs_data.cpio.gz} files from the CD to your hard disk

Configure the boot loader to load “linux” as a kernel image and “initramfs_data.cpio.gz” as an initrd. The following parameters have to be passed to the kernel:

rw root=iso:/dev/XXX:/path/to/lfslivecd.iso rootfstype=fs_type

where /dev/XXX is a partition where you stored the LiveCD image, and fs_type is the type of the filesystem on that partition. You may also want to add “rootflags=…” option if mounting this partition requires special flags.
I don't know what types of files to look for in an iso to use as an 'initrd 'or 'kernel image'
If this means enough to you for you to use the same method on another bootable iso, please explain what it means.:)

Btw LFS is Linux From Scratch you can check it out at www.linuxfromscratch.org

Windows to Linux 12-25-2008 07:57 PM

Hey, philip rhoades!

I believe that the X in your last quote refereed to which hard disk drive, and Y was which partition of the disk

Example: hda1, the first disk and its first partition (known to windows as C)(non-IDE drives are refereed to as sdX,Y), hda2, the 1st disk and it's 2nd partition (a common place to put Linux on a dual-boot system), hdb6, the second hard disk and its 6th partition, hde1, the 5th disk and its first partition

the letter refers to which disk of its type, a=first, b=second, c=third, ect.
the number is which partition of the disk (don't know what a partition exactly is, ask someone else)

philip_rhoades 12-26-2008 02:40 AM

"Windows to Linux",

I know all that - what are you getting at? I said the "cdrom=. . ." line was not a valid wodim command . .

Regards,

Phil.

QBall2U 05-03-2009 11:39 PM

Quote:

Originally Posted by philip_rhoades (Post 3387446)
"Windows to Linux",

I know all that - what are you getting at? I said the "cdrom=. . ." line was not a valid wodim command . .

Regards,

Phil.

He is saying that, "cdrom=/dev/hdX,Y" would be "cdrom=/dev/hda1" or "cdrom=/dev/sda1" or whatever your cdrom or dvdrom drive letter and partition number is...you need to replace the 'X' with 'a' or 'b' or 'c', and replace the 'Y' with a number. Your cdrom or dvdrom drive designation changes with almost every linux distro; they usually follow a format such as: hda1 ... hda2 ... etc. for the first hard drive, hdb1 ... hdb2 ... hdb3 ... etc. for the second hard drive, etc. and for cdrom/dvdrom drives it would be like: sda1 ... sda2 ... sdb1 ... sdb2 ... sdc1 ... sdc2 ... etc. where the 'sd' means 'scsi-drive or disc'.

And, from what I gather of what _you_ are saying, that you substituted the drive letter and partition number and yet the switch (cdrom=/dev/sda1 or whatever your cdrom's designation is) does not work?

[EDIT]
I think that I see why the '"cdrom=/dev/hdX,Y" doesn't work ... you need to change the '/dev/hdX,Y' to '/dev/sda1' - - what I mean is, change the 'hd'. 'hd' refers to hard drive, not cdrom or dvdrom drive! Check with the distro which drive designation it uses for a cdrom or dvdrom drive...it will NOT be 'hd'! ;)

philip_rhoades 11-12-2009 07:36 PM

Quote:

Originally Posted by QBall2U (Post 3529094)
He is saying that, "cdrom=/dev/hdX,Y" would be "cdrom=/dev/hda1" or "cdrom=/dev/sda1" or whatever your cdrom or dvdrom drive letter and partition number is...you need to replace the 'X' with 'a' or 'b' or 'c', and replace the 'Y' with a number. Your cdrom or dvdrom drive designation changes with almost every linux distro; they usually follow a format such as: hda1 ... hda2 ... etc. for the first hard drive, hdb1 ... hdb2 ... hdb3 ... etc. for the second hard drive, etc. and for cdrom/dvdrom drives it would be like: sda1 ... sda2 ... sdb1 ... sdb2 ... sdc1 ... sdc2 ... etc. where the 'sd' means 'scsi-drive or disc'.

And, from what I gather of what _you_ are saying, that you substituted the drive letter and partition number and yet the switch (cdrom=/dev/sda1 or whatever your cdrom's designation is) does not work?

[EDIT]
I think that I see why the '"cdrom=/dev/hdX,Y" doesn't work ... you need to change the '/dev/hdX,Y' to '/dev/sda1' - - what I mean is, change the 'hd'. 'hd' refers to hard drive, not cdrom or dvdrom drive! Check with the distro which drive designation it uses for a cdrom or dvdrom drive...it will NOT be 'hd'! ;)


You misunderstand - I said you can't use the "cdrom= . . " line AT ALL because it is not a WODIM command . .

Phil.

hobbes1069 05-14-2010 08:21 AM

Quote:

Originally Posted by McStarfighter (Post 2848902)
Hello to all,

I search a solution for the same problem and will be very happy to hear something about this.

I think I have found a solution but have not had an opportunity to test it yet. There is a program called "memdisk" that is part of the syslinux project and is used to load floppy images in the System Rescue CD. Memdisk can work with Grub to load floppy images, ISO's, and other raw images. A sample grub entry may look like this:

title Memdisk Launcher
root (hd0,0)
kernel /memdisk iso
initrd /path/to/ISO/on/(hd0,0)


See the memdisk homepage[1] for more specifics.

Richard

[1] http://syslinux.zytor.com/wiki/index.php/MEMDISK

jefro 05-14-2010 04:13 PM

See pendrivelinux.com They have a how to on ways that many but not all ISO's can be booted from grub and or chainloaded.

http://www.pendrivelinux.com/boot-mu...multiboot-usb/

philip_rhoades 05-15-2010 02:32 AM

hobbes1069,

Good try but no cigar . .

On the link you gave - under "Linux":

"The majority of Linux based CD images will also fail to work with MEMDISK ISO emulation. Linux distributions require kernel and initrd files to be specified, as soon as these files are loaded the protected mode kernel driver(s) take control and the virtual CD will no longer be accessible. If any other files are required from the CD/DVD they will be missing, resulting in boot error(s).

Linux distributions that only require kernel and initrd files function fully via ISO emulation, as no other data needs accessing from the virtual CD/DVD drive once they have been loaded. The boot loader has read all necessary files to memory by using INT 13, before booting the kernel."

Which corresponds to my results:

F12-i686-Live.iso - hangs immediately with "-" prompt
F13-Beta-i686-Live.iso - hangs immediately with "-" prompt
RCDx86_297.iso - WORKS!
elive_2.0_Topaz_new-kernel_up002.iso - hangs immediately with "-" prompt
geexbox-1.2.4-en.i386.glibc.iso - gets part way into install - problem with reading CD
gparted-live-0.5.2-9.iso - gets part way into install - loops looking at HD partitions
puredyne-911-carrot_and_coriander-CD-i386.iso - hangs immediately with "-" prompt


Phil.

hobbes1069 05-17-2010 07:55 AM

Yup, I found that later. The only thing I've been able to do (for System Rescue CD) is copy the contents into my /boot partition and setup my main system Grub to load each one individually, which I was trying to avoid. I didn't want to clutter my main grub menu.

The tools I use most besides the actual system rescue program is MHDD and Memtest86 so I have only included those in my menu.

Richard

jefro 05-17-2010 03:24 PM

http://www.pendrivelinux.com/boot-mu...multiboot-usb/

philip_rhoades 05-17-2010 08:38 PM

jefro,

Two obvious problems for me:

1. I don't have a Windows machine (really!) - I haven't had convenient access to one since I finished my last consulting job at the end of 2007 . . (I will try WINE to see if that works).

2. Fedora 12/13 are not listed - these are capable of having USB images created from the ISOs by using dd directly to the USB so the ISOs (so called HYBRID images) - are different ISOs to most other distros and I guess they don't work in this setup? I will try 13 and see . .

Thanks,

Phil.

jefro 05-18-2010 04:40 PM

Half of the how-to involve linux.

Not all ISO's will be possible at this time to boot directly from grub and/or grub4dos.

At the bottom of that page it has links to how it made iso's bootable and more insight to how to do what you want.

See these links.
http://diddy.boot-land.net/grub4dos/files/map.htm#hd32
http://www.pendrivelinux.com/README_GRUB4DOS.txt
http://www.gnu.org/software/grub/man...D_002dROM.html
http://www.boot-land.net/forums/inde...showtopic=5041
http://www.911cd.net/forums//index.p...opic=8955&st=0
http://geekdeck.wordpress.com/2010/0...-other-things/
http://www.panticz.de/MultiBootUSB

Versidyne 08-08-2011 03:11 AM

Kernel
 
You could just make a simple kernel that would boot your ISO Images.

philip_rhoades 08-08-2011 08:43 AM

Booting of raw ISO from GRUB/LILO (though preferably GRUB) Reply to Thread
 
Quote:

You could just make a simple kernel that would boot your ISO Images.
More details?

Thanks,

Phil.

sonnettie 07-23-2013 09:40 AM

did u get it?
 
did anyone find out how to do this for windows isos?

szboardstretcher 07-23-2013 09:42 AM

eh,.. please make a new thread with a new question! don't mess with these necro threads.

jefro 07-23-2013 02:40 PM

sonnettie, unfortunately this post started in 2007. A lot has changed. Grub and other types based on grub might be used to boot to a standard iso image. Grub4dos Grub4NT and maybe Grub24dos would work. There still exists a few issues. One is some disk images can't be booted directly. Some computers may have issues.

What are you wanting to do?

By the way, how about posting this on a new thread please.

bscholt22 07-26-2013 02:14 PM

this worked for me.

1. Create a bootable partition on a usb
2. mount iso as loopback
3. cp isolinux folder from loopback to root of usb
4. cp images folder from loopback to root of usb
5. move isolinux.cfg to syslinux.cfg
6. umount
7. syslinux <device>
8. mount
9. grub-install --root-directory=<location of mounted device> <device>
10. vim /<location of mounted device/boot/grub/grub.conf

default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
title <title> (hd0,0)
root (hd0,0)
kernel /vmlinuz
initrd /initrd.img

funtoos 12-15-2013 09:36 PM

If you loop mount the ISO and find that it uses syslinux for boot, you will find a .img in the syslinux folder. Copy that to your boot device (your GRUB root). Now, use the memdisk trick using that .img file, it will boot fine.

funtoos 12-15-2013 09:37 PM

Quote:

Originally Posted by bscholt22 (Post 4997433)
this worked for me.

1. Create a bootable partition on a usb
2. mount iso as loopback
3. cp isolinux folder from loopback to root of usb
4. cp images folder from loopback to root of usb
5. move isolinux.cfg to syslinux.cfg
6. umount
7. syslinux <device>
8. mount
9. grub-install --root-directory=<location of mounted device> <device>
10. vim /<location of mounted device/boot/grub/grub.conf

default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
title <title> (hd0,0)
root (hd0,0)
kernel /vmlinuz
initrd /initrd.img

You are converting an ISO to a USB drive boot. I think the question was about booting the contents of ISO using the existing GRUB install.


All times are GMT -5. The time now is 09:56 PM.