Installing Debian GNU/Hurd

Version 2.3a


This is a basic guide to installing Debian GNU/Hurd on a system which either already has Debian GNU/Linux installed or on which Debian GNU/Linux is to be installed. For basic guides to installing and using Debian GNU/Linux see  Basic GNU/Linux Guides .

The method chosen is to use a tar archive file which contains a basic working Debian GNU/Hurd system and untar this on a partition dedicated to GNU/Hurd. You will need to download this tar file (see below). This tar file contains a 'snap-shot' of the latest base-system of Debian GNU/Hurd by Marcus Brinkmann, one of the main Debian developers for GNU/Hurd. This tar file has made installing Debian GNU/Hurd fairly easy.

At present, new installations of GNU/Hurd are booted by a Grub boot floppy (where Grub stands for Grand Unified Boot-loader) and you will need to download the image and write it to a floppy disc (see below).
 
 

Creating a Hurd Partition

If you do not have Debian GNU/Linux on your system, you should install it first, and make four partitions - one for the GNU/Linux root filesystems; one for Linux swap; one for the GNU/Hurd root file system, and another for Hurd swap. You should then install Debian GNU/Linux on the first partition, and use the second for Linux swap.

The Hurd partition should be less than 1GB since this is currently the maximum usable with the Hurd. Between 500 and 900 MB is best. You should also create a Hurd swap partition of around 64 MB. Note that the Hurd swap partition is the same type as Linux swap (type 82).

GNU/Hurd uses different names for hard drives and partitions, with Grub - the Hurd boot-loader - using yet other names. The following list shows the differences:

GNU/           GNU/
Linux           Hurd            Grub
Name          Name          Name

hda1         hd0s1            (hd0,0)

hda2         hd0s2            (hd0,1)

hda3         hd0s3            (hd0,2)

hda4         hd0s4            (hd0,3)
 

Thus, hda1 - under GNU/Linux the first (1) partition on the first (a) IDE device (hd) - is hd0s1 under GNU/Hurd: the first slice (s1) of the first (0) IDE device (hd). Note that on systems with only one HDD, the second IDE device (normally hdc under GNU/Linux and the CD-Rom drive) is hd2.

Scsi devices are prefixed with sd so that the first partition on the first scsi drive would be sd0s1 while the first partition on the second scsi drive would be sd1s1.

The Grub name uses zero for both the first device and the first partition on the device - using a comma to separate the device number from the partition number, and enclosing all these in brackets. Note that both the brackets and the comma are important.
 

If you already have Debian GNU/Linux installed, you need to create a Hurd partition and a Hurd swap. You can use the cfdisk utility - see man cfdisk for more details.

The Hurd partition must be Linux native type 83, and the Hurd swap partition Linux swap.
 
 

Making Hurd File-system


After you have Debian GNU/Linux installed, and have a Hurd and Hurd-swap partition, boot into GNU/Linux and make a Hurd file-system on the new partition. For the rest of this Guide, hda3 is taken to be the Hurd partition, and hda4 the Hurd swap partition - the Hurd names being hd0s3 and hd0s4 with the Grub name for the Hurd root being (hd0,2). In the instructions that follow please change the names to those of your own partition(s).

To make the file-system:

mke2fs    -o    hurd    /dev/hda3

[ Note: For details about mke2fs - such as the -o option - see man mke2fs: that is, see the manpage for mke2fs by entering man mke2fs in an xterm or at a console prompt.]

Please note that it is important you use the 1.12-4 version of the Debian package e2fsprogs (which comes with Slink 2.1) - which contains the mke2fs utility - if you are using the tarball as above, as later versions of the mke2fs utility are not suitable with the version of serverboot contained in the tarball.  (The alternative is to use a later version of e2fsprogs and obtain a new serverboot from ftp://ftp.ai.mit.edu/pub/users/roland.) To check which version you have on your Debian system use

dpkg    -s    e2fsprogs

Also, note that if you use the new serverboot, you must uncompress it (from bz2) as Grub can only use .gz or no compression at all.
 

Next, after making the file-system, you should make a new directory, gnu, on root file-system:

mkdir    /gnu

This is where you can mount the Hurd partition and so access GNU/Hurd files.

To mount the partition:

mount    /dev/hda3    /gnu
 

Initializing Hurd Swap

If you did not - during partitioning -  initialize the Hurd swap file, then from GNU/Linux run (as root):

mkswap    /dev/hda4

(assuming hda4 is the Hurd swap partition).
 
 

Obtaining GNU/Hurd and Grub


The tar file can be obtained (at the time of writing, JD 2451533.1771, or December 20 1999 AD) from the ftp site:

alpha.gnu.org/gnu/hurd/contrib/marcus

with the latest being gnu_19991025.tar.gz

This site also contains the grub-image:

/pub/gnu/grub

with the latest being grub-boot-0.5.93.1.image

[ Note: As an alternative, you could get the grub-floppy-19991023 image which is in the /contrib/marcus directory. ]

You should also get, from

ftp.debian.org/pub/debian/dists/unstable/main/binary-hurd-i386/

1) hurd_20000130.deb

which is in the /base directory;

