How to install linux without CD/DVD

Recently I have been trying out different linux systems on my spare computer. And it was pretty annoying to burn the ISO everytime I wanted to install a new distro. Sometimes I didn't have access to a blank CD/DVD. So, I decided to look for installing linux directly from ISOs.

This article is not an installtion guide to a particular distro. I am considering the case of general linux installation. So, I will explain you the basic concept behind such a method of installation (network installation, NFS or hard disk). I am not a pro in this field so I won't go deep into it but this article will definitely help you out when you are installing any linux distro using this method.

This method is better than a CD/DVD installation

  • If you don't have a CD/DVD drive.
  • If you hate burning ISOs and don't want a pile of installation CDs. (this is one of my reasons)
  • If you are looking for a fast way of installation. (installing from an ISO kept in your hard disk is definitely faster than installing from a CD/DVD)
  • If you have an installation DVD but your system has a CD drive. 

Pre Requisites

  • A present linux installation. (even though it is possible to install some distros through windows but I will consider an already installed linux).
  • A linux installation ISO.

The Basic Idea

All the linux based Operating systems need 2 files to boot. These files are :

  • Initial Ram disk (mostly named as initrd.img)
  • Linux kernel image (mostly starts with vmlinuz)

So, if I can some how boot those files and direct them to the rest of the installation packages I can install the OS.

This is exactly what happens these days, after booting these 2 files you will be asked your method of installation. They are mostly:

  • Using a CD/DVD.
  • Using NFS (netowork file system).
  • URL (could be throught a http or ftp server)
  • An ISO mounted somewhere in your hard drive. (this is the fastest method of installation)

So, after selecting the method of your choice you will be finally able to install linux without a CD/DVD.

Now, let us have a look at the general steps we need to take while installing linux using ISOs.

  1. Mount the ISO in your system

Assuming that you have linux preinstalled on your system. Make a directory in your /mnt folder.

[shredder12]$ mkdir /mnt/iso/

Now, mount the linux installation ISO in that folder.

[shredder12]$ mount -ro loop linux_distro.iso /mnt/iso/

Note the partition and the full path in which you have linux installation ISO stored. You will need it later.

  1. Look for the 2 files

Now, look for the 2 files you need to boot (initial RAM disk image and kernel image) in the /mnt/iso folder. Usually they are present in the isolinux folder in the main directory i.e. /mnt/iso/isolinux/ in our case.

  • Initial RAM disk's name mostly starts with initrd.img.
  • Linux kernel image file's name mostly starts with vmlinuz 
  1. Copy those files to /boot directory

Once you have found both the files, copy them to your /boot folder. Before copying them make sure that you already don't have files of similar names otherwise you might overwrite them. If such files exist then save them in a sub folder of /boot or change the name (I haven't faced such a situation but it should work and in a moment you will see why).

[shredder12]$ cp vmlinuz  initrd.img /boot

You will need root permission for this.

  1. Modify your bootloader's config file to boot the files from ISO

