Saturday, May 12, 2007

Installing any linux from image or iso

There are many linux distros out there and its really interesting to see each one of them. But you don't have to write a cd to install any distro. Thats the good thing about linux. You can perform a complete installation from hard disk.

First of all I am not responsible if you delete your data by mistake. But if you follow the steps closely, there is little chance you are going to do that.

Before we begin we are going to need some files. First make sure which Linux distro you want to download. There are many out there and it is completely up to you. Get the image file, dvd or cd, your choice.


BOOTING WITH GRUB

If you allready have a linux, chances are, you allready have got Grub. That will do the trick. Just skip to the end of this article.

If you have a completely new hard disk without any OS, which is really rare, no problem. You can boot up from a floppy and then use. But that is really long cumbersome process and I wont recommend something I haven't done. So just use another hard disk to boot up and follow the steps.

If you are on Windows then also no problem. If you are installing openSUSE you can get instlux.

If you are going for some other distro no problem. Get the Grub for DOS here. Unzip the pack and all you need are two files, grldr and menu.lst. Copy them to C:\boot (theres no folder by the baem of boot, create one). Open up your boot.ini file, which must be in C drive. By default it is hidden and write protected. So unprotect it, open it in notepad and then add the following line at then end of the file,"C:\grldr="Start GRUB", without the quotes.

Open the menu.lst file in notepad and add the following lines (you can delete everything present in the file and keep these lines only).

title My Linux Installer
kernel (hd0,0)/boot/
initrd (hd0,0)/boot/

Replace the fields with the required things. Save it.

You are done. Now your computer can boot up with Grub.


STARTING THE INSTALLATION

Before you begin the installation make sure you know exactly the name of the image and the location it is. If you have got the images of the cds, then make sure they are in one place. Make sure that drive is not touched during the installation.

Get two files, the linux kernel and initrd.img (initial RAM disk image) of the distro you want to install. You can find these in the iso, and extract it (with Winrar or a virtual drive). Or you can download it from the internet. It is available in the mirror sites and you can easily get it.

Copy those two files to C:\boot. Include the filenames in menu.lst and its over.

Restart your computer and you will have another option in ntldr boot menu saying My Linux Installer. Select it and the kernel will load. A menu will appear from which select the Install from hard disk. Give the location of the image file and the installation will start.


GRUB ALLREADY INSTALLED

In that case just press 'c' when in the grub menu and type in the following commands in the grub menu.

>kernel (hd0,0)/boot/
>initrd (hd0,0)/boot/
>boot

You can use the TAB key. It really help if you don't remember the location by7 showing you a list of the directories and filenames available for the first word you type. For example after you typed in >kernel (hd0,0)/ if you hit the TAB key key, a list of directories present will be displayed.

Thats it now you can select install from hard disk after the kernel loads and enter the image location.

Done.


Note:- The image file has to be saved on ext3 or ext2 partition. It currently doesn't work if you save it on a LVM FAT32 partitions. But it will work in FAT32 partitions provided its not an LVM like a USB drive. If you are on windows and want to create an EXT3 partition you will need Acronis Disk Director suite to partition a drive to ext3 and EXT2IFS to access the ext3 partition in Windows. Its not that hard and can be done in minutes.

1 comment:

Anonymous said...

You could have been a little more explicit. Like, where do i have to save to iso file to? Or how come the grub installed instructions ever going to work if not even the path to the iso isn't defined anywhere? And many other..