How to install Debian without removable media>

This document describes a way to install Debian with the harddisk only. You don't need any floppies, CDs or anything the like. Also, unlike linboot, this approach does not require DOS. However, there are some requirements that must be fulfilled:

Prerequisites

You need:
You do not need:

Preparation

These steps must be performed from the existing operation system (OS).

I will use Linux commands to demonstrate what you have to do. You may have to alter the command to work on your OS.

I use the following placeholders:
Placeholder
Example
Comment
$TARGETDISK
/dev/hda2
The partition on which the new Debian system should reside. Check the Debian installation guide for suggested sizes. Your bootloader must be able to boot Linux from here.
$BOOTDISK
/dev/hda3
The partition on which the installation disk, the part which creates the base Debian installation, will be placed. It can be fairly small, like 20 MB. Your bootloader must be able to boot Linux from here.
$BASEFILES
debianinst on /dev/hda1
The directory in which the Debian installation files (listed in the next section) will be placed. It can be on any existing partition, like $BOOTDISK or that of your existing OS, as long as the filesystem is ext2 (or FAT?).

Get Debian installation files

You need to get the following files (e.g. via your browser or wget or copy them from the Debian CD) from the directory dist/stable/main/disks-i386/current/ of your favourite Debian mirror and arrange them in the exact same way under $BASEFILES.

For example, for images-1.44/root.bin, you do
cd $BASEFILES
mkdir images-1.44
cd images-1.44
wget ftp://ftp.debian.org/debian/dists/stable/main/disks-i386/current/images-1.44/root.bin
Necessary files:
base2_2.tgz
linux
drivers.tgz
images-1.44/rescue.bin
images-1.44/root.bin
images-1.44/driver-1.bin
images-1.44/driver-2.bin
images-1.44/driver-3.bin
images-1.44/driver-4.bin
images-1.44/kernel-config

Create bootdisk partition

In this step, you will create a harddisk partition that performs the same function as the Debian floppy disks.

Create ext2 filesystem for bootdisk and target partitions

cd /mnt
mkdir bootdisk
mkdir target
mkdir bootloop
mke2fs $BOOTDISK
mke2fs $TARGETDISK
mount -t ext2 $BOOTDISK bootdisk
mount -t ext2 $TARGETDISK target

Copy bootdisk to hd partiton

root.bin contains a gzipped ext2 filesystem of the bootdisk. We will mount that via a loopdevice and copy the content to $BOOTDISK. It lacks the kernel, which we must add, too.

cd /tmp
cp $BASEFILES/images-1.44/root.bin root.bin.gz
gunzip root.bin.gz
mount -o loop -t ext2 root.bin /mnt/bootloop
cd /mnt/bootloop
cp -dpRx . /mnt/bootdisk
cp $BASEFILES/linux /mnt/bootdisk

Make bootdisk bootable

Tell your bootloader, that it should be able to boot the Linux kernel /linux on $BOOTDISK.

Installation

Now, reboot and boot the system on the $BOOTDISK partition. If all goes well, you eventually see a dialog welcoming you to the Debian installation.

Install Debian as usual, as described in the Debian Installation Guide.

If you are asked about files to load, select "harddisk" and then the partition on which $BASEFILES resides. Then select "list". The installer (called dbootstrap) should find the appropriate file in $BASEFILES automatically.

Either select "Make Linux bootable from your harddisk" (if you select "Install in MBR; if may overwrite your existing bootloader, so you probably want to install Lilo on $TARGETDISK only) or manually make the new Debian system on $TARGETDISK bootable (The Linux kernel to load is boot/vmlinuz-something).

Reboot, start the new Debian system. From now on, everything goes normal as described in the Debian Installation Guide.