Now, we will add some lines in our bootloader (lilo or grub) to boot these files. If you are using grub as a boot loader then you can add these lines to your /boot/grub/menu.lst file ( at the end of other OS's entries).

title ISO installation

root (hd0,3) # this should be same as the partition in which /boot is present

 

kernel /boot/vmlinuz

initrd /boot/initrd.img

One more thing you will have to mention the disk partition in which the files vmlinuz and initrd.img will be found. The addresses /boot/initrd.img and /boot/vmlinuz will be looked in the partition hd(0,3).

  1. Reboot and select the ISO installation option to boot

Do as the title says..

  1. Select the mode of installation

Now, the key is the type of installation we want.

  • If we are installing from the hard disk then select that option and give the name of the partition and the directory path that we have noted in 1st step. Enter them, and everything from now onwards will be exactly like a normal CD/DVD installation.

  • In case of Network installations like NFS, HTTP, FTP we don't direct the installation to an ISO but a directory where installation tree resides. This tree is the same as the one we mounted earlier in step 1 in directory /mnt/iso. And the rest will be similar to a regular installation.

I hope this article has improved your knowledge about such installation methods and you won't be facing much problem while opting for any of such options for installing any linux distro.

16 Comments

Anon Linuxer
October 10th, 2009 12:51 pm
This is a nice way to escape from the boring burning *.iso file and booting up a CD! cheers kickar http://linnewbies.com
dido (not verified)
December 29th, 2009 10:12 pm
Very good post, thanks a lot.
newbie (not verified)
January 30th, 2010 09:24 am
I mounted the iso in the dir /mnt/iso and copied the 2 files. But when i get the grub boot menu, it doesn't start the ISO installation wizard when I select the heading 'ISO Installation'. A blank screen is wbat appears....any fix
January 30th, 2010 10:18 am

This method might not be the best way here, although a blank screen shouldn't have come up. Which OS are you trying to install using ISO? I might be able to suggest you a proper approach.

newbie (not verified)
January 30th, 2010 11:37 am
M having FC 9 and m trying to install FC12..!
January 30th, 2010 05:34 pm

The first step in the method to install Fedora from hard drive is to boot using the two files from the iso initrd.img and vmlinuz. After that you will automatically be prompted to select a method of installation. I really don't understand why are you left with a blank screen.

I actually tried this method today and copied these 2 files from a Fedora_netinst ISO(it should work good for a regular ISO too) and booted. It was working fine.

My suggestion would be to check the entry you added in the menu.lst file. See if the partition entry and the file locations are correct. Take care of the directory /boot, its sometimes in a separate partition as the '/' directory(use fdisk -l to see all the partitions). If you are copying the 2 files in /boot folder then the partition entry in the menu.lst file should be the same as /boot. e.g  if /boot is in /dev/sda3 then use (hd0, 2) in menu.lst file. 

 

Anon Linuxer
October 19th, 2009 12:03 pm
Good One .... Vinit
Linuxer (not verified)
October 26th, 2009 07:00 am
It doesn't work for me : after reboot I've got a message asking me to creat a symbolic link to /dev/root then I've a shell.
UnixMonkey (not verified)
November 30th, 2009 11:25 pm
In the menu.lst we need to put kernel entry before the initrd entry I suppose the above user is facing problem due to this please shuffle and keep kernel entry above initrd and it should work fine.
December 1st, 2009 01:59 am

thanks unix monkey.. it was a pretty bad mistake..

December 23rd, 2009 08:09 pm
i use dd when i need to install Debian on my eeepc :)
ZZLinuxer (not verified)
February 11th, 2010 01:36 am
Please help! I tried the suggested approach with an FC8 on a thinkpad 600E but got errors when rebooting. First, I mounted the iso mount -ro loop /root/Desktop/Fedora-12-i686-Live.iso /mnt/iso Then copied the 2 files to /boot cp /mnt/iso/isolinux/initrd0.img /boot cp /mnt/iso/isolinux/vmlinuz0 /boot Then added in /boot/grub/menu.lst the following: title Fedora 12 ISO installation root (hd0,0) # the same as /boot kernel /vmlinuz0 initrd /initrd0.img Finally rebooted with the new iso option but got the error "no or empty root = ... Boot failed". I modified menu.lst with the following: title Fedora 12 ISO installation root (hd0,0) # the same as /boot kernel /vmlinuz0 ro root=/dev/VolGroup00/LogVol00 # the same root as for booting FC8 initrd /initrd0.img This time the error was "Mount failed for selinuxfs on /selinux: Device or resource busy... Kernel panic - not syncing: Attempted to kill init!" Then I modified menu.lst with the following: title Fedora 12 ISO installation root (hd0,0) # the same as /boot kernel /vmlinuz0 ro root=/dev/VolGroup00/LogVol00 rhgb quiet # the same root as for booting FC8 with rhgb quiet initrd /initrd0.img This time the error was "Kernel panic - not syncing: Attempted to kill init!". Thanks for your help!
February 12th, 2010 10:53 am

I think the problem is with the names you have used in the menu.lst file. Instead of /vmlinuz0 use /boot/vmlinuz0 because this is where the file exists. According to you it was in the root '/' directory. Do the same for the initrd.img9 file

John (not verified)
February 26th, 2010 05:29 pm
there is an even simpler way, that is to just extract the ISO file to an empty HDD partition, if you have grub already installed or on cd/floppy or whatever then you can just copy the boot commands straight from the isolinux or syslinux config files changing the root device from cd to hdd
Luis Alvarado (not verified)
July 1st, 2010 11:53 pm
Excellent post. Great help.
Ramesh (not verified)
August 23rd, 2010 06:13 pm
Hi, i wnat to know how to install linux from ISO but i dont have a native linux istalled on my system at present. Regards, Ramesh

Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <img> <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote> <h1> <h2> <h3> <h4> <h5> <h6> <p> <br>
  • Image links with 'rel="lightbox"' in the <a> tag will appear in a Lightbox when clicked on.
  • Search Engines will index and follow ONLY links to allowed domains.

More information about formatting options

Mollom CAPTCHA (play audio CAPTCHA)
Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated. Not case sensitive.