Monday, October 1, 2007

Install Linux from ISO image on hard disk without using a DVD ROM or CD Drive

I am describing here a method to install Linux without using a DVD ROM or CD Drive I have checked it myself .In case you do not follow or could not work as said write a comment here might be some thing is missing I will reply but since I have been searching for a job from past many days so if I do not reply to your queries right now so you have to wait for some time in case

there are many ways to do so
you can install Linux by
1) booting from the network
2) Having a ISO image on your hard disk
3)Boot from USB
4) Installing a linux system from scratch by building your own


I am assuming that Linux is not installed on your system and neither grub or lilo is there
This method is taking Open Suse 10.2 Image but is same for Fedora or Debian or any other distro .
There is one check point in case you used Nero to copy CD or DVD image then it might have been possible that you copied the image and it is file with dot nrg extension in that case you need to get the ISO from NRG

I have installed by all the above methods but I am describing here the simplest one since there are many new comers who would not be able to understand other methods .Before doing all this make sure
1)that you have enabled the option of viewing file extensions in View Options of folder view.
2) If you use Fedora or any other distributions do not use the NTFS partition to store the
image although Open Suse 10.2 can work from NTFS partition I have done it using NTFS
partition only but will not suggest you to do same
3) Most important do not install linux on same partition on which you have the ISO from which you are installing everything since it will format that hard disk that holds the image you are using
there is an image named openSUSE-10.2-GM-DVD-i386.iso which you would have downloaded rename it to suse.iso (not necessary to do so but will make your life simple )

Similarly for any other linux distro you might have image of fedora or debian etc rename them to some simple filename.
the image is 3.6 GB then download the grub for dos from
http://sourceforge.net/projects/grub4dos


Before some one reads the following lines just informing while you install winzip or winrar by default they are associated with ISO filetype so you may see your downloaded ISO as an icon that says it can be extracted via Winrar just go and disable this in options tab from Winrar menu if u want to burn the ISO directly to CS just go to Nero and select burn image to disk and select the ISO u do not need to make it a bootable CD or DVD.

extract the downloaded grub4dos using winzip or winrar ,you will get a folder name grub copy it to C drive
then create a folder name boot in C drive of your windows partition (C drive is not necessary but makes life simple ) .
Now copy grldr from grub to C:

add a line C:\grldr="Start Linux" to
your boot.ini (even if I have mentioned the README there says it all)

Now different distributions of Linux have different kernel names like
Fedora: vmlinuz and initrd.img
Suse: linux and initrd
Mandriva: vmlinuz and all.rdz
Ubuntu: vmlinuz and initrd.gz
Gentoo: gentoo and gentoo.igz
Knoppix: vmlinuz and initrd.img
Slackware: bzImage and initrd.img
Debian: vmlinuz and initrd.gz

use winrar to navigate the ISO image you will go inside folder name boot or where ever the kernel are in your CD or DVD ISO

NOTE ( I took Open Suse 10.2 inside the installation media there was a boot folder inside it was a loader path is openSUSE-10.2-GM-DVD-i386.iso\boot\i386\loader
that had kernel image named linux and the initrd name initrd both are needed)

copy the kernel images vmlinuz and initrd.gz which you see by winrar in ISO archieve from your ISO to folder boot in C drive
both files vmlinuz and initrd are required for any linux system to boot


you can use winrar to view files and extract only two files rather than extracting whole ISO

then you don't need to do any thing just restart the computer and you will get a screen that says
Microsoft Windows XP
Start Linux


choose the option start linux
then go to grub you will find an entry that says command prompt

use command prompt since even after making changes as said in README some times it did not worked
press enter to select the command prompt option
you will get a grub shell showing some thing like this
grub >

now type on grub prompt (grub> ) Note u do not need to type grub > it is already there on your screen if not you did some mistake




In my case it was suse so
grub >kernel (hd0,0)/boot/linux
grub >initrd (hd0,0)/boot/initrd
grub >boot


