|
4. Installing Knoppix
Since you got Knoppix to at least boot on your system, it should
not be too hard to get it onto your hard disk. After all, all
hardware was detected and that's usually the trickiest part
in installing any linux distribution. And then, most guys I
know, seem to always go for the latest and greatest hardware,
which is really like begging for trouble.
For installing Knoppix onto your hard disk, there is a tool available,
but unfortunately, at the time of writing it is still in heavy
development. It looks like it will one day be a promising tool,
but as for now, we will have to live with a couple of it's
shortcomings and nuisances, from which I will try
to spare you.
Partitioning The Hard Disk
I am not going to give an extended list with things that go
wrong if you try to partition your hard disk from within the
installation program we will use later on, but believe
me: it is better to partition your hard disk(s) beforehand,
and save yourself a lot of trouble.
To do this, we will use fdisk. Granted, it is not the most
intuitive tool to do the job, and if you get by using qtparted
or cfdisk anything else, fine for you, but I've found fdisk to work
always, while others work most of the times.
What you need to figure out first is under which names your hard disks
have been detected. When the system boots up it holds a lot
of information in it's
"kernel ring buffer", and from there you can find out
how your hard disks are named. You could just show the whole of
the kernel ring buffer, using the dmesg command, but
since this one usually also contains a lot of things we don't
want to read at the moment we are going to filter a bit using
grep, so that we get only the information we are
interested in.
Code listing 4.1: Finding Out Where The Hard Disks Are |
knoppix@ttyp1[knoppix]$ dmesg | grep drive$
hda: Maxtor 51536H2, ATA DISK drive
hdb: WDC WD1200JB-00DUA3, ATA DISK drive
hdc: HITACHI GD-2000, ATAPI CD/DVD-ROM drive
knoppix@ttyp1[knoppix]$
|
There you are. In the example the Maxtor disk drive has been named
hda, the Western Digital one hdb and my cdrom drive has been
named hdc. This is directly related to whether the disks are
primary or secondary master or slave on your ide bus. Serial ATA disks
will usually get letters later in the alfabet.
Starting of the fdisk program will now give us an interface to
remove and add partitions. I am not going to cover all of the usage
for the fdisk program. It is a menu based program, very old style
user interface, but it will do the job. You don't have
to be afraid to do any harm since you should have no data to do harm
to on your hard disk, plus you have to tell the program explicitly
to write the partition table to disk before you exit fdisk or it
will not have written anything. That way you can always verify
your configuration before you do the final write.
Code listing 4.2: Starting fdisk |
knoppix@ttyp1[knoppix]$ sudo fdisk /dev/hda
|
There is an excellent tutorial on partitioning hard disks, including
discussions about how big your swap space should be and so on, on this
place: http://www.lissot.net/partition/. Especially chapter
five is a must-read if you feel unsure about this part.
As a small reminder you can use the following table to see what commands
are doing what. You will only need the commands listed here, though
help will provide you with a longer list of commands.
| Command |
What it does |
| n |
Add a new partition. It will ask about cylinder numbers to
start with and cylinder numbers to end with but you can just accept the
default start cylinder if you are creating the partitions in the correct
order and type +20000M for a partition of 20 Gigabytes (20000 Megabytes).
|
| t |
Change a partition's system id. You need a linux partition (83)
and a Linux Swap Partition (82), and maybe some more regular linux partitions
for backup and data.
|
| p |
Print the partition table to verify the current table. What you
see has not written to disk yet, until the wis executed.
|
| w |
Write out the partion table. |
| q |
To quit. |
| m |
To get help. |
For our home router, we will create three or four partitions:
- The boot partition, which will be our system partition. It should
be big enough to hold all software you will install on your system. Expect
to use about 3 Gigabyte of data if you want to install most of the commonly
used software from linux, but you could optimize that down of course.
For the installation of Knopix 3.3, you need a primary partition of at least
about 3 Gigabytes before the configuration tool will allow you to start. Beware of
that!
- The data partition, which will be the partition that will hold most
of the data used by the applications. I.e. all of your web pages, all of the
files served on the filesystem, all of your mail, etc... should fit onto
this partition.
- The backup partition, which will be big enough to hold a full backup and
a sleuce of incremental backups. The size of incremental backups is hard to
predict, and depends on the amount of data changed, but guess on the safe side.
If you don't plan on installing a backup service, you don't need this of course.
- The swap partition. As a rule of thumb, make it as big as the memory you
have in your system.
After we have written out the partition table, we still have to activate the swap
partition, because of a bug in the installer. If we were to start the installer
now, we would be stuck in an infinite loop in the main menu, since it tries to
check for a swap partition and does not find it, and therefore decides that you
have not partitioned your hard drive yet. You can try it if you want, but we
will continue activating the swap partition.
Code listing 4.3: Activating The Swap Partition |
knoppix@ttyp1[knoppix]$ sudo mkswap /dev/hda3
knoppix@ttyp1[knoppix]$ swapon -a
knoppix@ttyp1[knoppix]$
|
Now we should be able to start the knoppix installer. From the console you can
just type
Code listing 4.4: Starting The Knoppix Installer |
knoppix@ttyp1[knoppix]$ sudo knoppix-installer
knoppix@ttyp1[knoppix]$
|
And you should get a menu screen with five options that will gide you through
the installer.
Figure 4.1: Installer Startup Screen |
 |
