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.
-
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.
-
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
-
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.
-
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).
-
Reboot and select the ISO installation option to boot
Do as the title says..
-
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
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.
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.
thanks unix monkey.. it was a pretty bad mistake..
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
Post new comment