InstallingOrBootingUsingIsoFile

Why this method?

Because I have a thin laptop that can't boot from my PCMCIA CD drive (I even tried SmartBootManager which is supposed to support this PCMCIA CD booting). Obviously, I can boot the laptop via net as I explained on EdubuntuViaNetBoot

If you need to install any developing version of Ubuntu or flavours, usually Developers do not recommend to use APT for such purposes. Then, net booting is a good idea or even this howto.

To sum up, this howto is good for you if:

  1. You want to test a LiveCd but you can't boot from CD drive.

  2. You want to install a distro but you can't boot from CD drive.
  3. All the above alternatives but you don't want to burn a CD.


Table Of Contents

Using a distro ISO file to boot/install via GRUB

Yes, it is possible. I have found people stating it is not possible and others stating it is possible.

So, I had to give it a try.

The idea is very simple:

Short quick version

  1. Get an distro.ISO file into your /home or wherever

  2. Get a free partition

  3. Mount the free partition

  4. Mount the distro.ISO

  5. Copy all files and dirs from distro.ISO (already mounted) to the mounted free partition

  6. Set GRUB to be able to boot from ex-free partition

  7. Boot and enjoy

Hardware used

  • Fujitsu Lifebook B2175
  • Celeron 500 MHz
  • 256 MB of Ram
  • 20 GB of HD
  • a free partition 1 (I recommend 1 GB so we can copy all the iso file to it)

  • a free partition 2 (at least 2.6 GB depending on the requirements of the distro of your choice)

Software used

  • Ubuntu/Edubuntu system
  • GRUB (default)
  • Elive_0.4.2.iso (we could use any distro.iso file)

The Procedure. Few steps

Get the iso file from the distro you want.

In my case, I used Elive_0.4.2.iso just to give e17 a try and because I know DanieleFavara (aka, nomed at #dsslive and #xubuntu) and Thanatermesis (from #elive) have worked very closely and hard to offer this very cool metadistro.

Create and/or Check you have 2 partitions.

You can use fdisk -l to see your current partitions and harddisks available, and use tools like cfdisk to create/delete/resize partitions.

Please, accept my apologies for not including information on how to use cfdisk or similar tools, but this howto is intended to solve a very specific need, and I am very sure you will find info about paritioning in this very wiki or at Google.

What I used is 2 partitions:

  1. /dev/hda7 --> 2.8 GB (I will install Elive here once I am convinced I like its performance)

  2. /dev/hda8 --> 1 GB

So, for the rest of this howto, just replace the partition numbers for the ones you are actually using Smile :)

Create a couple dirs so we can mount what we'll need.

For this howto, I have chosen /mnt/IsoFile and /mnt/Target

$ sudo mkdir /mnt/IsoFile
$ sudo mkdir /mnt/IsoGrub

Mount the distro.iso file [Alternative 01]

We need to mount the iso file to a directory we can read and use

$ sudo mount -o loop Elive_0.4.2.iso /mnt/IsoFile

Mount the distro CD in the CD-Drive [Alternative 02]

$ sudo mkdir /cdrom
$ sudo mount /dev/sr0 /cdrom
  • Info <!> Elive 0.4.2 does not do automounting, and my PCMCIA CD-Drive is recgnized as sr0

Mount target partition and copy all files and dirs to it.

Remember that later on, we will tell GRUB to read files in a partition and boot from it.

$ sudo mount /dev/hda8 /mnt/IsoGrub
$ cd /mnt/IsoFile
$ cp -a * /mnt/IsoGrub

Edit GRUB file (menu.lst)

This step is very simple but you have to keep in mind that you need to replace the info according to your own settings.

$ nano /boot/grub/menu.lst
  • yeah, you could use a different editor Wink ;)

Add lines like these...

### END DEBIAN AUTOMAGIC KERNELS LIST

title   Elive 0.4.2 LiveCd
kernel  (hd0,7)/boot/vmlinuz root=/dev/hda8 BOOTMEDIA=cd
initrd  (hd0,7)/boot/miniroot.gz
boot
  • Warning /!\ remember that hd0,7 corresponds to 1st master IDE Harddisk and to partition #8 (yeah, 0 is #1)

Usually, for initrd we would use a file like initrd.img but in the case of Elive, I found none under a similar name but miniroot.gz.

After editing and saving (don't forget to save!), you need to update GRUB...

$ sudo update-grub

Reboot and enjoy

If you did not get any errors, then we're done to reboot and enjoy!. Obviously, when rebooting, press Esc key as soon as you see the grub message/line and select Elive 0.4.2 LiveCd (or whatever you wrote in menu.lst).

If you want to run the distro installer

In case you are also trying a LiveCD distro that lets you install from it onto a partition, then you can specify /dev/hda7 for such purpose.

Of course, if you are trying an install CD (like the one shipped by Canonical), when rebooting, you will run the standard installation procedure, just like booting from CD.

Comments? Observations?

Send an email to mhz AT ubuntu DOT com or just add it to this last section.

I tried Xubunt Dapper

title Xubuntu Dapper LiveCD
kernel (hd0,7)/casper/vmlinuz root=/dev/hda8 BOOTMEDIA=cd
initrd (hd0,7)/casper/initrd.gz
boot

Info <!> it did boot ok BUT I only got to a Busy Box (ash) Sad :(

InstallingOrBootingUsingIsoFile (last edited 2008-08-06 16:20:55 by localhost)