If you are using some other distribution then above commands will change like this
grub >kernel (hd0,0)/boot/vmlinuz (depending upon your kernel name)
grub >initrd (hd0,0)/boot/initrd.gz (depending upon your initrd name)
grub >boot

press enter then
now kernel will load and will ask you to choose the medium to boot from choose the medium hard disk it might give some error that insert CD just ignore it if it asks to hit back button then it that then choose the medium etc and then choose the hard disk partition to boot from then it will ask for the file name enter suse.iso in the partition where you have it then press enter if you did every thing right installation will start if you messed up then probably you might get an error like boot.catalog not found or some other error like this only
installation starts it might display some error messages just ignore them and press enter
or hit Back button then choose language keyboard installation then choose installation medium
it gives 3 options
CD
Network
Hard disk
choose the hard disk and then from the hard disk choose the correct partition where you copied the 3.6 GB suse.iso
not do not format the same partition on which image is there



By looking at the above procedure do not get confused by the network installation procedure which is quite different from
the normal ones you can read complete method of Network booting and PXE intallation on my blog

10 comments:

Question Paper - TYBCom said...

Hi, Its a great Guide... Thanks.

I've Successfully did it a few days ago, it worked good with the Win Xp, but on vista it is giving error as there is no boot.ini for the entry "C:\grldr="Start Linux", and can;t create "boot" folder, as it is lredy there but with no access to it, though I copied the required files to the "boot" folder from Command Line,
and also I Tried to add the entry "C:\grldr="Start Linux", with the bcdedit.exe but no result...

If you have also faced this and got the solution please Let me know the Solution...

Registered User said...

No I did not check it with Vista so these steps are only working with XP but any ways u can use a USB drive to boot by now you must have understood all the steps you just need a bootloader to pass parameters to grub like vmlinuz and initrd

Telefone VoIP said...

Hello. This post is likeable, and your blog is very interesting, congratulations :-). I will add in my blogroll =). If possible gives a last there on my blog, it is about the Telefone VoIP, I hope you enjoy. The address is http://telefone-voip.blogspot.com. A hug.

Shiva said...

Hello I could not do it. It's giving something like (hd0,0) TYPE: EXT2. Please help.

Unknown said...

Thanks for such a good article, but I faced problem in installation:
initially all went well like butter, when I selected the hard drive partition and provided iso image name, then it was not able to find the iso image:

Actually my hard disk is partitioned in 4 parts + one unformated partition(deleted the F 50 GB, created FAT32 30 GB, and left 20GB free for linux)
it shows four partition like /dev/sda1/
/dev/sda5/
/dev/sda6/
/dev/sda7/

I provided it like:(as iso is on F: drive, so I assume F=/dev/sda7/)
/dev/sda7/fedora.iso

I tried other permutations also like:
1.
a. selected /dev/sda7/
b. path: fedora.iso (I renamed iso image to simple name)

2. selscted /dev/sda7/
b. path: /fedora.iso/

but it does not work, and I get error like: Error occured in finding image file on hard disk.... /dev/sda7/ does not seem to contain any image...

Registered User said...

Depends where u r reading the image from if it is kept in a FAT partition then it wont allow you to make a file greater than 3.2 GB

Paul said...

Thank you for the good information. I am learning about linux and your discussion of the kernel and operation of grub was very helpful for my understanding.

ആന്റോ പണിക്കർ said...

I have a Damn Small Linux iso. There is no boot menu in my pc. So, I want to install it through other methods... Please help me...

http://facebook.com/antonetme |
http://twitter.com/antonetme |
mail@antonet.in | www.antonet.in

Homeless Drummer said...

Excellent tutorial. Thank you.

Muthuraj said...

I tried this in my desktop(windows xp).
I followed all the steps.
Got Start Linux in boot menu and in grub prompt I gave the path to kernel and initrd. The kernel boots up and stuck at a point with an error ALERT! does not exist. Dropping to shell. What to do?