Grub boot for .Iso image file - Complex question

Asked by Alejandro Padrino on 2010-07-04

Hello, I have two Linux Live-CD and want to boot .Iso image files from Grub on my Hard Disk. One of the .Iso images is Ubuntu 10.04, and the other .Iso image is another debian-based (K-Ubuntu) Live-CD. Both .Iso image files haves Casper and I need boot every of them using Grub. Yes, I know how boot .Iso image files from Grub, but I found next problems ...

1) Ubuntu 10.04 does not boot with Grub using .Iso image file format.

2) I can't boot at same time (selecting one of them) two debian-based Casper Live-HD copying files & folders to my Hard Disk. I was try to modify Live-CD files copied to my Hard Disk to specify other different boot folder, but this do not run (causes computer reboot).

I need one of next solutions ...

1) Boot both .Iso image files copied to my hard disk from Grub as Live-CD from my Hard Disk (USB Drive).

2) Boot both Ubuntu & K-Ubuntu folders copied to my hard disk from each Live-CD, using Grub, as Live-HD from my Hard Disk (USB Drive).

Also I have Ext-4 partition with Ubuntu 10.04 installed, but this partition boots nice.

Thank you.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu grub2 Edit question
Assignee:
No assignee Edit question
Solved by:
Alejandro Padrino
Solved:
2010-07-05
Last query:
2010-07-05
Last reply:
2010-07-05
Goh Lip (gohlip) said : #1

I assume you are using grub2. Grub-legacy would not be able to boot iso files.
I'll write below a sample grub entry to do this so you can modify for your case...

menuentry "Timon " {
search --no-floppy --label --set Mont
loopback loop /pop/maverick-alternate-amd64.iso
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/pop/maverick-alternate-amd64.iso noprompt noeject quiet splash
initrd (loop)/casper/initrd.lz
}

notes:
o search line can use normal uuid line instead of label
o if your iso files are at home, your path will look like
    /home/alejendro/maverick-alternate-amd64.iso
   instead of /pop/amverick-alternate-amd64.iso

Also, you can actually see the boot method being used by mounting the iso file like
mount -o loop xxxxxxxx.iso /mnt/xxx
In Ubuntu's case, casper is used, others may use live or plain boot. Need to check initrd file too some use .gz instead of .lz or just plain 'vmlinuz'

Another thing that may interest you is the use of 'persistent' in the linux line and a partition labelled as 'casper-rw'. This enables you to keep changes, say of updates and will 'stick' for the next reboot.

Good luck.

Alejandro Padrino (eb4bgr) said : #2

Goh Lip, thanks for faster reply. I'm not using Grub2, only use Grub2 on computer hard disk. For USB Drive (usually PenDrive) I'm using Grub4Dos 0.44. USB Drive was formatted as Fat-32. I'm making a rescue drive for computers that does not have CD-ROM, and want to include many Linux Live-CD at same USB Drive to booting all them as Live-HD. I will try your samples now.

Thank you.

peter b (b1pete) said : #3

@Alejandro Padrino

