FreeOS.com logo

FreeOS Most Popular
* Most Read stories
* Commented Stories
* Active Categories
* Non Linux Section
* User Submitters
* Top Polls
* Top Authors
* Top Reviews
* Top Rated
* Top Search Terms

Top Articles
* Writing a Linux device driver
* The Linux filesystem explained
* Samba NT Domain Controller
* Setting up Squid as your caching HTTP/FTP proxy
* Web server tutorial - Part 1

FreeOS Highlights
* Howtos (72)
* Reviews (20)
* Opinions (18)
* Interviews (8)
* News (3)

My FreeOS

Nick:
Pass:
Register

Forgot your password?

Contact Us
Contact Us

       

Project: Linux triangle Articles triangle

Diskless client with Debian

By Viral <viral@seul.org>
Posted: ( 2000-10-11 11:46:03 EST by )

There was an article on FreeOS a few days back showing you how to setup a
diskless workstation. The author of this article believes that it can be
done quicker and easier using packages right off the Debian distribution.

A very brief introduction to Debian

If you've been reading Slashdot recently, or the Freshmeat editorials and
following various developments in the world of open source, its difficult
to have escaped the mention of Debian.

So, what is Debian? To quote from the Debian FAQ,

Debian GNU/Linux is the result of a volunteer effort to create a free,
high-quality Unix-compatible operating system, complete with a suite of
applications. The idea of a free Unix-like system originates from the GNU
project, and many of the applications that make Debian GNU/Linux so useful
were developed by the GNU project.

I could keep going on and on about Debian and why it is so cool, but I bet you
already know that. If not, You should check the Debian FAQ which is an
excellent starting point to find out about Debian and its goals.
http://www.debian.org/ is your best starting point.

I've usually found Debian to be the best, when it comes to doing a particular
job quickly. In this article, I'll relate to you my experiences in setting up
diskless workstations using Debian. I assume that you are familiar with debian.

Packages required for the diskless setup

There has already been a very good article by Amit Chattopadhyay on Sept 27,
2000. So, now lets see how using Debian, one can do the job faster and easier.

In this article, any reference to 'server' means the computer that boots off
the diskless workstations, and 'client' of course, is the diskless workstation.

You need the following debian packages to get started :

* diskless # Contains the tools for diskless images
* diskless-image-simple # Contains the skeleton diskless image
* netboot / etherboot # Tools for tagging images and programming EEPROMS
* dhcp / bootp # Allocate IP addresses to clients
* tftp # Used to get the kernel
* nfs-user-server # Serve files using NFS from the server, of course.
* make-kpkg # For compiling the kernel
* bin86 # This somehow isn't satisfied by the dependencies
of make-kpkg, so we add it by hand

You can install the packages with :

# apt-get install netboot diskless tftp netboot bootp nfs-user-server
# apt-get install make-kpkg bin86

but, the 'diskless-image-simple' is simply to be downloaded. That can be done
with

# apt-get install diskless-image-simple -d

Boot Server Configuration

Now, as in Amit's article, you would perform the following steps:

1) Etherboot setup
2) Compiling the kernel and tagging it with mknbi-linux
3) DHCP / BOOTP and tftp setup

A few notes. Etherboot isn't available as a Debian package yet, but netboot is
good enough for the job. Its your choice.

BOOTP can be used instead of DHCP if desired.

When you compile a new kernel, do not install it by hand as you would generally
do. Just do

# make menuconfig

and select all the required stuff. Then compile the kernel with :

# make-kpkg --flavour diskless buildpackage

This will result in a .deb file of your kernel and modules. You simply have to
say 'dpkg -i kernel-image-*.deb' to install the kernel and modules. This is
much simpler and cleaner than doing it by hand. However, for booting the
clients, you do not need to install the kernel on the server. Just keep it
around.