2) nvi_1.79-13.deb

which is in the /editors directory;

3) man-db_2.3.10-69s.deb

which is in the /doc directory;

4) groff_1.15-2.deb

which is in the /text directory.

The first is an update, by Marcus Brinkmann, of the servers contained in his tar file; the second is the vi editor, which is essential for editing files (IMHO); the third enables you to read the man pages, and the fourth is required for the man-db package.
 

Installing GNU/Hurd

First, mount the Hurd partition (see above) then cd to the /gnu directory,  and then untar the tar file:

tar    --same-owner    -xpzf    /<path to tar file.tar.gz>

Note: The options --same-owner and  -p are important (see man tar for more information).

You will notice that this untars to /gnu/gnu so you will have to move the directories to /gnu and remove the then empty  /gnu/gnu directory.
 

Next, you need to make the Grub boot floppy. Format a new floppy disc:

superformat    /dev/fd0    hd

then cd to the directory containing the Grub image and use the dd file-utility (see info dd for more information) to write the Grub image to this disc:

dd    if=grub-boot-0.5.93.1.image    of=/dev/fd0    bs=512

Note: the bs=512 option simply means read and write 512 bytes at a time.
 
 
 

Completing the Installation


To complete the installation you need to boot GNU/Hurd. First, make a note of both the Hurd and Grub names of your Hurd root filesystem - for example, if Hurd is hd0s3  then Grub name is (hd0,2). Then, with the Grub boot floppy in the floppy drive, reboot GNU/Linux.

You will see a Menu - choose GNU/Hurd hd0s1 single-user (use the arrow keys) then press the e key (to edit). The root item should be highlighted. Then press e again and change (hd0,0) to (hd0,2) - that is, the Hurd partition. Then press Return, then scroll down to kernel, press e and change the line to

kernel   /boot/gnumach.gz    root=hd0s3  -s

Press Return, scroll down to module, press e and change to

module  /boot/serverboot.gz

Then press Return and then the b key which will start the boot process.  You will see information similar to that of a GNU/Linux boot and then the cursor prompt.

[ Note: If you are using the grub-floppy-19991023 the above still applies although you will see a slightly different menu and the files will end in .gz so you will not have to enter this. ]

At the prompt enter

./native-install

Note the dot before the /

When this has finished, you should reboot back into GNU/Hurd to complete the installation.

Make a new directory /linux and then add a user and create a directory in /home/<user> to copy over the base-system update tar file.
 
 

Updating the Base System


Boot back into GNU/Linux, mount the Hurd partition, then copy over hurd_20000130.deb, nvi_1.79-13.deb and the other debs to the /home/<user> directory you made.

Unmount the Hurd partition, boot back into GNU/Hurd using the Grub floppy disc and at the prompt run

dpkg    -i    </path to>/ hurd_20000130.deb

which will update the Hurd servers.

Then install nvi, groff, and man-db in the same way.

You will then have a working GNU/Hurd system.
 
 

Configuring a Network Card

If you have a supported card (such as the 3c509B-TP0 from 3Com) it will be detected and the driver installed. All you then need to do is add entries to the /etc/hosts and /etc/resolv.conf files (as on your GNU/Linux system) and run:

settrans    /servers/socket/2    /hurd/pfinet    --interface=eth0    --address=<IP address>
            --netmask=<netmask address>

[ Note:  This is one continuous command: the  "--netmask= " part should be entered after "--address=  " ]

If you have a gateway, add --gateway=<gateway address>. The addressess are those from your GNU/Linux /etc/init.d/network file. If you get an error message:

/servers/socket/2 :    Device or resource busy

then run:

showtrans    /servers/socket/2

and it will (probably) return:

/hurd/pfinet

in which case run:

settrans    -fg     /servers/socket/2

then re-run the long settrans command above for eth0.

Note: For details about settrans see  A Basic Guide to Using Debian GNU/Hurd .

You can test if the card is working by:

ping    <IP address>
 

You can then ftp from another GNU/Linux box:

ftp    <IP address>

which should show:

220    hurd    FTP server  (GNU inetutils 1.3.2) ready

if you have left the default host name as hurd.
 

Telnet

To use telnet, you have to install the following packages (latest versions given as of JD 2451593.2542 - or February 18 2000 AD):

1) telnet-hurd_1.3.2-9.deb
2) telnetd-hurd_1.3.2-9.deb
3) ncurses-base_5.0-5.deb
4) libncurses5_5.0-5.deb
5) inetutils_1.3.2-9.deb

You can then telnet from a GNU/Linux box to Hurd, and vice versa. Telnet from a GNU/Linux box to the Hurd box will work fine  ("out of the box") - although there are currently a few problems from Hurd -> Linux due to the Mach console.
 



Copyleft 1999 by Space-Time Systems.
This document is free; you can redistribute it and/or modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2 of the license, or (at your option) any later version.
This document is distributed in the hope that it will be useful, but without any warranty; without even the implied
warranty of merchantability or fitness for a particular purpose. See the GNU General Public License for more details.
Should you be lacking a copy of this, look at www.gnu.org/copyleft/gpl.html.