it is far from me to 'hijack' or intrude on your question but I very much liked its subject (I'm a big fan of booting .iso files under grub2) and Goh Lip's response that interest me greatly.

so, would it bother you to have some input/discussion/comments of mine on this ticket ? I'm basically interested in the 'persistent' and ....'partition labelled as 'casper-rw''...... statements on the response and finalizing an entry into lucid grub2 /etc/grub.d/40_custom file.

your answer is appreciated. TU.

Alejandro Padrino (eb4bgr) said : #4

Peter B, I'm very, very novice on Linux. I was choose change to Linux environment at recent time, and I was choose Ubuntu because is the best Linux that I found to my home purposes, but now I don't have knowledge of "persistent" & "casper-rw" partitions. You don't bother me. If you wants to put your comments/questions here, make it. This is knowledge to all us.

p.s.: please sorry for me. I need to improve on my English knowledge. I suposse that you understand my questions.

Thank you.

Alejandro Padrino (eb4bgr) said : #5

Goh Lip, Grub4Dos don't have that commands. If Grub2-Legacy doesn't allow me to boot .Iso files, I don't want use Grub2 for my USB Rescue Drive. Also was change Hard Disk MBR to Grub4Dos 0.44. Is there another way to boot, or I must wait to possible Grub3?

Thank you.

Alejandro Padrino (eb4bgr) said : #6

Goh Lip, I was found another way but don't know how make it. One sample boot for R.I.P. Linux using Grub4Dos is next ...

title R.I.P. Linux Live-HD\n\n(R)ecovery (I)s (P)ossible Linux (350 MBytes R.A.M.)
find --set-root /RIPLinux/riplinux.gz
kernel /RIPLinux/riplinux xlogin keymap=es xkeymap=es root=/dev/ram0 rw vga=0
initrd /RIPLinux/riplinux.gz
boot

I supossed that riplinux can be standard Ubuntu kernel, but need to know how create new "Ubuntu.Gz" file with Ubuntu Live-CD filesystem.

Can you help me?

Thank you.

Goh Lip (gohlip) said : #7

What's wrong with using grub2?
Why use grub4dos in linux?

"I supossed that riplinux can be standard Ubuntu kernel, but need to know how create new "Ubuntu.Gz" file with Ubuntu Live-CD filesystem." makes no sense.

Mark this as solved. Good bye.

peter b (b1pete) said : #8

@Alejandro Padrino

thank you for allowing my posts on this ticket; re ...'I'm very, very novice on Linux'.... , everybody was a novice at one time or another so don't let this feeling put you down, linux is a v fast forward looking os that prompts the regular user (the inquisitive ones) to continuously improve his/her knowledge - I'm learning all the time and v happy for it.

....'Also I have Ext-4 partition with Ubuntu 10.04 installed, but this partition boots nice.'..... it appears that you HAVE grub2 already installed - did you downgrade to grub legacy ? would you post here when lucid is up output of

grub-install -v

command ? pls run it in a terminal, for sure you now how. if the output is similar with

grub-install (GNU GRUB 1.98-1ubuntu6)

then you're booting via grub2. this allows you to get v familiar with its inner workings. pls read

http://ubuntuforums.org/showthread.php?t=1195275

that is a good source of info on grub2.

also, do you already have maverick-alternate-xxxxx.iso downloaded and its md5sum verified ? if not pls do that. all these will allow you to benefit from the answers mr Goh Lip already provided and hopefully will provide on several notes above and further addressed to below.

@Goh Lip

yes, I have/had maverick-alternate-amd64.iso already mounted on lucid /media/maverick-a2 mount point via

sudo mount -o loop /home/peter/maverick-alternate-amd64.iso /media/maverick-a2

so some of the lines in the future /etc/grub.d/40_custom file will be, - pls make corrections if needed (see below NOTES) -

loopback loop /home/peter/maverick-alternate-amd64.iso
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/home/peter/maverick-alternate-amd64.iso noprompt noeject quiet splash
initrd (loop)/casper/initrd.gz

pls NOTE : initrd.gz file and vmlinuz file is under /media/maverick-a2/install - there is no /casper folder - see below contents of /media/maverick-a2

ls /media/maverick-a2 -l
total 191
-r-xr-xr-x 1 root root 1118 2010-06-25 05:02 cdromupgrade
dr-xr-xr-x 3 root root 2048 2010-06-30 02:08 dists
dr-xr-xr-x 3 root root 2048 2010-06-30 02:08 doc
dr-xr-xr-x 3 root root 2048 2010-06-30 02:09 install
dr-xr-xr-x 2 root root 16384 2010-06-30 02:09 isolinux
-r--r--r-- 1 root root 164814 2010-06-30 02:09 md5sum.txt
dr-xr-xr-x 2 root root 2048 2010-06-30 02:08 pics
dr-xr-xr-x 3 root root 2048 2010-06-30 02:08 pool
dr-xr-xr-x 2 root root 2048 2010-06-30 02:08 preseed
-r--r--r-- 1 root root 228 2010-06-30 02:08 README.diskdefines
lr-xr-xr-x 1 root root 1 2010-06-30 02:08 ubuntu ->

Q : I don't know, would probably the path /casper above be replaced with something like /media/maverick-a2/install ?

NOTE : /casper folder exists, according to my knowledge, only on ubuntu live CD's and, indeed, it works with persistent option added to the linux line with a partition called/labeled 'casper-rw' ; the maverick-alternate-amd64.iso session will probably go straight into the install procedure as opposed to live CD session.

Q : is it possible to use 'persistent' option on linux line on maverick-alternate-amd64.iso session ? if yes then 'casper-rw' labeled partition will have to be, I'd say, in the range of 4-8GB at a minimum to be able to take a full maverick install.

I have some additional questions re ...'search --no-floppy --label --set Mont'... we'll discuss those and eventually finalize a /etc/grub.d/40_custom entry after the answers to the above.

your answer is appreciated. Thank you.

peter b (b1pete) said : #9

Mr Goh Lip

for community's good, please give Alejandro the benefit of, his words, ...'I'm very, very novice on Linux'..... it'll take time to find/learn his way into how linux community works and interacts and what the world of linux is capable of.

please keep this ticket/thread alive; hopefully it'll do him a lot of good in the future.

personally, I'm kindly asking your support in finalizing/solving this ticket in a positive note. .iso files booting is a very important subject for me (and hopefully for the community too) as stated in a previous post ...'(I'm a big fan of booting .iso files under grub2) and Goh Lip's response that interest me greatly.'...

once again, please, keep this ticket alive, for sure everybody will be thankful for solving this thread.

Thank you in advance.
peter b

Goh Lip (gohlip) said : #10

Peter, yes, you're right. There's no casper in alternate cd. Only for livecd, which is the desktop-install cd. And yes, alternate cd will not boot from this method. I used this as an example while writing out how the syntax will look like.

I was installing maverick via alternate cd and happened to use this example by mistake. As you probably know, you can upgrade to newer version of Ubuntu by mounting the alternate cd by looping and upgrade
gksu "sh /cdrom/cdromupgrade" or kdesudo "sh /cdrom/cdromupgrade".

So, no, if we cannot boot alternate cd, the use of persistent and casper-rw is moot for it. But yes, you can use this for the desktop cd.

'Mont' is the label given to the partition where the iso file is. You can of course use uuid like this..
search --no-floppy --fs-uuid --set xxxxxxxxxxxxxxxxxxxx
When typing manually, I use 'label' as frankly, who can remember uuid #, and there's always the chance of typing in wrongly.

While you can boot up using /dev/sdax or (hd0,x), I try not to as this is not reliable with mutiple disks when bios starts up.

You can also write to me direct using the launchpad facility if this gets off-topic. And, call me Goh.

Regards - Goh Lip

Alejandro Padrino (eb4bgr) said : #11

Goh Lip, don't be angry with me, I only find for solves to my boot problem. I'm sorry.

I don't want, and not be ready for, limited software features. This is one of the main reasons because I was change from Win-32 to Linux environment. Linux means for me free & unlimited.

Then I explain you: I'm making USB Rescue Drive. But I put same files from USB Rescue Drive into my hard disk primary partition, formatted as Fat-32. Ubuntu was installed in extended partition. What's wrong about Grub2? In the past I was read Grub2 features about booting .Iso files and I dislike it. I remember with your reply. Grub4Dos solves all my boot requested features.

Peter B, yes. I was install Ubuntu and it puts Grub2. I was change Grub2 with Grub4Dos.

I found the solution thanks to the boldness of a friend. This code boots Ubuntu 10.04 .Iso image from Hard Disk using Grub4Dos 0.44 ...

title Ubuntu 10.04 Linux Live-CD (.Iso)\n
find --set-root --ignore-floppies /ubuntu-10.04-desktop-i386.iso
map /ubuntu-10.04-desktop-i386.iso (0xff)
map --hook
root (0xff)
kernel /casper/vmlinuz boot=casper BOOT=casper iso-scan/filename=/ubuntu-10.04-desktop-i386.iso persistent rw quiet splash vga=0x317
initrd /casper/initrd.lz
boot

Source link (and related links) are located at <www.boot-land.net/forums/index.php?showtopic=8797>.

Thanks to all.

peter b (b1pete) said : #12

thanks Goh,

yes, acknowledged. I never tried maverick-desktop-amd64.iso that is the live CD. did you try it ?

it is an iron clad house policy to never upgrade a good installed and working ubuntu release. I always used fresh installs to new partitions of the final releases. I'm quite interested to use also alpha and beta releases but avoid installs to HD, for sure you know why.

with grub2 the persistent install of xxxxxxxx.iso to some other media than HD is indeed a vv nice and attractive solution that I'm planning to use extensively in the future for the alpha and beta releases. maverick desktop alpha2 live CD .iso will probably be the first. it'll potentially leave the already installed good working lucid with its booting alone except a v small well thought out addition script to /etc/grub.d/40_custom entry.

Q pls : would you be interested in achieving such a feat ? I'm quite interested to participate in getting this 40_custom file above implemented and working.

- if yes, how would you prefer to continue and keep this thread alive ? I'm referring to ....'gets off-topic'....

 Alejandro said that as far as he is concerned his question was solved (by him using other means). or

- would you prefer, either me opening a new ticket with direct request to you in the title that will basically pick up our discussion from this point ? or you, opening a brand new ticket/thread with booting .iso files ? and continue our discussion there ?

thank you.