And yes, you might need to pass any 'append' parameters to your kernel. For
instance, if you have an i810, you may have to use append="mem=124M" with
mknbi-linux, to allow access to all 124M of memory. (Remember, 4M is taken by
the onboard video card, or else you'll have a nice OOPS on bootup.) For
example:

# mknbi-linux --append "mem=124M" vmlinuz output file

You have to configure tftp now. If the entry exists in inetd.conf, then enable
it with

# update-inetd --verbose --enable tftp

Otherwise, add it with

# update-inetd --verbose --add "tftp dgram udp wait root
/usr/sbin/in.tftpd /var/lib/diskless/boot"

Usually, these 3 steps take a lot of time when doing it for the first time.
You have to get the EEPROMs programmed right, the kernel has to be built with
the right stuff compiled in, has to be tagged, and your DHCP/BOOTP has to work
fine. But this is just a one time effort. Once you do it, you don't have to
spend any more time on these things.

Installing a Generic Client Image on the Server

What usually takes up more time is maintenance and not the initial setup. From
this point onwards, the stuff is debian-specific. The idea is to make one
generic installation for all workstations, and then simply do small
installations for machine-specific stuff like /, /etc, /var etc.

To create the basic image, you will need the following:

base2_2.tgz
diskless-image-simple

base2_2.tgz is available on any Debian installation CD or Debian archive
online. (The first one). You would usually find it in

'dists/debian_version/main/disks-i386/kernel_version/base*.tgz'

In case of 'potato' (The recent stable release from Debian), this would be :

'dists/potato/main/disks-i386/2.2.16-2000-07-14/base2_2.tgz'

The other package, diskless-image-simple, we just got using apt-get. Put both
of these in the same directory and then run

# diskless-newimage

It will ask you a few questions, which you should reply to carefully, as they
will be used by all the clients. You should try to use the default paths
unless you have a reason, as this makes things easier. After this, a base
image is created, usually in /var/lib/diskless/default. This is the NFS-Root
Image. We will now assume that this directory is $NFS-Root.

This doesn't install a kernel. To do that, change to the directory $NFS-Root.

# dpkg --root imagedir --install kernel-image-*.deb

The NFS-Root image directory has to be NFS-exported. You can find a sample
entry in $NFS-ROOT/etc/diskless-image/exports. Simply add it to your
/etc/exports.

Add and remove any packages or files from this NFS Root image as per your
taste. For instance, you might want to add the /etc/XF86Config, if all your
workstations are homogeneous and other such files. This image will be cloned
for all the clients.

Configuring a diskless Client

Now, we are ready for installing diskless workstations. Before you do that,
though, make sure you add the required entries to /etc/hosts. To install a
diskless workstation called m1, you would now say :

# diskless-newhost

You can use the defaults for the questions, and in the end, you have m1
configured for remote booting. Repeat the process for all clients.

In every client's Root directory, will be

etc/diskless-host/exports

Simply copy the contents of this file to the /etc/exports of the NFS Server.
Once you've done this, you are ready for diskless booting.

Why is this process so appealing ? Because, now for every new client you want,
all you have to do is run diskless-newhost and add an entry to the exports
file. The standard machine specific files are taken care of automatically, and
every client just takes about 4 MB of disk space !!

And, since these clients are installed from the same base image as a machine
with a local disk, the diskless system looks just like a Debian system with a
local disk.

Further Reading and Acknowledgements

Most of the stuff in this article is mentioned in the 'diskless' package
documentation in the README.Debian file. Its an excellent README and you
should read it before you do a diskless installation.

The Diskless-root-NFS-HOWTO and the Remote-Boot Mini HOWTO are excellent
references.

Of course, during your install, you will have various glitches. So let me know
about those. I know that this is not a perfect article, but then diskless
installations aren't exactly a piece of cake :). This article isn't exactly a
step by step guide for diskless installation, but a demonstration of how one
would go about doing it, and how Debian helps you do it easier and faster.

I would also like to thank all the volunteers at Debian for this wonderful
effort, and all the people involved with Open Source Development. Also, a
special thanks to Brian May because of whom we have the diskless package in
Debian in the first place.

Quick and dirty guide to diskless workstations


Debian.org

Other articles by Viral

Current Rating: [ 7.32 / 10 ] Number of Times Rated: [ 25 ]

More Articles
* Know Linux
* If I could re-write Linux
* Interview with Mozilla engineering director Chris Hofmann
* Response to SCO's Open Letter
* GNU Linux Security

Contents
Articles
  Howtos
  Interviews
  News
  Opinions
  Reviews
Comparison
Links
  Articles
  Howtos
  Interviews
  Opinions
  Reviews
  Websites
News

Linux
About Linux

Print It!
Printer Friendly Version