Install GNU/Linux without any CD, floppy, USB-key, nor any other removable media

A chinese translation is (currently) located here: http://my.opera.com/hxf_prc/homes/gnu/win2linstall-cn.html

The challenge You are in front of a working, networked machine and want to install your favorite GNU/Linux distribution on it. Unfortunately, you don't have any CD, floppy, USB-key, no nothing at hand. Fortunately, you don't need any one of them. The trick Copy the (small) Linux installer on a hard disk and run it from your previous operating system. Finish using the network. That's all. In some cases you can substitute the network by a (big) hard disk if your network is not good. The even better trick Jordi Massaguer i Pla is developing instlux , a sofware automating most of the steps below. Instead of hunting all across the internet for a bunch of files, now you just have to download instlux , run it and reboot. It's currently working for OpenSUSE 10 and Ubuntu breezy 5.X. Since you are now rushing to instlux to escape the reading of this boring document, let me just remind you to backup your data before doing anything!

Note: This document is focused on Microsoft Windows as the pre-existing operating system, but many things still apply if you start from something else. You'll just have to "translate" a bit. As a bonus, the "translation" will probably be shorter and easier. You may even find some bits of this document useful if you start with no pre-existing operating system at all and want to boot your machine from the network.

Note 2: This document is (too) long because it covers many different cases/configurations/linux distributions. But most people will only need to read not even 1/3 of it to get the job done. Intensive use of hyper-links and tables of contents is recommended.

Official location: http://marc.herbert.free.fr/linux/win2linstall.html

Life of a Linux installer Almost all Linux installers I know work the same. They use one of the numerous ways your PC has available to boot to load in memory two files: a Linux kernel, and an initial (root) filesystem containing the minimal files needed for a tiny GNU/Linux system and the actual installer program. This very first filesystem is also located in memory (RAM) thanks to a technique called... "ramdisk". The Linux kernel and the INITial RamDisk (initrd) are typically pulled from the CD or the floppys used to boot. But they are also two relatively small files easy to download and save on the hard disk of your networked PC. After booting, the task of the distribution installer is basically to put a whole lot of software packages on your hard disk. These packages are also typically pulled from a CD or DVD, but if you have a high speed network connection, it is much more convenient and sometimes even faster to download them directly from the network. Moreover, this way you download only the packages you need, as opposed to downloading a whole CD image (so it may be even faster). So, if your machine is running Windows and connected to the some GNU/Linux distribution mirror, and thanks to a tool called Loadlin or GRUB for NT you don't need any removable media to install Linux; you can do it without moving your hands off the keyboard. Why did not you hear this before? Because the procedure detailed below is a bit more complex than "stick the CD in and press the button", so it's too complex for basic users. But faster and more convenient in many cases. There is absolutely nothing revolutionary below, actually many hackers know this already. It is even documented in the dark corners of the installation manual of some distributions. But since you absolutely not need to be a hacker to achieve this, I wrote this document to help any sysadmin or advanced user do it quickly and easily.

Why do this ? your laptop doesn't have a CD or a floppy drive.

your floppy drive has died (buried in dust) and you do not have a CD-burner/blank CD-ROM at hand

burning a CD or writing floppies is boring and takes time. Moreover, floppies are too small (you usually need at least two of them) and unreliable. And you keep losing this *%$& install CD every time.

you frequenly install Linux, and want the latest installer each time, without wasting a blank CD each time.

you can customize and test the Linux installers quickly and easily

for some people, the network is faster than a CD-ROM. Especially considering the "medium swapping" time. And since you'll have to use the network anyway (to download security updates) why not get completely rid of all these CDs and their obsolete packages?

you need a lot of different kernels/installers (for different machines) and do not want to burn a CD for each combination

your installer image can be as big as your hard disk allows it

of course your old PC does not boot from USB. It does not even have an USB port.

Come on, transfering CDs through a network is ugly. Be serious, simply transfer the files inside.

you want to show off

it's fun

Preparing & downloading The installers of some distributions provide nice graphical disk partitioning utilities, but you may prefer to prepare your disk earlier using some Windows-based disk manager. It's up to you and your distro. Warning: Partitioning is really a risky operation. You really should backup all your data off your hard disk before that. This warning is off-topic (you have to re-partition your disk whatever your install media is), but was added because of its importance and by "popular demand". In particular, there has been recently an infamous partitioning bug making the partition table incorrect and thus preventing you to boot Windows afterwards. This bug is due to an incompatibility between the linux kernel version 2.6 and the partitioning tool "parted" or similar, versions less than 1.6.12. Have a look at this FAQ for more information. From there: "Known major distributions having this problem are but not limited to Mandrake 10, SUSE 9.1, Fedora 2." Now the very first thing you need to look for and download are the Linux kernel and initrd (INITial RamDisk) files of the target distribution. Finding these files may take a while, since the documentation usually insists that you use a CD or floppy image instead (that's one of the reason I wrote this page). I have compiled this information for most major distributions below. Then you need to find out the distribution-specific, tuning options that the bootloader (GRUB or Loadlin, see next section) will pass to the kernel at boot time. These options are needed to tune the kernel or the installation process to your machine or to your taste. Sometimes none is required, sometimes the kernel will not boot your machine or the installer will not run without some of them. There is usually some isolinux.cfg text file located next to the kernel and initrd files. Open it: the tuning options are inside. If you have some odd hardware that linux has a hard time to detect/initialize, you may need to add a few tuning options specific to your machine (whether you install with a removable or not). Check the BootPrompt HOWTO about these issues. Now have a look at the distribution specifics section below to gather the relevant information and come back here.

Game over ? At this point you should see the greetings of the installer. From now on, just follow the regular documentation of your distribution. Obviously the very first thing you need to do now is to configure and make the net work, in order to connect to the nearest mirror for your distribution. The only remaining issue you may encounter is making work this brand new network interface (yes, the one you bought without checking its Linux compatibility first). Most installers allow you to load additional drivers before going on. Use this feature to try to find and load the appropriate driver in case your network interface does not appear in the installer. If the installer is not able to make your network interface work, an alternative is to download the ISO image of the first CD, because some installers are also able to get their stuff from a CD image on the hard disk (check the installation manual of your distribution). You don't get the benefit of not downloading the first CD, but you still don't need any removable media nor drive. You should now move to the regular installation manual provided by your distribution. In particular, you will have to decide how you boot your new GNU/Linux system (as opposed to boot its installer). If you used GRUB for NT to boot the installer, you perfectly can re-use it to permanently boot the installed system. When your installer asks if you want to "make your system bootable", just answer no, and carefully write down instead the location of the kernel and (optional) initrd image it would have configured, as well as the location of your boot partition. Go back to Windows, and use these informations to re-configure GRUB for NT. You are done. I don't want to make this document too long and off topic by providing more details about this; all you need you know should be in the installation manual of your distribution and in GRUB's documentation. There are countless ways to "chainload" bootloaders. To decide which is the best one for you, also have a look at Linux Boot Loaders Compared and at this nice NT boot process article. Don't forget to google too!