Note:
If you only get two options in the menu, it means something went wrong with trying
to find the boot partition or the swap partition. This would be a bit of a pain,
since the installer program does not give you any feedback on what is wrong.
|
Choosing the "Configure Installation" item from the menu will go through a wizard
that will ask all of the necessary information required to perform the installation,
such as:
- The partition to install Knoppix to. This is the boot partition we just
created.
- Your full name.
- Your user name.
- Your user password.
- Your administration password. This is the root password for the installed
system.
- Your preferred hostname.
- Whether the boot loader needs to be installed on the Master Boot Record or
on the partition itself. We want to use the Master Boot Record, since no other
operating systems are installed on the hard disk.
- Choose your system type. There are two ways to install a knoppix system.
We want to install a debian style system. The alternative would be a knoppix
style system, in which the hardware is automatically detected on every startup.
Now we just start the installation and after some warning confirmation the installer
does it's part, showing a long progress bar. We are ready to go and have a meal and
a beer.
When the installer is done, ideally, we would just have to reboot the system.
Warning:
Unfortunately, there is a bug in the installer when using a different partition
than /dev/hda1 for the root filesystem, and the lilo configuration
has not been written out like it should have been. It is because
genliloconf crashes that not everything works as it is supposed to work. You
can verify that it crashed like this: normally you will see something like Segmentation
fault /usr/sbin/genliloconf and some extra parameters. No worries however, all
we have to do to correct this is this.
|
Code listing 4.5: Fixing The Boot Loader |
knoppix@ttyp1[knoppix]$ sudo mount -t ext3 /dev/hdc1 /mnt/hdc1
knoppix@ttyp1[knoppix]$ sudo chroot /mnt/hdc1
knoppix@ttyp1[knoppix]$ cat /etc/lilo.conf | sed s/\\/dev\\/hda$/\\/dev\\/hdc/g > /etc/lilo.conf
knoppix@ttyp1[knoppix]$ sudo /sbin/lilo
knoppix@ttyp1[knoppix]$
|
At the end of the installation the system prompts to write a floppy with the existing
configuration, which we just say no to, and a message saying that the installation
was successful. Don't worry if you see some errors on the console, the knoppix-installer
script is still not bugfree, and I don't think many of these matter (screendump from my
system).
Booting The System
Now that the system has been installed we can safely reboot the system. Just pressing
control-alt-delete will log off the knoppix user and restart after ejecting the cd tray.
Or try typing sudo shutdown -r 0 on a console
window. Don't forget to get out the Knoppix CD, you won't need it anymore, so you
can safely add it to the big black box of old CDs on the attic.
|