The easy guide to installing Hurd on a Linux box.

Hurd logo

Official site: http://www.pick.ucam.org/~mcv21/hurd.html


Debian GNU/Hurd is constantly under development, so this guide changes often. The mirror on www.gnu.org is not regularly updated due to problems in the new savannah setup, so you are strongly advised to check the official site.

Legal Stuff


This document is Copyright © 1999 Matthew Vernon.
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.

Introduction


The aim of this document is to enable anyone with a Linux installation, a bit of time and some hard disk space to install Hurd and get it working multi-user with the minimum of effort. I have written this because I found the documentation confusing when I tried to install Hurd, and it took some perseverance to get it working. Hopefully this will make your life easier. If you are not running Debian GNU/Linux, then you will need to get hold of a copy of dpkg (the debian package manager), since cross-install relies on it, or use the large tarball installation method. Dpkg for non-Debian systems is available at any Debian mirror:

First - Understand Hurd partition names


Hurd uses different partition names to Linux, and this can be confusing. IDE hard disks are numbered in order, based on their position on the controller, so the primary master will be hd0, and the secondary master will be hd2 SCSI drives are numbered according to their SCSI ID.

Linux-style partitions are always called sn, where n is the partition number, so the third partition on the primary IDE slave drive will be hd1s3, and so on.

GRUB (the Hurd bootloader) uses a different partition naming system: it calls partitions (hdN,n), but this time the disk number and partition number are both zero indexed, and the disks run in order, all the IDE disks first, and the SCSI ones second. This time, the third partition on the second IDE drive will be (hd1,2) ((hd1,2) could refer to the first SCSI drive if you only have one IDE drive, or it could refer to the second IDE drive).

Second - Make a partition


Use cfdisk or fdisk for this. Use a decent size partition (I would recommend 500MB, as this will leave you lots of room), but don't make it bigger than about 1GB, because there is a bug that doesn't allow bigger ones. As a caveat, support for partitions made with mke2fs 1.15 has not been well tested, so be careful. Also set the type to Linux native (83). This is important - setting it to the Hurd type will mean it will not work. The Hurd can use any partition for swap, but you can also use the Linux swap partition. Swap partitions are added to /etc/fstab just as with Linux. Make sure you have the latest stable e2fsprogs, then make a Hurd-owned ext2 filesystem on the partition (note that you need the sparse superblocks option set) e.g.:

mke2fs -O sparse_super -o hurd /dev/hdb1

Third - Get that Hurd!


This has all changed now. There are some nice new Debian packages which make the hurd oh so much better. Please check the top of the cross-install script to see which packages you need (providing a list here is not useful because it changes quite often). Basically, it is everything but a few exceptions from the base section, plus the Perl interpreter interpreters/perl. Cross-install can now download the .debs automatically for you - you need a network connection and a copy of wget to use this feature. Here are the likely places you'll get those .debs:
ftp.debian.org/pub/debian/dists/sid/main/binary-hurd-i386
This is where the officially released .debs will be. As time goes by, more and more .deb files will be found here, and you'll need alpha.gnu.org for fewer things.
alpha.gnu.org/pub/gnu/hurd
This is where the rest of the .debs will be found - look in the Debian and contrib subdirectories.
Note that you are probably better off using your local mirror of the above servers, which may well be on your nearest Sunsite, under /pub/Mirrors.
You also need some scripts, which are available on www.debian.org and mirrors:

There is an alternative, which is to grab a large .tar.gz of the basic packages from alpha.gnu.org/pub/gnu/hurd/contrib/marcus/gnu-latest.tar.gz. Whichever you use is largely a matter of preference: I prefer using the individual files, but YMMV. Indeed, opinion now seems to be that this large tarball is easier than using individual .debs

You also need GRUB, the GRand Unified Bootloader. Grab the image from ftp://alpha.gnu.org/gnu/grub/grub-0.90-i386-pc.ext2fs.
Then write it to a clean and new floppy:
dd if=grub-0.90-i386-pc.ext2fs of=/dev/fd0 bs=512

Fourth - Cross-install the hurd


The instructions that follow apply if you are using the individual .debs. If you are using the large tarball, follow the instructions at the end of this section.
Put all those .debs (unless you're using cross-install's auto-download feature) and scripts in the same directory (cross-install will also cope with a directory hierarchy that resembles the Debian archive), cd to that directory, and make sure the scripts are executable:
chmod +x cross-install
chmod +x native-install
chmod +x dpkg-hurd
Edit cross-install, using your editor of choice, and change the hostname to the name of your machine. Then mount the Hurd partition:
mount /dev/hdb1 /gnu
If you're using the auto-download feature, invoke cross-install like this:
./cross-install /gnu --download ftp.debian.org (any Debian mirror will do)
Otherwise:
./cross-install /gnu

This may take a little time.

Using the large tarball


Untar the tarball onto your hurd partition:
tar --same-owner -zxvpf /path/to/tarball /gnu

Fifth - The single-user boot


