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 03: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 08: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 08: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 05: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-19-2007 12:39 AM

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 11:26 AM

could you explain it thorougly???

McStarfighter 10-21-2007 05: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 09: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 08: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 03: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 08: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 03: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-04-2009 12:39 AM

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 08: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 09: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


All times are GMT -5. The time now is 12:53 PM.