You are on page 1of 2

For U & Me  |  Let’s Try

Stop
Wasting CDs
Install Linux Straight from an ISO
You download the brand new Debian 5 (when it’s released) after waiting for so
many months, and discover you don’t have a single blank DVD to burn the ISO
image! Why worry, when there’s a simple way out!

G
NU/Linux comes in many is that you should have a pre-installed
different flavours, apart GNU/Linux system—which you already
from the fact that each have, otherwise where did you download
individual distro has a new the ISO image from?
release almost every six months, if All Linux installers use two files to boot
not less. I have a habit of trying a computer: a kernel and an initial root
out every new version the filesystem -- also known as the RAM disk
moment it comes out, or initrd image. This initrd image contains
and I’m sure many of a set of executables and drivers that are
U X
LIN you do too. needed to mount the real root filesystem.
Now, let’s assume When the real root filesystem mounts, the
you have downloaded initrd is unmounted and its memory is
a new version of a distro freed. These two files are named differently
and are in the mood to try it out in different distros—refer to Table 1 for
right away. It’s past midnight and you their names.
realise that you’ve run out of blank The first thing you need to do is place
CDs/DVDs. So you will have the ISO image(s) inside a directory. Some
to wait till the morning installers are not able to read the ISO
when the shops open, images if they are placed inside a directory.
to be able to burn the So, just to be on the safe side, place them in
distro image in order the root of the file system. The partition on
to install it. I’m sure the hard disk holding the ISO files must be
a lot of us often face formatted with the ext2, ext3 or vfat files
this problem. In this system.
article I’ll share a In our example, let’s go ahead and do
simple trick by which it with an old Fedora 9 ISO image. Follow
you can install the new these steps to begin with:
distro without burning it to a
CD/DVD. The only requirement # mkdir /fedora

24  |  March 2009  |  LINUX For You  |  www.openITis.com
Let’s Try  |  For U & Me

# cp /home/sandeep/Fedora-9-i386-DVD.iso /fedora/fedora9.iso Names of kernel and RAM disk images in some
popular distros
Now extract the kernel and initrd files from the ISO Linux OS Kernel path Ram disk path
image and place them in the same directory in which Fedora /isolinux/vmlinuz /isolinux/initrd.img
you placed the ISO. You can use File Roller, the archive openSUSE /boot/i386/loader/ /boot/i386/loader/
manager for GNOME, to extract the files. Just right linux initrd
click on the ISO and select Open with File Roller. It Mandriva /i586/isolinux/alt0/ /i586/isolinux/alt0/all.
displays the contents of the ISO image. Then navigate vmlinuz rdz
to the isolinux directory—in Fedora 9 these two files are Ubuntu /casper/vmlinuz /casper/initrd.gz
placed inside the isolinux directory; it’s often different
Debian /install.386/vmlinuz /install.386/initrd.gz
for other distros, so please refer to Table 1 for the paths.
RHEL5/ /isolinux/vmlinuz /isolinux/initrd.img
Select the kernel and initrd files, and extract them to
CentOS5
the location where your ISO image exists.
Table 1
The second method is to mount the ISO image and
extract the files. Run the following commands to do this:

# mount -o loop /fedora/fedora9.iso /media/iso
# cd /media/iso/isolinux
# cp vmlinuz initrd.img /fedora/

I have mounted the ISO image without providing
the -t iso9660 option (to specify the type of media as an
ISO filesystem). It worked for me. If the above mount
command doesn’t work, do add this option along with
the rest of the mount command above.
Note: Fedora 10 has introduced a change in
the Anaconda installer. So, in addition to the
vmlinuz and initrd.gz files, you will also need to copy the
images/install.img file, create a directory called /fedora/ Figure 1: The Install Fedora 9 Grub menu entry
images, and place the install.img file there.
Now, it’s time to edit the /boot/grub/menu.lst file Now you are ready
on the system I’m currently using—Ubuntu 8.10. Note to install your new
that this is the location of the Grub menu in almost Linux distro directly
all distros, except for Fedora/Red Hat, where it’s called from the hard disk
/boot/grub/grub.conf. Append the following entry there: without the need
for a CD/DVD drive.
title Install Linux Reboot your system
root (hdX,Y) and select the ‘Install
kernel /distro/Linux_kernel Fedora 9’ entry from
initrd /distro/Ram_disk your GRUB menu.
Figure 1 shows
Figure 2: Select the hard drive for ‘Installation
In this case… what the GRUB Method’
 'title' is the name you want to display in your GRUB menu looks like after
menu rebooting my system.
 'root' is the hard disk partition that contains the ISO Obviously, I selected the ‘Install Fedora 9’ entry
image and it has started booting my system with the help
 'kernel' is the Linux kernel of vmlinuz and initrd.img files. The set-up prompts
 'initrd' is the initial RAM disk image me to choose a language and keyboard layout. Then
Likewise, the menu.lst entry for the ISO file looks it prompts me to select the ‘Installation Method’ as
like what’s shown below: shown in Figure 2.
In this screen you need to select the ‘Hard drive’
title Install Fedora 9 option and proceed to the next screen. Here, you have
root (hd4,0) to select the appropriate partition and the directory
kernel /fedora/vmlinuz where the installation image exists. In my system, the
initrd /fedora/initrd.img installation image exists in the /fedora directory of
/dev/sda5 partition. This is shown in Figure 3.
…continued on page 27

www.openITis.com  |  LINUX For You  |  March 2009  |  25