Unmount the Hurd filesystem, and reboot with the GRUB floppy in the drive. When you reach a menu asking you to select one of five options, hit c to get to a command prompt. You now bring the machine up by hand. Note that grub supports tab-completion for the arguments to these commands.
root=(hd1,0)
Where this is the GRUB name of your root partition. If GRUB says it has found an ext2 filesystem then this has worked. If not, check the partition type, and that you entered the partition correctly. The next command is:
kernel=/boot/gnumach.gz root=hd1s1 -s
This time, use the Hurd name of your root filesystem. The -s flag tells Hurd to boot single-user. If this works, you get a line about ELF object code. Then type:
module=/boot/serverboot.gz
This is a Mach executable that loads the servers needed to run the rest of Hurd. Finally, boot it:
boot
Mach now starts its general boot process. Note that it doesn't support IRQ sharing, so you may find a conflict (especially with serial ports) that didn't occur with Linux. If this is the case, changing the offending port's IRQ or disabling it should work. Eventually, you will get a prompt. Now finish the basic install process, using the native-install script:
./native-install

If this gives setttrans errors, then you forgot to specify the -o hurd option to mke2fs. Run the e2os script under Linux to fix this. Note that the cross-install script will no longer install more than a minimal set of packages (to prevent dpkg choking on errors), so you will need to install any other packages using the Debian packaging system later. You should now reboot, and follow the above instructions again, in order to run native-install a second time.

Sixth - Make devices, and more configuration


Every time you enter single-user mode, you have to type:
export TERM=mach
to use the mach terminal information. Do that now. Next you need to make some devices:
cd /dev
./MAKEDEV foo bar baz

Native-install should have created a device file for the root partition for you. Other partitions or swap partitions and the floppy drive (probably fd0) can be added manually. It is important to note that you need to make devices for the drives themselves as well as any partitions on those drives you wish to use. Next, you need to set up the network. Native-install sets up /servers/socket/2 with no parameters now, so you have to make this go away before you can configure the network: settrans /servers/socket/2 --goaway
settrans -acpfg /servers/socket/2 \
/hurd/pfinet --interface=eth0 --address=NN.NN.NN.NN \
--gateway=GG.GG.GG.GG --netmask=MM.MM.MM.MM

These should all be numerical IP addresses. The values to insert will be found on your Linux box in /etc/init.d/network. Now, if you want to boot multiuser, you'll want your users to have the same home directory on both Linux and Hurd, won't you? So you need to mount the Linux partition. Hurd mounts are permanent between boots, which is really useful. For example, if your Linux partition is /dev/hda4, then mount it in /Linux thus:
cd /
settrans -c /linux /hurd/ext2fs /dev/hd0s4
ln -s /linux/home /home
The last line makes /home a symlink to /linux/home. The /hurd/ext2fs tells Hurd it's an ext2 format partition. You can mount (non-transiently) nfs partitions in this way too. To make the filesystem read-only, give the -r argument after the filesystem type, and to make the settrans transient (like a Linux mount), supply the -a argument directly after settrans. To remove a settrans, type settrans /mnt without any further arguments. To change the status after setting the translator, you can call fsysopts /linux with the appropriate options.

Now issue the reboot command, and go back to linux:
/sbin/reboot

Seventh - Final preparations

Then edit the menu provided by the GRUB floppy, which is in the file /floppy/boot/grub/menu.lst. You need to change the single-user and multi-user options to those you used earlier (remembering the -s flag for the single-user boot option). That's it! Just reboot, and select the multi-user menu option from the boot floppy.

Eigth - Mailing lists


There are four Hurd mailing lists:
debian-hurd@lists.debian.org
The mailing list for the Debian GNU/Hurd project. I recommend this to everyone, especially those interested in porting things to GNU/Hurd, and using their Hurd box for anything useful. Send a message with subscribe as the subject to debian-hurd-request@lists.debian.org to subscribe. Archives can be found at http://www.debian.org/Lists-Archives/#debian-hurd
help-hurd@gnu.org
The mailing list for people involved with the Hurd project. There are quite a few cross-posts to debian-hurd, but this list is probably of interest to everyone. Send a message with subscribe as the subject to help-hurd-request@gnu.org to subscribe.
bug-hurd@gnu.org
The mailing list for reporting hurd bugs (as opposed to those in debian hurd packages).Send a message with subscribe as the subject to bug-hurd-request@gnu.org to subscribe.
web-hurd@gnu.org
The mailing list for people interested in the development of the GNU/Hurd web pages. Send a message with subscribe as the subjecct to web-hurd-request@gnu.org to subscribe.

Ninth - To conclude


A couple of further links you may well find helpful:
http://angg.twu.net/the_hurd_links.html
A large collection of links containing information for GNU/Hurd developers and users.
http://hurddocs.sourceforge.net/
The home of the GNU/Hurd documentation project.
I hope this has been helpful. I'm sorry it's so long, but I've tried to make everything simple by explaining everything step by step. Please send me feedback! I can only improve this guide if you tell me what you'd like to see here. Have Fun!
Matthew Vernon, matthew@debian.org,
http://www.pick.ucam.org