/[fai]/trunk/doc/fai-guide.sgml
ViewVC logotype

Contents of /trunk/doc/fai-guide.sgml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1835 - (hide annotations) (download) (as text)
Wed Jun 4 11:44:06 2003 UTC (9 years, 11 months ago) by lange
File MIME type: text/x-sgml
File size: 113613 byte(s)
correct line for tftpd in inetd.conf
Add comments from Niklaus
1 lange 1521 <!DOCTYPE debiandoc PUBLIC "-//DebianDoc//DTD DebianDoc//EN" [
2 lange 173 <!-- include version information so we don't have to hard code it
3     within the document -->
4 lange 1226 <!-- common, language independent entities -->
5 lange 727 <!entity % commondata SYSTEM "common.ent" > %commondata;
6 lange 173 <!-- CVS revision of this document -->
7     <!entity cvs-rev "$Id$">
8    
9 lange 1354 <!entity faikernelver "1.5">
10 lange 1756 <!entity faiver "2.4.1">
11     <!entity faiverdate "2 apr 2003">
12 lange 860
13 lange 1835 <!entity version "2.2">
14     <!entity date "4 june 2003">
15 lange 173 ]>
16    
17     <debiandoc>
18     <book>
19 lange 526 <title>FAI Guide (Fully Automatic Installation)
20 lange 312
21 lange 173 <author>Thomas Lange <email>lange@informatik.uni-koeln.de</email>
22 lange 1341 <version>Version &version;, &date for FAI version &faiver;
23 lange 173
24     <abstract>
25     This manual describes the fully automatic installation package for
26 lange 1275 &dgl;. This includes the installation of the package, the planning and
27 lange 221 creating of the configuration and how to deal with errors.
28 lange 634
29 lange 173 <copyright>
30     <copyrightsummary>
31 lange 1721 Copyright &copy; 2000-2003 Thomas Lange
32 lange 173 </copyrightsummary>
33     <p>
34     This manual is free software; you may redistribute it and/or modify it
35     under the terms of the GNU General Public License as published by the
36     Free Software Foundation; either version 2, or (at your option) any
37     later version.
38     <p>
39     This is distributed in the hope that it will be useful, but
40     <em>without any warranty</em>; without even the implied warranty of
41 lange 1704 merchantability or fitness for a particular purpose. See the GNU
42 lange 173 General Public License for more details.
43     <p>
44     A copy of the GNU General Public License is available as &file-GPL; in
45     the &dgl distribution or on the World Wide Web at <url id="&url-gpl;"
46 lange 1704 name="the GNU website">. You can also obtain it by
47 lange 173 writing to the &fsf-addr;.
48    
49     <toc detail="sect2">
50    
51 lange 522 <chapt id="intro">Introduction<p>
52 lange 1483 <sect id="availability">Availability<p>
53 lange 556 The homepage of FAI is
54 lange 582 <httpsite>http://www.informatik.uni-koeln.de</httpsite><httppath>/fai</httppath>.
55 lange 1275 There you will find any information about FAI, for example the mailing
56 lange 899 list archive. The FAI package is also available as a Debian package from
57 lange 633 &faidownload;. It's an official Debian package and is available from
58 lange 687 all Debian mirrors. Send any bug or comment to
59 lange 618 <email>fai@informatik.uni-koeln.de</email>. You can also use the
60     Debian bug tracking system (BTS)
61 lange 633 <httpsite>http://www.debian.org</httpsite><httppath>/Bugs</httppath>
62 lange 618 for reporting errors.
63 lange 633 <p>
64 lange 1704 You can access the CVS repository containing the newest developer
65     version of FAI from a Bourne shell using the
66 lange 727 following commands. The login password is empty, so only press return.
67 lange 633 <example>
68     > CVSROOT=:pserver:anonymous@cvs.debian.org:/cvs/debian-boot
69     > cvs login
70 lange 637 > cvs co -P fai-kernels
71     > cvs co -P fai
72 lange 633 </example>
73 lange 522
74 lange 727 You can also use the web interface for the CVS repository at:
75 lange 633 <httpsite>http://cvs.debian.org/</httpsite><httppath>fai/</httppath>
76     (and <package>fai-kernels</package>).
77 lange 628 <p>
78 lange 727 Now read this manual, then enjoy the fully automatic installation and
79 lange 628 your saved time.
80 lange 522
81 lange 628
82 lange 618 <sect id="motivation">Motivation<p> Have you ever performed identical
83     installations of an operating system several times? Would you like to
84     be able to install a Linux cluster with dozens of nodes single
85     handedly?
86 lange 173
87 lange 516 <p>
88     Repeating the same task time and again is boring -- and will surely
89 lange 1275 lead to mistakes. Also a whole lot of time could be saved if the
90 lange 1704 installation were done automatically. An installation process with
91     manual interaction does not scale. But clusters have the habit of
92     growing over the years. Think long-term rather than plan only just a
93     few months into the future.
94 lange 516
95     <p>
96 lange 618 In 1999, I had to organize an installation of a Linux cluster with one
97 lange 1704 server and 16 clients. Since I had much experience doing automatic
98 lange 582 installation of Solaris operating system on SUN SPARC hardware, the
99     idea to build an automatic installation for Debian was born. Solaris
100     has an automatic installation feature called JumpStart<footnote> <p>
101     Solaris 8 Advanced Installation Guide at
102 lange 756 <httpsite>docs.sun.com</httpsite></p> </footnote>. In conjunction
103 lange 582 with the auto-install scripts from Casper Dik<footnote><p><url
104 lange 732 id="ftp://ftp.wins.uva.nl:/pub/solaris/auto-install/"></p> </footnote>,
105 lange 582 I could save a lot of time not only for every new SUN computer, but
106 lange 1704 also for re-installation of existing workstations. For example, I had
107 lange 582 to build a temporary LAN with four SUN workstations for a conference,
108 lange 1275 which lasted only a few days. I took these workstations out of our normal
109 lange 556 research network and set up a new installation for the conference.
110     When it was over, I simply integrated the workstation back into the
111     research network, rebooted just once, and after half an hour,
112     everything was up and running as before. The configuration of all
113     workstations was exactly the same as before the conference, because
114 lange 582 everything was performed by the same installation process. I also use
115     the automatic installation for reinstalling a workstation after a
116 lange 556 damaged hard disk had been replaced. It took two weeks until I
117     received the new hard disk but only a few minutes after the new disk
118     was installed, the workstation was running as before. And this is why
119     I chose to adapt this technique to a PC cluster running Linux.
120 lange 516
121 lange 556
122    
123     <sect id="overview">Overview and concepts<p>
124 lange 173 <p>
125 lange 1246 FAI is a non-interactive system to install a &dgl operating system
126     unattended on
127 lange 173 a single computer or a whole cluster. You can take one or more virgin
128     PC's, turn on the power and after a few minutes Linux is installed,
129     configured and running on the whole cluster, without any interaction
130 lange 312 necessary. Thus, it's a scalable method for installing and updating a
131 lange 173 cluster unattended with little effort involved. FAI uses the &dgl;
132 lange 312 distribution and a collection of shell and perl scripts for the
133 lange 173 installation process. Changes to the configuration files of the
134 lange 312 operating system can be made by cfengine, shell, perl and expect scripts.
135 lange 173
136     <p>
137     FAI's target group are system administrators how have to install
138 lange 230 Debian onto one or even hundreds of computers. Because it's a general
139 lange 783 purpose installation tool, it can be used for installing a Beowulf
140 lange 230 cluster, a rendering farm or a linux laboratory or a classroom. Also
141     large-scale linux networks with different hardware or different installation
142 lange 618 requirements are easy to establish using FAI. But don't forget to plan
143     your installation. <ref id="plan"> has some useful hints for this topic.
144     <p>
145 lange 727 First, some terms used in this manual are described.
146 lange 230
147 lange 173 <taglist>
148 lange 1704 <tag> install server : <item> <p>The host where the package
149     FAI is installed. It provides several services and data for
150     all install clients. In the examples of this manual this
151     host is called <tt>kueppers</tt>.
152 lange 325
153 lange 1275 <tag>install client : <item> A host which will be installed using
154 lange 173 FAI and a configuration from the install server. Also called
155 lange 1275 client for short. In this manual, the example hosts are
156 lange 899 called <tt>bigfoot, ant01, ant02, nucleus, atom01, atom02,...</tt></p> </item>
157 lange 1275 <tag> configuration : <item> The details of how the installation
158 lange 221 of the clients should be performed. This includes information about:
159 lange 173 <list>
160 lange 312 <item> <p>Hard disk layout</p> </item>
161 lange 1114 <item> <p>Local filesystems, their mount points and
162     mount options</p> </item>
163 lange 173 <item> <p>Software packages</p> </item>
164 lange 230 <item> <p>Keyboard layout, time zone, NIS,
165 lange 1704 XFree86 configuration, remote filesystems, user accounts,
166 lange 229 printers ...</p> </item>
167 lange 173 </list>
168 lange 1835 <tag> nfsroot : <item> A (chroot) filesystem located on the install
169 lange 312 server. It's the complete filesystem for the install
170 lange 618 clients during the installation process. All clients share the
171     same nfsroot, which they mount read only.</item>
172 lange 173 </taglist>
173    
174 lange 1275 <sect id="work">How does FAI work?<p>
175 lange 173
176 lange 582 The install client which will be installed using FAI, is
177 lange 522 booted from floppy disk or via network card. It gets an IP address and
178 lange 618 boots a linux kernel which mounts its root filesystem via NFS from the install
179 lange 312 server. After the operating system is running, the FAI startup script
180 lange 173 performs the automatic installation which doesn't need any
181 lange 230 interaction. First, the hard disks will be partitioned, filesystems are
182 lange 312 created and then software packages are installed. After that, the new
183     installed operating system is configured to your local needs using
184 lange 618 some scripts. Finally the new operating system will be booted from the local
185 lange 312 disk.
186 lange 173 <p>
187 lange 582 The details, of how to install the computer (the configuration), are
188     stored in the configuration space on the install server. Configuration
189 lange 618 files are shared among groups of computers if they are similar using the
190 lange 582 class concept. So you need not to create a configuration for every new
191     host. Hence, FAI is a scalable method to install a big cluster with a
192     great number of nodes.
193 lange 173
194     <p>
195     FAI can also be used as an network rescue system. You can boot your
196 lange 582 computer, but it will not perform an installation. Instead it will run a
197 lange 312 fully functional &dgl without using the local hard disks. Then you can
198     do a remote login and backup or restore a disk partition, check a filesystem,
199 lange 221 inspect the hardware or do any other task.
200 lange 173
201 lange 556 <sect id="features">Features<p>
202 lange 173 <list>
203 lange 1226 <item> <p>A fully automated installation can be performed</p> </item>
204 lange 582 <item> <p>Very quick unattended installation</p> </item>
205 lange 325 <item> <p>Hosts can boot from floppy or from network card </p> </item>
206 lange 1483 <item> <p>Easy creation of the common boot floppy which
207     uses grub or lilo</p> </item>
208 lange 1114 <item> <p>BOOTP and DHCP protocol and PXE boot method are supported</p> </item>
209 lange 312 <item> <p>No initial ramdisk is needed, 8MB RAM suffice</p> </item>
210 lange 618 <item> <p>Runs even on a 386 CPU </p> </item>
211 lange 397 <item> <p>The installation kernel can use modules</p> </item>
212 lange 325 <item> <p>Remote login via ssh during installation process
213     possible</p> </item>
214 lange 312 <item> <p>Two additional virtual terminals available
215 lange 173 during installation</p> </item>
216 lange 312 <item> <p>All similar configuration are shared among
217     all install clients</p> </item>
218 lange 1173 <item> <p>Log files for all installations are saved on to the installation server</p> </item>
219 lange 582 <item> <p>Shell, perl, expect and cfengine scripts are
220     supported for the configuration setup</p> </item>
221 lange 312 <item> <p>Access to a Debian mirror via NFS, FTP or HTTP</p> </item>
222     <item> <p>Keyboard layout selectable</p> </item>
223     <item> <p>Can be used as a rescue system</p> </item>
224 lange 1193 <item> <p>Tested on SUN SPARC hardware running Linux or Solaris</p> </item>
225 lange 922 <item> <p>Flexible system through easy class concept </p> </item>
226     <item> <p>Predefined Beowulf classes included </p> </item>
227 lange 707 <item> <p>Diskless client support</p> </item>
228 lange 689 <item> <p>Easily add your own functions via hooks</p> </item>
229 lange 771 <item> <p>Easily change the default behavior via hooks</p> </item>
230 lange 727 <item> <p>Lilo and grub support</p> </item>
231 lange 1114 <item> <p>ReiserFS and ext3 support</p> </item>
232 lange 1704 <item> <p>Automatic hardware detection</p> </item>
233     <item> <p>Booting and installing from CD-ROM is in progress</p> </item>
234 lange 173 </list>
235 lange 229
236 lange 173 <chapt id="inst">Installing FAI
237     <sect id="requirements">Requirements<p>
238    
239 lange 1275 The following items are required for an installation via FAI.
240 lange 173
241     <taglist>
242 lange 526 <tag>A computer: </tag><item> The computer must have a
243 lange 1704 network interface card. Unless a diskless installation
244     should be performed a local hard disk is also needed. No floppy disk,
245 lange 618 CD-ROM, keyboard or graphic card is needed.</item>
246 lange 1704
247 lange 325 <tag>BOOTP or DHCP server: </tag><item> <p>
248 lange 1704 The clients need one of these daemons to obtain boot information. But
249     you can also put all this information onto the boot floppy.</item>
250 lange 312
251 lange 325 <tag>TFTP server:<item> The TFTP daemon is used for
252 lange 1704 transferring the kernel to the clients. It's only needed when
253 lange 526 booting from network card with a boot PROM.</item>
254 lange 1704 <tag>Client root:<item> It is a mountable directory which contains the whole
255 lange 633 filesystem for the install clients during installation. It will
256 lange 1704 be created during the setup of the FAI package and is also
257 lange 756 called <strong>nfsroot</strong>.</item>
258 lange 325 <tag>Debian mirror:<item> Access to a Debian
259 lange 1835 mirror is needed. A local mirror of all Debian packages or
260     an <manref name="apt-proxy" section="8"> is recommended if
261     you install several computers.</item>
262 lange 526 <tag>Install kernel: <item> A kernel image that supports the
263 lange 1704 network card and mounts its root filesystem via NFS. The
264     Debian package <package>fai-kernels</package> provides a
265     default kernel for fai.</item>
266     <tag>Configuration space:<item> This directory tree which
267     contains the configuration data is a mounted via NFS by
268     default. But you can also get this directory from a revision
269     control system like CVS.
270 lange 173 </taglist>
271     <p>
272 lange 633 The TFTP daemon and a NFS server will be enabled automatically when
273 lange 1704 installing the FAI package. All clients must have a network card
274 lange 633 which is recognized by the install kernel.
275 lange 173 <p>
276    
277    
278 lange 325 <sect id="debian-mirror">How to create a local Debian mirror<p>
279    
280 lange 1704 The script <prgn>mkdebmirror</prgn> <footnote> You can find the script in
281     <p><file>/usr/share/fai/utils/</file>.</p> </footnote> can be used
282     for creating your own local Debian mirror. This script uses the
283 lange 1115 script <prgn>debmirror</prgn><footnote> Available as a Debian package
284 lange 633 or at the FAI homepage.</footnote> and <manref name="rsync"
285 lange 1704 section="1">. A partial Debian mirror only for i386 architecture for
286     Debian 3.0 (aka woody) without the source packages needs about
287 lange 1756 &mirrorsize of disk space. Accessing the mirror via NFS will be the
288     normal and fastest way in most cases.
289 lange 556
290 lange 1756 To use HTTP access to the local Debian mirror, install the webserver
291     software and create a symlink to the local directory where you mirror
292     is located:
293 lange 526
294 lange 1756 <example># apt-get install apache
295     # ln -s /files/scratch/debmirror /var/www/debmirror
296     </example>
297    
298     Don't forget to adjust the variable <var>FAI_SOURCES_LIST</var> in &fc
299     to access the Debian mirror.
300    
301 lange 1704 <sect id=faisetup> Setting up FAI<p>
302 lange 526
303 lange 633 Before installing FAI, you have to install the package <package>fai-kernels</package>,
304 lange 1193 which contains the install kernels for FAI. You can install both
305     packages using
306 lange 526
307     <example>
308 lange 1193 kueppers[~]# apt-get install fai fai-kernels
309     Reading Package Lists... Done
310     Building Dependency Tree... Done
311     The following NEW packages will be installed:
312     fai fai-kernels
313     0 packages upgraded, 2 newly installed, 0 to remove and 1 not upgraded.
314 lange 1341 Need to get 0B/12.7MB of archives. After unpacking 13.9MB will be used.
315 lange 1193 Selecting previously deselected package fai.
316     (Reading database ... 48317 files and directories currently installed.)
317 lange 1756 Unpacking fai (from .../main/f/fai/fai_2.4.1_all.deb) ...
318 lange 526 Selecting previously deselected package fai-kernels.
319 lange 1704 Unpacking fai-kernels (from .../fai-kernels_1.5_i386.deb) ...
320 lange 1756 Setting up fai (2.4.1) ...
321 lange 1193 To set up FAI, edit /etc/fai/fai.conf and call fai-setup.
322    
323 lange 1704 Setting up fai-kernels (1.5) ...
324 lange 526 </example>
325    
326 lange 221
327 lange 1193 You can also get the newest version of <package>fai</package> and
328     <package>fai-kernels</package> from the download page of fai and
329     install the packages using the
330     <prgn>dpkg</prgn> command.
331 lange 1483 <p>The configuration for the FAI package (not the configuration data
332     for the install clients) are defined in &fc;. Since FAI doesn't use
333     <prgn>debconf</prgn> yet, edit this file before calling
334 lange 1704 <prgn>fai-setup</prgn>. These are important variables in &fc;:
335 lange 221
336 lange 229 <taglist>
337 lange 687 <tag><var>FAI_DEBOOTSTRAP</var></tag>
338     <item>
339 lange 1483 <p>For building the nfsroot there's the command called
340     <manref name="debootstrap" section="8">. It needs
341     the location of a Debian mirror and the name of the distribution
342     (woody,sarge,sid) for which the basic Debian
343 lange 1275 system should be built.
344 lange 687 </p> </item>
345    
346 lange 618 <tag><var>FAI_SOURCES_LIST</var></tag> <item> <p>This
347 lange 1483 multi line string is the content of
348 lange 618 <file>sources.list</file> (used by <manref name="apt-get"
349 lange 1275 section="8">); it defines the location and access
350     method for the Debian mirror. If this variable is undefined,
351 lange 1483 the file <file>/etc/fai/sources.list</file> or
352     <file>/etc/apt/sources.list</file> will
353 lange 707 be used. For more information on the
354 lange 618 file format see <manref name="sources.list" section="5">.
355     </p> </item>
356 lange 221
357 lange 516 <tag><var>FAI_DEBMIRROR</var></tag>
358 lange 229 <item>
359     <p> If you have NFS access to your local Debian mirror,
360     specify the remote filesystem. It will be mounted to
361 lange 1704 <var>$MNTPOINT</var>, which must also be defined. It's
362     not needed if you use access via FTP or HTTP.</p>
363     </item>
364 lange 173
365 lange 254 <tag><var>KERNELPACKAGE</var></tag>
366     <item>
367 lange 756 <p> You must specify the software package - build with <manref
368     name="make-kpkg" section="8"> - which includes
369 lange 312 the default kernel for booting the install clients. The
370     Debian package <package>fai-kernels</package> contains the
371 lange 1483 default install kernels which supports both the BOOTP
372 lange 1704 and DHCP protocol.</p></item>
373 lange 312 <tag> <var>NFSROOT_PACKAGES</var></tag>
374     <item>
375 lange 1704 <p> This variable contains a list of additional software packages which
376 lange 1483 will be added to the nfsroot.</p></item>
377 lange 1704 <tag><var>FAI_LOCATION</var></tag>
378     <item><p>This is the host name and the remote directory of
379     the configuration space, which will be mounted via NFS.</p></item>
380 lange 1770
381     <tag><var>FAI_BOOT</var></tag>
382     <item><p>
383     which of DHCP and/or BOOTP should the server create setups for
384     (when make-fai-nfsroot is run). Default are to create setups for
385     both.
386     </p></item>
387 lange 229 </taglist>
388     <p>
389 lange 618
390     The variables <var>FAI_SOURCES_LIST</var> and <var>FAI_DEBMIRROR</var>
391     are used by the install server and also by the clients. If your
392     install server has multiple network card and different host names for
393 lange 783 each card (as for a Beowulf server), use the install
394 lange 756 server name which is known by the install clients.<p>
395 lange 618
396 lange 312 FAI uses <manref name="apt-get" section="8"> to create the nfsroot
397 lange 1275 filesystem in <file>/usr/lib/fai/nfsroot</file>. It needs about
398 lange 582 &nfsrootsize of free disk space. Before setting up FAI, you should get
399     the program <prgn>imggen</prgn>,<footnote>Available at the download
400 lange 633 page <httpsite>http://www.ltsp.org</httpsite> or from the FAI download
401     page &faidownload;.</footnote> if you like to boot from a 3Com network
402 lange 756 card. This executable converts netboot images created by <manref
403 lange 633 name="mknbi-linux" section="8">, so they can be booted by network
404     cards from 3Com. Put that executable in your path
405 lange 582 (e.g. <file>/usr/local/bin</file>). After editing &fc; call
406     <prgn>fai-setup</prgn>.
407 lange 229
408 lange 173 <example>
409 lange 1173 kueppers[~]# fai-setup
410     Account $LOGUSER=fai already exists.
411 lange 1275 Make sure that all install clients can
412 lange 1173 log into this account without a password.
413 lange 1756 Using interface eth0 to determine local hostname.
414     Adding kueppers to known_hosts.
415     /home/fai/.ssh/known_hosts created.
416     /home/fai/.ssh/authorized_keys created.
417 lange 1173 User account fai set up.
418 lange 516 Creating FAI nfsroot can take a long time and will
419 lange 1756 need more than &nfsrootsize disk space in /usr/lib/fai/nfsroot.
420     /usr/lib/fai/nfsroot already exists. Removing /usr/lib/fai/nfsroot
421     Creating nfsroot for woody using debootstrap
422 lange 1173 dpkg: base-passwd: dependency problems, but configuring anyway as you request:
423     base-passwd depends on libc6 (>= 2.2.4-4); however:
424     Package libc6 is not installed.
425     dpkg: base-files: dependency problems, but configuring anyway as you request:
426     .
427     .
428     .
429     Automatically converting /etc/network/interfaces succeeded.
430     Old interfaces file saved as interfaces.dpkg-old.
431     Creating base.tgz
432 lange 229 Upgrading /usr/lib/fai/nfsroot
433     Adding additional packages to /usr/lib/fai/nfsroot:
434 lange 1341 portmap file rdate cfengine bootpc wget rsh-client less dump
435     ext2resize strace hdparm parted dnsutils grub ntpdate
436     dosfstools sysutils dialog libdetect0 discover mdetect read-edid kudzu hwtools
437     Detecting hardware: 3c59x ide-scsi usb-uhci usb-uhci
438 lange 1483 modprobe: Can't open dependencies file /lib/modules/2.4.20/modules.dep (No such file or directory)
439 lange 1341 Skipping 3c59x; assuming it is compiled into the kernel.
440 lange 1483 modprobe: Can't open dependencies file /lib/modules/2.4.20/modules.dep (No such file or directory)
441 lange 1341 Skipping usb-uhci; assuming it is compiled into the kernel.
442 lange 1173 Creating SSH2 RSA key
443     Creating SSH2 DSA key
444     Restarting OpenBSD Secure Shell server: sshd.
445 lange 1341 DHCP environment prepared. Now enable dhcpd and the special tftp daemon
446 lange 1483 Kernel image file name = /usr/lib/fai/nfsroot/boot/vmlinuz-&kver;
447 lange 229 Output file name = /boot/fai/installimage
448 lange 1341 Kernel command line = "auto rw root=/dev/nfs nfsroot=kernel nfsaddrs=kernel ip=both"
449 lange 173
450 lange 1173 Image Creator for MBA ROMs v1.01, Date: Nov 26, 2001
451     Design and Coding by Nick Kroupetski &lt;NickKroupetski@hotmail.com&gt;
452 lange 229 Usage: imggen [OPTION] inputfile outputfile
453 lange 1341 -a, Add 3Com MBA/BootWare support
454     -r, Remove 3Com MBA/BootWare support from image file
455     -i, Show information on an image
456     -h, Help screen
457 lange 173
458 lange 229 In filename: /boot/fai/installimage
459     Out filename: /boot/fai/installimage_3com
460     Adding MBA support...
461 lange 1341 MBA support has been succesfully added
462 lange 1173 BOOTP environment prepared.
463     make-fai-nfsroot finished.
464     Stopping NFS kernel daemon: mountd nfsd.
465     Unexporting directories for NFS kernel daemon...done.
466 lange 1341 Exporting directories for NFS kernel daemon...done.
467 lange 1173 Starting NFS kernel daemon: nfsd mountd.
468 lange 229 You have no FAI configuration. Copy FAI template files with:
469 lange 633 cp -a /usr/share/fai/templates/* /usr/local/share/fai
470 lange 229 Then change the configuration files to meet your local needs.
471 lange 254 FAI setup finished.
472 lange 173 </example>
473    
474 lange 312 <p>
475 lange 1704 The warning messages from dpkg about dependencies problems can be ignored.
476 lange 1835 If you have problems running fai-setup, they stem usually from
477     make-fai-nfsroot. You may restart it by calling 'make-fai-nfsroot -r'
478     (recover). Adding '-v' gives you a more verbose output which may help you
479     pinpoint the error. If you want to create a log file you may use
480     <example>
481     sudo /usr/sbin/make-fai-nfsroot -r -v | tee make-fai-nfsroot.log
482     </example>
483     It may helpful to enter manually the chroot environment
484     <example>
485     sudo chroot /usr/lib/fai/nfsroot
486     </example>
487 lange 1704 The setup routine adds some lines to <file>/etc/exports</file> to export
488 lange 885 the nfsroot and the configuration space to all hosts that belong to
489     the netgroup <em>faiclients</em>. If you already export a parent directory
490     of these directories, you may comment out these lines, since the kernel nfs
491     server has problems exporting a directory and one of its
492     subdirectories with different options.
493    
494     All install clients must belong to this netgroup,
495 lange 825 in order to mount these directories successfully. Netgroups are
496 lange 633 defined in <file>/etc/netgroup</file> or in the corresponding NIS
497     map. An example for the netgroup file can be found in
498 lange 173 <file>/usr/share/doc/fai/examples/etc/netgroup</file>. For more
499 lange 633 information, read the manual pages <manref name="netgroup"
500 lange 1483 section="5"> and the NIS HOWTO. After changing the netgroups, the NFS
501 lange 1173 server has to reload its configuration. Use one of the following
502 lange 633 commands, depending on which NFS server you are using:
503 lange 173
504     <example>
505 lange 961 kueppers# /etc/init.d/nfs-kernel-server reload
506 lange 1173 kueppers# /etc/init.d/nfs-user-server reload
507 lange 173 </example>
508    
509     <p>
510 lange 1483 The setup also creates the account <tt>fai</tt> (defined by $LOGUSER)
511     if not already available. The log
512 lange 633 files of all install clients are saved to the home directory of this
513     account. If you boot from network card, you should change the primary
514     group of this account, so this account has write permissions to
515 lange 1704 <file>/boot/fai</file> in order to change the symbolic links to the kernel
516 lange 1275 image which is booted by a client. See also variable
517 lange 618 <var>TFTPLINK</var> in <file>class/DEFAULT.var</file>.
518 lange 312
519    
520     <p>
521 lange 173 After that, FAI is installed successfully on your server, but has no
522     configuration for the install clients. Start with the templates from
523 lange 633 <tt> /usr/share/fai/templates</tt> using the copy command above
524 lange 312 and read <ref id="config">. Before you can set up a DHCP or BOOTP
525     daemon, you should collect some network information of all your
526     install clients. This is described in section <ref id="bootfloppy">.
527 lange 229 <p>
528 lange 526 When you make changes to &fc; or want to install a new kernel to
529 lange 1275 nfsroot, the nfsroot has to be rebuilt by calling <prgn>make-fai-nfsroot</prgn>.
530 lange 173
531 lange 899 <sect1 id=troublefaisetup> Troubleshooting the setup<p>
532 lange 771
533 lange 899 The setup of FAI adds the FAI account, exports file systems and calls
534 lange 783 <prgn>make-fai-nfsroot</prgn>. If you call <tt>make-fai-nfsroot -v</tt> you
535 lange 1275 will see more messages. When using a local Debian mirror, it's
536     important that the install server can mount this directory via
537 lange 783 NFS. If this mount fails, check <file>/etc/exports</file> and <file>/etc/netgroup</file>.
538     An example can be found in <file>/usr/share/doc/fai/examples/etc/netgroup</file>.
539 lange 771
540 lange 783
541 lange 397 <chapt id="booting">Preparing booting <p>
542 lange 221
543 lange 397 Before booting for the first time, you have to choose which medium you
544     use for booting. You can use the boot floppy or configure the computer
545 lange 526 to boot via network card using a boot PROM, which is much smarter.
546 lange 173
547 lange 526 <sect id="nicboot">Booting from 3Com network card with boot PROM
548 lange 173 <p>
549 lange 312 If you have a 3Com network card that is equipped with a boot ROM by
550 lange 1114 Lanworks Technologies or already includes the DynamicAccess Managed PC
551 lange 582 Boot Agent (MBA) software<footnote> <p><httpsite>http://support.3com.com/</httpsite>
552     <httppath>infodeli/tools/nic/mba.htm</httppath></p></footnote>, you
553     can enter the MBA setup by typing <tt>Ctrl+Alt+B</tt> during boot. The
554     setup will look like this:
555 lange 397
556 lange 312 <example>
557 lange 325 Managed PC Boot Agent (MBA) v4.00
558     (C) Copyright 1999 Lanworks Technologies Co. a subsidiary of 3Com Corporation
559 lange 312 All rights reserved.
560     ===============================================================================
561     Configuration
562    
563 lange 1835 Boot Method: PXE
564    
565 lange 312 Default Boot: Network
566 lange 325 Local Boot: Enabled
567 lange 312 Config Message: Enabled
568     Message Timeout: 3 Seconds
569     Boot Failure Prompt: Wait for key
570     ===============================================================================
571     Use cursor keys to edit: Up/Down change field, Left/Right change value
572     ESC to quit, F9 restore previous settings, F10 to save
573     </example>
574    
575 lange 1835 Set the boot method to <tt>PXE</tt> or set it to <tt>TCP/IP</tt> and
576     the protocol to <tt>BOOTP</tt>. The advantage of the BOOTP protocol
577     it, that the BOOTP daemon automatically reloads its configuration when
578     it has changed, but using the PXE environment is more comfortable.
579    
580     When using BOOTP, you have to make a
581 lange 1173 symbolic link from the hostname of your client to the appropriate
582     kernel image in <file>/boot/fai</file>. In the following example the
583     host is called <tt>bigfoot</tt>. The file
584 lange 526 <file>installimage_3com</file> is created by <prgn>imggen</prgn> and
585 lange 1173 suitable for booting 3Com network cards<footnote> <p>If you have
586     problems booting with a 3Com network card and get the error "BOOTP
587     record too large" after the kernel is transfered to the computer, try
588     the imggen-1.00 program to convert the netboot image to a
589     installimage_3com image. I had this problem using netboot 0.8.1-4 and
590     Image Creator for MBA ROMs v1.01, Date: Nov 26, 2001 but only on an
591     Athlon computer.
592 lange 1835 </p></footnote>
593     You can also use the utility
594 lange 1275 <prgn>tlink</prgn> (<file>/usr/share/fai/utils/tlink</file>) to create
595     this link.
596 lange 526
597     <example>
598 lange 961 kueppers# cd /boot/fai
599     kueppers# ln -s installimage_3com bigfoot
600 lange 526 </example>
601    
602 lange 1518 <sect id="pxeboot">Booting from network card with a PXE conforming boot ROM<p>
603 lange 618 Some network cards (e.g. Intel EtherExpress PRO 100) have a fixed
604 lange 1483 boot configuration, so they can only use the PXE boot protocol. This requires a PXE
605 lange 1275 Linux boot loader and a special version of the <tt>TFTP</tt> daemon,
606 lange 1193 which is available in the Debian package <package>tftpd-hpa</package>.
607 lange 1835
608     First install following additional needed packages:
609    
610     <example>
611     # apt-get install dhcp3-server syslinux tftp-hpa
612     </example>
613    
614     Then set up the DHCP daemon. A sample configuration files can be
615 lange 961 found in <file>/usr/share/doc/fai/examples/etc/dhcpd.conf</file>.
616 lange 1483 Then enable the special tftp daemon
617 lange 961 using this line in file <file>/etc/inetd.conf</file>:
618     <example>
619 lange 1835 tftp dgram udp wait root /usr/sbin/in.tftpd in.tftpd -r blksize -s /boot/fai
620 lange 961 </example>
621    
622 lange 1115 See <file>/usr/share/doc/syslinux/pxelinux.doc.gz</file> for more
623 lange 1275 information about how to boot such an environment. There are also some
624 lange 1704 mails in the FAI mailing list archive concerning this topic. The PXE
625     environment uses the original kernel image (not the netboot image made
626     by mknbi-linux)
627 lange 1770 which is copied to <file>/boot/fai/vmlinuz-install</file>. A default
628 lange 1193 configuration for pxelinux is written to
629 lange 1115 <file>/boot/fai/pxelinux.cfg/default</file>.
630 lange 312
631 lange 397 <sect id="bootfloppy">Creating a boot floppy
632 lange 173 <p>
633 lange 1835
634     If your network card can't boot itself, you have two options. The
635     first is to create a small boot floppy that uses etherboot, so you can
636     use DHCP and TFTP to get the install kernel that was created with
637     <manref name="mknbi-linux" section="8">. A lot of ethernet cards
638     support booting via ethernet if a special boot eprom is inserted or
639     booted from floppy <httpsite>http://rom-o-matic.net/</httpsite>. In
640     depth documentation about booting via ethernet may be found at
641     <httpsite>http://etherboot.sourceforge.net</httpsite>.
642    
643     The seconde is to via floppy disk that is created with the command <manref
644 lange 1756 name="make-fai-bootfloppy" section="8">. Since there's no client specific
645 lange 1206 information on this floppy, it's suitable for all your install
646 lange 1704 clients. You can also specify additional kernel parameters for this
647     boot floppy or set other variables, if desired. Do not enable BOOTP
648     support when you have a DHCP server running in your network and vice
649     versa. This could lead to missing information. There's also a manual
650     page for <manref name="make-fai-bootfloppy" section="8">. If you have
651     no BOOTP or DHCP server, supply the network configuration as kernel
652     parameters. The format is:
653 lange 1206 <example>ip=&lt;client-ip&gt;:&lt;server-ip&gt;:&lt;gw-ip&gt;:&lt;netmask&gt;:&lt;hostname&gt;:&lt;device&gt;:&lt;autoconf&gt;
654     </example>For additional information see
655     <file>/usr/src/linux/Documentation/nfsroot.txt</file> in the kernel
656 lange 397 sources.
657    
658 lange 1518 <sect id="cdboot">Booting from a CD-ROM<p>
659    
660     There some ongoing work to create a bootable CD-ROM which can boot and
661     install an install client. Currently this script is not included in
662     the FAI package but a beta version is available. It will contain the
663     nfsroot, the configuration space and a subset of the Debian mirror,
664     which contains all packages that you need for an unattended
665 lange 1704 installation. Look at the mailing list archive of FAI for more
666 lange 1518 information. A first version is available at
667     <httpsite>http://members.iinet.net.au</httpsite><httppath>/~niall/fai/</httppath>.
668    
669 lange 397 <sect id="mac">Collecting Ethernet addresses<p>
670    
671     Now it's time to boot your install clients for the first time. They
672 lange 582 will fail to boot completely, because no BOOTP or DHCP daemon is running yet or
673 lange 397 recognizes the hosts. But you can use this first boot attempt to
674     easily collect all Ethernet addresses of the network cards.
675     <p>
676    
677 lange 312 You have to collect all Ethernet (MAC) addresses of the install clients
678     and assign a hostname and IP address to each client. To collect
679     all MAC addresses, now boot all your install clients. While the
680     install clients are booting, they send broadcast packets to the LAN. You
681 lange 1275 can log the MAC addresses of these hosts by running the following
682 lange 1483 command simultaneously on the server:
683 lange 173
684     <example># tcpdump -qte broadcast and port bootpc >/tmp/mac.lis</example>
685    
686 lange 312 <p>
687     After the hosts has been sent some broadcast packets (they will fail
688 lange 628 to boot because <prgn>bootpd</prgn> isn't running or does not recognize the MAC
689 lange 312 address yet) abort <prgn>tcpdump</prgn> by typing <tt>ctrl-c</tt>. You get a list
690 lange 173 of all unique MAC addresses with these commands:
691    
692 lange 229 <example># perl -ane 'print "\U$F[0]\n"' /tmp/mac.lis|sort|uniq</example>
693 lange 173
694 lange 312 After that, you only have to assign these MAC addresses to hostnames
695     and IP addresses (<file>/etc/ethers</file> and <file>/etc/hosts</file>
696 lange 1275 or corresponding NIS maps). With this information you can configure
697 lange 312 your <prgn>BOOTP</prgn> or <prgn>DHCP</prgn> daemon (see the section
698 lange 1704 <ref id="bootptab">). I recommend to write the MAC addresses (last
699 lange 582 three bytes will suffice if you have network cards from the same
700 lange 312 vendor) and the hostname in the front of each chassis.
701 lange 173
702 lange 526 <sect id=bootptab>Configuration of the BOOTP daemon<p>
703 lange 173
704 lange 1704 An example configuration for the BOOTP daemon can be found in
705     <file>/usr/share/doc/fai/examples/etc/bootptab</file>.
706 lange 173
707     <example>
708 lange 221 # /etc/bootptab example for FAI
709     # replace FAISERVER with the name of your install server
710 lange 173
711     .faiglobal:\
712 lange 312 :ms=1024:\
713     :hd=/boot/fai:\
714     :hn:bs=auto:\
715     :rp=/usr/lib/fai/nfsroot:
716 lange 582
717 lange 173 .failocal:\
718 lange 312 :tc=.faiglobal:\
719     :sa=FAISERVER:\
720     :ts=FAISERVER:\
721     :sm=255.255.255.0:\
722     :gw=134.95.9.254:\
723     :dn=informatik.uni-koeln.de:\
724     :ds=134.95.9.136,134.95.100.209,134.95.100.208,134.95.140.208:\
725     :ys=rubens:yd=informatik4711.YP:\
726     :nt=time.rrz.uni-koeln.de,time2.rrz.uni-koeln.de:
727 lange 173
728     # now one entry for each install client
729 lange 1704 bigfoot:ha=0x00105A240012:bf=bigfoot:tc=.failocal:T172="verbose sshd createvt debug":
730 lange 476 ant01:ha=0x00105A000000:bf=ant01:tc=.failocal:T172="sshd":
731 lange 173 </example>
732    
733     Insert one line for each install client at the end of this file as
734 lange 1115 done for the hosts <em>bigfoot</em> and <em>ant01</em>. Replace the string
735 lange 618 <tt>FAISERVER</tt> with the name of your install server. If the
736     install server has multiple network cards and host names, use the host
737     name of the network card to which the install clients are
738     connected. Then adjust the other network tags (<tt>sm, gw, dn,
739     ds</tt>) to your local needs.
740 lange 556
741     <taglist>
742 lange 1483 <tag>sm:</tag> <item> <p>Subnet mask</p> </item>
743     <tag>gw:</tag> <item> <p>Default gateway / router</p> </item>
744     <tag>dn:</tag> <item> <p>Domain name</p> </item>
745 lange 1704 <tag>ds:</tag> <item> <p>List of DNS server. The
746     <file>/etc/resolv.conf</file> file will be created using this list
747     of DNS servers and the domain name.
748 lange 1483 <tag>T172:</tag> <item> <p>List of <var>FAI_FLAGS</var>;
749     e.g. verbose, debug, reboot, createvt, sshd, syslogd</p> </item>
750     <tag>T173:</tag> <item> <p>Reserved for future use</p> </item>
751 lange 556 </taglist>
752    
753     The tags for NIS and time servers (<tt>yp, yd, nt</tt>) are
754 lange 312 optional. Tags with prefix <tt>T</tt> (starting from T170) are generic
755     tags which are used to transfer some FAI specific data to the
756 lange 1704 clients<footnote>T170=FAI_LOCATION, T171=FAI_ACTION. You should define
757     theses variables in a class/*.var script. But for backward compatibility,
758     you can define theses variables also from a BOOTP or DHCP server.</footnote>
759 lange 229
760 lange 849 The list of <var>FAI_FLAGS</var> can be space or comma
761     separated. <var>FAI_FLAGS</var> in <file>bootptab</file> must be
762     separated by whitespace. If you define <var>FAI_FLAGS</var> as
763 lange 1115 an additional kernel parameter, the flags must be separated with a
764 lange 1704 comma.
765 lange 1518 If you do not have full control over the BOOTP or DHCP daemon (because
766     this service is managed by a central service group) you can also
767 lange 1756 define the variable <var>FAI_ACTION</var> in
768 lange 1518 a <file>/fai/class/*.var</file> scripts. Look at
769 lange 1704 <file>LAST.var</file> for an example. The variable <var>T170</var>
770     can also be defined by a daemon. It's better to use a script for that.
771 lange 1518
772 lange 312 When you have created your <file>bootptab</file> file, you have to
773 lange 229 enable the BOOTP daemon once. It's installed but Debian does not enable it
774 lange 173 by default. Edit <file>/etc/inetd.conf</file> and remove the comment
775     (the hash) in the line containing <tt>#bootps</tt>. Then tell
776     <prgn>inetd</prgn> to reload its configuration.
777    
778     <example># /etc/init.d/inetd reload</example>
779    
780 lange 1483 The BOOTP daemon automatically reloads the configuration file if any changes are
781 lange 312 made to it. The daemon for DHCP must always be manually restarted
782 lange 1704 after changes to the configuration file are made.
783 lange 173
784 lange 1704 <p>
785     Now it's time to boot all install clients again!
786 lange 526 FAI can perform several actions when the client is booting. This action
787 lange 1115 is defined in the variable <var>FAI_ACTION</var>.
788 lange 1275 Be very careful if you set <var>FAI_ACTION </var> to
789 lange 526 <em>install</em>. This can destroy all your data on the install
790     client, indeed most time it should do this ;-). It's recommended to change this only
791 lange 1275 on a per-client base in the BOOTP configuration. Do not change it in
792 lange 526 the section <tt>.failocal</tt> in <file>/etc/bootptab</file>, which
793     is a definition for all clients.
794    
795 lange 771 <sect1 id=troublebootp>Troubleshooting BOOTP daemon<p>
796 lange 1275 The BOOTP daemon can also be started in debug mode if it is not
797 lange 899 enabled in <file>inetd.conf</file>:
798 lange 771 <example># bootpd -d7</example>
799    
800 lange 526 <sect id="bootdhcp">Configuration of the DHCP daemon <p>
801     An example for <manref name="dhcp.conf" section="5"> is available in
802 lange 1704 <file>/usr/share/doc/fai/examples/etc</file>, which is tested with
803     version 2.x of the DHCP daemon. Version 3 needs a slightly
804     different configuration file. Start using this example
805 lange 727 and look at all options used therein. If you make any changes
806 lange 526 to this configuration, you must restart the daemon.
807 lange 1812 <example># /etc/init.d/dhcp3-server restart</example>
808 lange 1704 Therefore it's recommended to only supply data into this configuration
809     file, which doesn't change frequently. You should define the variables
810     <var>FAI_ACTION</var> in a script in the configuration space.
811 lange 526
812     <sect id="bootmesg">Boot messages <p>
813    
814 lange 1704 These are the messages when booting from floppy disk.
815 lange 173 <example>
816 lange 1704 GRUB loading stage2..............
817     &lt now the grub menu is displayed &gt;
818     BOOTING 'FAI-BOTH'
819     kernel (fd0)/vmlinuz-2.4.20 root=/dev/nfs ip=both
820     [Linux-bzImage, setup=0x1400, size=0xd8450]
821    
822 lange 173 Uncompressing Linux... OK, booting the Kernel.
823 lange 1222 Linux version &kver; (root@kueppers) (gcc version 2.95.4 20011002
824 lange 173 .
825     .
826     .
827     </example>
828 lange 1704 After this, the rest of the boot message will be equal to those when booting from
829 lange 312 network card. When booting from network card you will see:
830 lange 173 <example>
831 lange 516 BOOTP.
832     TFTP....
833     Linux Net Boot Image Loader Version 0.8.1 (netboot)
834     .
835 lange 173 Uncompressing Linux... OK, booting the Kernel.
836 lange 1222 Linux version &kver; (root@kueppers) (gcc version 2.95.4 20011002
837 lange 173 .
838     .
839     .
840 lange 1341
841     Sending BOOTP requests . OK
842     IP-Config: Complete:
843    
844    
845 lange 173 Sending BOOTP requests ..... OK
846 lange 1341 IP-Config: Got BOOTP answer from 134.95.9.150, my address is 134.95.9.200
847 lange 173 IP-Config: Complete:
848 lange 1341 device=eth0, addr=134.95.9.200, mask=255.255.255.0, gw=134.95.9.254,
849     host=bigfoot, domain=informatik.uni-koeln.de, nis-domain=informatik4711.YP,
850     bootserver=134.95.9.150, rootserver=134.95.9.150, rootpath=/usr/lib/fai/nfsroot
851 lange 1222 Partition check:
852 lange 173 .
853     .
854 lange 522 ------------------------------------------------------
855 lange 707 FAI &faiver;, &faiverdate;
856 lange 522 Fully Automatic Installation for Debian GNU/Linux
857 lange 516
858 lange 1483 Copyright (c) 1999-2003, Thomas Lange
859 lange 522 lange@informatik.uni-koeln.de
860     ------------------------------------------------------
861 lange 922
862     Calling task_confdir
863 lange 1341 Kernel parameters:auto rw root=/dev/nfs ip=both
864 lange 922 Defining variable: root=/dev/nfs
865 lange 1341 Defining variable: ip=both
866 lange 922 Sending BOOTP request using device eth0
867 lange 1341 FAI_FLAGS: verbose=1
868 lange 1483 FAI_FLAGS: createvt=1
869 lange 1341 .
870 lange 922 Calling task_setup
871 lange 173 .
872     .
873 lange 1483 Calling task_defclass
874     /usr/bin/fai-class: Defining classes.
875     .
876     .
877 lange 922 Calling task_action
878     FAI_ACTION: install
879 lange 1275 Performing FAI installation. All data may be overwritten!
880 lange 173 .
881 lange 522 .
882 lange 173 Press &lt;RETURN&gt; to reboot or ctrl-c to execute a shell
883     </example>
884    
885 lange 522 When the copyright message is shown, the install client has mounted
886     the nfsroot<footnote> <p><file>/usr/lib/fai/nfsroot</file> from the
887 lange 1704 install server</p> </footnote> to the clients' root directory
888     <file>/</file>. This is the whole filesystem for the client at this
889     moment.
890    
891     After <tt>task_confdir</tt> is executed, the configuration space is
892     mounted or received from an CVS repository.
893    
894     Before the installation is started (FAI_ACTION=install) the computer
895     beeps three times. So, be watchful when you hear three beeps
896     but you do not want to perform an installation!
897    
898     <sect id=booterror>Troubleshooting boot messages<p>
899    
900     This is the error message you will see, when your network card is
901     working, but the install server does not export the configuration
902     space directory to the install clients.
903     <example>
904     Root-NFS: Server returned error -13 while mounting /usr/lib/fai/nfsroot
905     VFS: Unable to mount root fs via NFS, trying floppy.
906     VFS: Cannot open root device "nfs" or 02:00
907     Kernel panic: VFS Unable to mount root fs on 02:00
908     </example>
909     Use the following command to see which directories are exported
910     from the install server (named kueppers):
911     <example>showmount -e kueppers</example>
912    
913 lange 522 <p>
914 lange 556
915 lange 1275 The following error message indicates that your install client doesn't
916 lange 556 get an answer from a BOOTP server. Check your cables or start the
917     <manref name="bootpd" section="8"> daemon with the debug flag enabled.
918     <example>
919     Sending BOOTP requests ........ timed out!
920     IP-Config: Retrying forever (NFS root)...
921     </example>
922    
923 lange 526 If you get the following error message, the install kernel has
924     no driver compiled in for your network card.
925 lange 173 <example>
926     IP-Config: No network devices available
927     Partition check:
928     hda: hda1 hda2 < hda5 hda6 hda7 hda8 >
929     Root-NFS: No NFS server available, giving up.
930     VFS: Unable to mount root fs via NFS, trying floppy.
931     VFS: Insert root floppy and press ENTER
932     </example>
933 lange 1115 Then you have to compile the driver for your network card into a new
934 lange 1275 kernel. This driver must not be a kernel module. To compile the new
935 lange 1115 kernel, start using the default kernel configuration of FAI.
936 lange 312 <example>
937 lange 707 kueppers# cd /usr/src/kernel-source-&kver;
938     kueppers# cp /usr/lib/fai/nfsroot/boot/config-&kver; .config
939 lange 312 kueppers# make menuconfig
940 lange 526 </example>
941     Call <prgn>make menuconfig</prgn> and add the driver in menu <tt>Network
942     device support/Ethernet</tt> which supports your network card. Then
943     create a Debian package using <manref name="make-kpkg" section="8">:
944     <example>
945 lange 312 kueppers# make-kpkg clean
946 lange 1341 kueppers# make-kpkg --revision fai2 kernel-image
947 lange 312 </example>
948 lange 173
949 lange 526 This command creates the file
950 lange 1341 <file>/usr/src/kernel-image-&kver;_fai2_i386.deb</file>. Adjust
951 lange 522 the variable <var>KERNELPACKAGE</var> in &fc; and rebuild the nfsroot.
952 lange 312 <example>
953 lange 582 kueppers# make-fai-nfsroot
954 lange 312 </example>
955 lange 1115 After that, you have to create a new boot floppy if you need it. Now your network
956 lange 526 card should be recognized and the install kernel should mount
957 lange 628 the nfsroot successfully. More information how to compile an
958 lange 526 install kernel can be found in the <file>README</file> of the package <tt>fai-kernels</tt>.
959 lange 312
960 lange 526 <sect id="sysinfo">Collecting other system information
961 lange 312 <p>
962    
963 lange 727 Now the clients have booted with <var>FAI_ACTION</var> set to <em>sysinfo</em>. Type
964 lange 312 <tt>ctrl-c</tt> to get a shell or use <tt>Alt-F2</tt> or
965 lange 704 <tt>Alt-F3</tt> and you will get another console terminal, if you have added <tt>createvt</tt>
966     to <var>FAI_FLAGS</var>.
967 lange 312
968 lange 1275 Remote login is available via the secure shell if <tt>sshd</tt> is
969 lange 704 added to <var>FAI_FLAGS</var>. The encrypted password is set with
970 lange 1275 variable <var>FAI_ROOTPW</var> in &fc; and defaults to "fai". This
971     is only the root password during the installation process, not for the
972 lange 1115 new installed system. You can also log in without a password when
973     using <var> SSH_IDENTITY</var>. To log in from your server to the
974 lange 1275 install client (named ant01 in this example) use:
975 lange 526
976 lange 1704 <example>> ssh root@ant01
977 lange 476 Warning: Permanently added 'ant01,134.95.9.200' to the list of known hosts.
978     root@ant01's password:
979 lange 173 </example>
980    
981    
982 lange 1275 You now have a running Linux system on the install client
983     without using the local hard disk. Use this as a rescue system if
984 lange 526 your local disk is damaged or the computer can't boot properly from
985 lange 1275 hard disk. You will get a shell and you can execute various commands
986 lange 526 (dmesg, lsmod, df, lspci, ...). Look at the log file in
987 lange 1193 <file>/tmp/fai</file>. There you can find much information about the boot
988 lange 526 process.
989    
990 lange 1341 All log files from <file>/tmp/fai</file> are also written to the
991 lange 1483 <var>$LOGSERVER</var> (if not defined: the install server) into the
992     directory <tt>~fai/ant01/sysinfo/</tt><footnote>More general:
993     <tt>~$LOGUSER/$HOSTNAME/$FAI_ACTION/</tt>. Two additional symbolic
994     links are created. The symlink <file>last</file> points to the log
995     directory of the last fai action performed. The symlinks
996     <file>last-install</file> and <file>last-sysinfo</file> point to the
997 lange 1704 directory with of the last corresponding action.
998 lange 1483
999     Examples of the log
1000 lange 618 files can be found on the FAI homepage.
1001 lange 312 </footnote>
1002 lange 173
1003     <p>
1004 lange 1275 A very nice feature is that FAI mounts all filesystems it finds on
1005 lange 526 the local disks read only. It also tells you on which partition a file
1006 lange 1115 <file>/etc/fstab</file> exists. When only one file system table is found, the
1007 lange 526 partitions are mounted according to this information. Here's an
1008     example:
1009 lange 173 <example>
1010 lange 476 ant01:~# df
1011 lange 1704
1012     Filesystem 1k-blocks Used Available Use% Mounted on
1013     rootfs 2064192 1071184 888152 55% /
1014     /dev/root 2064192 1071184 888152 55% /
1015     shm 63548 76 63472 1% /tmp
1016 lange 173 kueppers:/usr/local/share/fai
1017 lange 1704 2064192 994480 964856 51% /fai
1018     /dev/hda1 54447 9859 41777 19% /tmp/target
1019     /dev/hda10 1153576 20 1141992 0% /tmp/target/files/install
1020     /dev/hda9 711540 20 711520 0% /tmp/target/home
1021     /dev/hda8 303336 13 300191 0% /tmp/target/tmp
1022     /dev/hda7 1517948 98252 1342588 7% /tmp/target/usr
1023     /dev/hda6 202225 8834 182949 5% /tmp/target/var
1024 lange 173 </example>
1025    
1026 lange 1275 <strong>This method can be used as a rescue environment!</strong> In the
1027 lange 173 future it will be possible to make backups or restore data to existing
1028 lange 522 filesystems. If you need a filesystem with read-write access use the
1029     <prgn>rwmount</prgn> command:
1030 lange 173
1031 lange 476 <example>ant01:~# rwmount /tmp/target/home</example>
1032 lange 173
1033 lange 727 <sect id=checkbootp>Checking parameters from BOOTP and DHCP servers<p>
1034 lange 173
1035 lange 727 If the install client boots with action <em>sysinfo</em>, you can also
1036     check if all information from the BOOTP or DHCP daemons are received
1037 lange 1704 correctly. The received information is written to
1038     <file>/tmp/fai/boot.log</file>. An example of the result of a BOOTP
1039 lange 1275 request can be found in <ref id="s1">.
1040 lange 727
1041    
1042 lange 633 <sect id=reboot>Rebooting the computer<p>
1043 lange 522 At any time you can reboot the computer using the command
1044 lange 618 <prgn>faireboot</prgn>, also if logged in from remote. If the
1045     installation hasn't finished, use <tt>faireboot -s</tt>, so the log
1046     files are also copied to the install server.
1047 lange 522
1048 lange 556 <chapt id=instprocess>Overview of the installation sequence<p>
1049 lange 173
1050 lange 1275 The following tasks are performed during an installation after the linux kernel
1051 lange 312 has booted on the install clients.
1052 lange 173
1053     <enumlist>
1054     <item> <p>Set up FAI </p> </item>
1055 lange 397 <item> <p>Load kernel modules</p> </item>
1056 lange 173 <item> <p>Define classes</p> </item>
1057 lange 397 <item> <p>Define variables</p> </item>
1058 lange 526 <item> <p>Partition local disks</p> </item>
1059 lange 312 <item> <p>Create and mount local filesystems</p> </item>
1060 lange 173 <item> <p>Install software packages</p> </item>
1061 lange 312 <item> <p>Call site specific configuration scripts</p> </item>
1062 lange 173 <item> <p>Save log files</p> </item>
1063     <item> <p>Reboot the new installed system</p> </item>
1064     </enumlist>
1065    
1066 lange 1275 You can also define additional programs or scripts
1067     which will be run on particular
1068 lange 825 occasions. They are called <tt>hooks</tt>. Hooks can add additional
1069 lange 756 functions to the installation process or replace the default subtasks
1070     of FAI. So it's very easy to
1071 lange 689 customize the whole installation process. Hooks are explained in
1072 lange 687 detail in <ref id="hooks">.
1073 lange 576
1074 lange 687 <p>
1075 lange 1721 The installation time is determined by the amount of software but also
1076     by the speed of the processor and hard disk. Here are some sample
1077     times. All install clients have an 100Mbit network card installed.
1078     Using a 10 Mbit LAN does not decrease the installation time
1079     considerably, so the network will not be the bottleneck when
1080     installing several clients simultaneously.
1081 lange 1704
1082     <example>
1083 lange 1721 Athlon XP1600+ , 896MB,SCSI disk, 1 GB software 6 min
1084     AMD-K7, 500MHz , 320MB, IDE disk, 780 MB software 12 min
1085     PentiumPro 200MHz , 128MB, IDE disk, 800 MB software 28 min
1086     Pentium III 850MHz, 256MB, IDE disk, 820 MB software 10 min
1087     Pentium III 850MHz, 256MB, IDE disk, 180 MB software 3 min
1088 lange 1704 </example>
1089    
1090    
1091 lange 556 <sect id=isetup>Set up FAI<p>
1092 lange 230
1093 lange 783 After the install client has booted, only the script
1094 lange 312 <file>/sbin/rcS_fai</file><footnote><p>Since the root filesystem on
1095     the clients is mounted via NFS, <prgn>rcS_fai</prgn> is located in
1096     <file>/usr/lib/fai/nfsroot/sbin</file> on the install server.</p>
1097 lange 1275 </footnote> is executed. This is the main script which controls the
1098 lange 556 sequence of tasks for FAI. No other scripts in
1099     <file>/etc/init.d/</file> are executed.
1100 lange 312 <p>
1101     A ramdisk is created and mounted to <file>/tmp</file>, which is the
1102 lange 1275 only writable directory until local filesystems are
1103 lange 312 mounted. Additional parameters are received from the BOOTP or DHCP
1104 lange 687 daemon and the configuration space if
1105 lange 1704 mounted via NFS from the install server to <file>/fai</file>. The
1106 lange 618 setup is finished after additional virtual terminals are created and
1107     the secure shell daemon for remote access is started on demand.
1108 lange 312
1109 lange 556 <sect id=iclass>Defining classes, variables and loading kernel modules<p>
1110 lange 312
1111 lange 1483 Now the script <manref name="fai-class" section="1"> is used to define
1112 lange 1704 classes. Therefore several scripts in <file>/fai/class/</file> are executed to define classes. All scripts matching <tt>[0-9]*</tt>
1113 lange 1115 are executed in alphabetical order. Scripts ending in <tt>.source</tt>
1114     are sourced, so they can define new classes by adding these classes to
1115 lange 1704 the variable <var>newclasses</var> (see <file>06hwdetect.source</file> for an
1116 lange 1063 example). Every word that these scripts print to the standard output
1117 lange 1115 are interpreted as class names. These classes are defined for the
1118 lange 1063 install client. You can also say this client belongs to these
1119     classes. A class is defined or undefined and has no value. Only
1120 lange 1206 defined classes are of interest for an install client. The description
1121 lange 1063 of all classes can be found in
1122 lange 628 <file>/usr/share/doc/fai/classes_description.txt</file>. It is
1123 lange 783 advisable to document the job a new class performs. Then, this
1124 lange 1704 documentation is the base for composing the whole configuration from classes.
1125 lange 562
1126     <p>
1127 lange 1483 The scripts <prgn>11modules.source</prgn> loads kernel modules
1128 lange 526 on demand. So you can use classes when loading modules and also define
1129     more classes after the kernel has loaded modules and recognized new hardware.
1130 lange 1704 But normally you only have to deal with the file <file>DEFAULT.mod</file>.
1131 lange 1206 The complete description of all these scripts can be found in <ref id="cscripts">.
1132 lange 1704
1133 lange 312 <p>
1134 lange 1704 The script <file>30menu.source</file> pops up a little menu and asks
1135 lange 1275 the user which kind of installation should be performed (e.g. CAD
1136 lange 1704 workstation, notebook, scientific workstation, work group server, Gnome
1137 lange 1063 desktop...). Keep in mind that this won't lead to a fully automatic
1138     installation ;-)
1139 lange 1704 <p>
1140     After defining the classes, every file matching <tt>*.var</tt> with a
1141     prefix which matches a defined class is executed to define variables.
1142     There, you should define the variable <var>FAI_ACTION</var> and
1143     others. Currently, <var>FAI_ACTION</var> is defined in
1144     <file>LAST.var</file> for all install clients.
1145 lange 1063
1146 lange 582
1147 lange 556 <sect id=ipartition>Partitioning local disks, creating filesystems<p>
1148 lange 312
1149 lange 1704 For disk partitioning exactly one disk configuration file from
1150 lange 628 <file>/fai/disk_config</file> is selected using classes. It's the
1151 lange 1704 description of how all the local disks will be partitioned, where
1152     filesystems should be created (and their types like ext2, ext3,
1153     reiserfs), and how they are mounted. It's also possible to preserve
1154     the disk layout or to preserve the data on certain partitions. It's
1155     done by the command <prgn>setup_harddisks</prgn>, which uses
1156     <prgn>sfdisk</prgn> for partitioning. The format of the configuration
1157     file is described in
1158 lange 526 <file>/usr/share/doc/fai/README.disk_config</file>.
1159     <p>
1160     During the installation process all local filesystems are mounted
1161 lange 1483 relative to <file>/tmp/target</file>. For example
1162     <file>/tmp/target/home</file> will become <file>/home</file> in the
1163     new installed system.
1164 lange 312
1165 lange 556 <sect id=ipackages>Installing software packages<p>
1166 lange 312
1167     When local filesystems are created, they are all empty (except for
1168     preserved partitions). Now the Debian base system and all requested
1169 lange 556 software packages are installed on the new filesystems. First the
1170 lange 522 base archive is unpacked, then the command
1171 lange 1483 <manref name="install_packages" section="8"> installs all packages using <manref
1172 lange 1275 name="apt-get" section="8"> without any manual interaction needed. If
1173 lange 1115 a packages requires an other package, <manref name="apt-get" section="8"> resolves
1174 lange 526 this dependency by installing the required package.
1175     <p>
1176 lange 312
1177 lange 526 Classes are also used when selecting the configuration files in
1178 lange 531 <file>/fai/package_config/</file> for software installation. The
1179     format of the configuration files is described in <ref
1180 lange 582 id="packageconfig">.
1181 lange 526
1182 lange 618 <sect id=icscripts>Site specific configuration<p>
1183 lange 312
1184 lange 526 After all requested software packages are installed, the system is
1185 lange 312 nearly ready to go. But not all default configurations of the software
1186     packages will meet your site specific needs. So you can call arbitrary
1187 lange 1704 scripts which adjust the system configuration. Therefore scripts which
1188     match a class name in <file>/fai/scripts</file> will be executed. If
1189 lange 1193 <file>/fai/scripts/</file><var>classname/</var> is a directory, all
1190 lange 1071 scripts that match <tt>S[0-9]*</tt> in this directory are executed. So
1191 lange 1704 it is possible to have several scripts of different types (shell,
1192     cfengine, ...) to be executed for one class. FAI comes with some
1193     templates for these scripts, but you can write your own Bourne, bash,
1194     perl, cfengine or expect scripts.
1195 lange 312 <p>
1196 lange 618 These important scripts are described in detail in <ref
1197     id="cscripts">.
1198 lange 312
1199 lange 582 <sect id=isavelog>Save log files<p> When all installation tasks are
1200     finished, the log files are written to
1201 lange 522 <tt>/var/log/fai/$HOSTNAME/install/</tt> <footnote>
1202 lange 582 <p><file>/var/log/fai/localhost/install/</file> is a link to this
1203 lange 1704 directory.</p> </footnote> on the new system and to the account on the
1204     install server if <var>$LOGUSER</var> is defined in &fc;. It is also
1205     possible to specify another host as destination of the log saving by
1206     in a file in <file>/fai/class/</file>. Additionally, two symlinks will
1207     be created to indicated the last directory written.
1208 lange 312
1209 lange 556 <sect id=ireboot>Reboot the new installed system<p>
1210 lange 531
1211 lange 1704 At least the system is automatically rebooted if "reboot" was added to
1212     <var>FAI_FLAGS</var>. This is only useful
1213 lange 618 if booting from network card or if you can change the boot device
1214 lange 1704 using the command <manref name="bootsector" section="8">. Otherwise, you have to
1215 lange 618 remove the floppy disk and type return or call <prgn>faireboot</prgn>
1216 lange 1115 from a remote login. You must change the boot device to boot the new
1217 lange 618 installed system otherwise the installation would be performed
1218 lange 1275 again. Read <ref id="changeboot"> for how to change the boot device.
1219 lange 531
1220 lange 556 <chapt id=plan>How to plan your installation<p>
1221 lange 531 <em>Plan your installation, and FAI installs your plans.</em>
1222     <p>
1223 lange 556 Before starting your installation, you should spend much time in
1224 lange 1275 planning your installation. When you're happy with your installation
1225     concept, FAI can do all the boring, repetitive tasks to turn your plans
1226     into practice. FAI can't do good installations if your concept is
1227     imperfect or lacks some important details. Start planning the
1228     installations by answering the following
1229 lange 556 questions:
1230 lange 531
1231     <taglist>
1232 lange 556 <tag></tag> <item> <p>Will I create a Beowulf cluster, or do I
1233 lange 1275 have multiple workstations, each only used by a single user?</p> </item>
1234 lange 1704 <tag></tag> <item> <p>How does my LAN topology looks like?</p> </item>
1235 lange 1275 <tag></tag> <item> <p>Do I have uniform hardware?</p> </item>
1236     <tag></tag> <item> <p>Will the hardware stay uniform in the future?</p> </item>
1237 lange 1704 <tag></tag> <item> <p>Does the hardware need a special kernel?</p> </item>
1238 lange 1275 <tag></tag> <item> <p>How should the hosts be named?</p> </item>
1239     <tag></tag> <item> <p>How should the local hard disks be partitioned?</p> </item>
1240 lange 1704 <tag></tag> <item> <p>Which applications will be run by the users?</p> </item>
1241     <tag></tag> <item> <p>Do the users need a queueing system?</p> </item>
1242 lange 1275 <tag></tag> <item> <p>What software should be installed?</p> </item>
1243     <tag></tag> <item> <p>Which daemons should be started, and what
1244     should the configuration for these look like?</p> </item>
1245     <tag></tag> <item> <p>Which remote filesystems should be mounted?</p> </item>
1246     <tag></tag> <item> <p>How should backups be performed?</p> </item>
1247 lange 556 </taglist>
1248 lange 531
1249 lange 1704 You also have to think about user accounts, printers, a mail system, cron jobs,
1250 lange 582 graphic cards, dual boot, NIS, NTP, timezone, keyboard layout,
1251     exporting and mounting directories via NFS and many other things. So,
1252 lange 628 there's a lot to do before starting an installation. And remember
1253 lange 582 that knowledge is power, and it's up to you to use it. Installation
1254     and administration is a process, not a product. FAI can't do things
1255     you don't tell it to do.
1256 lange 556 <p>
1257     But you need not to start from scratch. Look at all files and scripts
1258     in the configuration space. There are a lot of things you can use for
1259 lange 582 your own installation.
1260 lange 556
1261     A good paper with more aspects of building an infrastructure is
1262 lange 562 <url id="http://www.infrastructures.org/papers/bootstrap/">
1263     "Bootstrapping an Infrastructure".
1264 lange 556
1265 lange 562 <chapt id=config>Installation details<p>
1266 lange 556
1267 lange 756 <sect id=c3>The configuration space<p>
1268 lange 592
1269 lange 1275 The configuration is the collection of information about how exactly to
1270 lange 618 install a computer. The central configuration space for all install
1271 lange 1115 clients is located on the install server in <file>/usr/local/share/fai</file>
1272 lange 618 and its subdirectories. This will be mounted by the install clients to
1273 lange 1704 <file>/fai</file>. It's also possible to receive all the
1274 lange 1206 configuration data from a <manref name="cvs" section="1"> repository.
1275 lange 1275 The following subdirectories are present and include
1276 lange 817 several files:
1277 lange 592
1278     <taglist>
1279 lange 618 <tag><tt>class/</tt></tag> <item> <p>Scripts and files to
1280 lange 783 define classes and variables and to load kernel modules.</p> </item>
1281 lange 1206
1282 lange 618 <tag><tt>disk_config/</tt></tag> <item> <p>Configuration
1283 lange 727 files for disk partitioning and file system creation.</p> </item>
1284 lange 1206
1285     <tag><tt>debconf/</tt></tag> <item> <p>This directory holds
1286     all <manref name="debconf" section="8"> data. Not yet used.</p> </item>
1287    
1288 lange 783 <tag><tt>package_config/</tt></tag> <item> <p>File with
1289     lists of software
1290 lange 727 packages to be installed or removed.</p> </item>
1291 lange 1206
1292 lange 1115 <tag><tt>scripts/</tt></tag> <item> <p>Script for local site
1293     customization.</p> </item>
1294 lange 1206
1295 lange 618 <tag><tt>files/</tt></tag> <item> <p>Files used by
1296 lange 1275 customization scripts, e.g. user created kernel
1297     packages. Most files are located in a subtree structure
1298     which reflects the ordinary directory tree. For example, the
1299 lange 817 templates for <file>nsswitch.conf</file> are located in
1300 lange 1704 <file>/fai/files/etc/nsswich.conf</file>. The directory
1301     <file>files/pacakges/</file> can contain you local Debian
1302     packages, which can be installed when adding them to the
1303     variables <var>addpackages</var>. See <ref
1304     id="classvariables"> for more information.</p> </item>
1305 lange 817
1306 lange 727 <tag><tt>hooks/</tt></tag> <item> <p>Hooks are user defined
1307 lange 1151 programs or scripts, which are called during the
1308     installation process.</p> </item>
1309 lange 592 </taglist>
1310    
1311 lange 817 The main installation script <prgn>rcS_fai</prgn> uses all these
1312 lange 1704 subdirectories in the order listed except for hooks. The FAI package contains templates
1313 lange 817 for all these configuration scripts and files in
1314 lange 1114 <file>/usr/share/fai/templates</file>. Copy the configuration templates
1315 lange 817 to the configuration space and start an installation. These files need
1316     not belong to the root account. You can change their ownership and
1317 lange 795 then edit the configuration with a normal user account.
1318 lange 592
1319 lange 618 <example>
1320 lange 795 # cp -a /usr/share/fai/templates/* /usr/local/share/fai
1321     # chown -R fai /usr/local/share/fai
1322 lange 618 </example>
1323 lange 592
1324 lange 1206 These files contain configuration for some example hosts. Examples
1325     are: a cluster of workstations (<em>bigfoot, ant01, ant02,...</em>)
1326     and a Beowulf cluster with a master node called <em>nucleus</em> and
1327 lange 1704 computing nodes called <em>atom01, atom02,...</em> and our desktop
1328     machines <em>kueppers, dom</em> and our notebooks <em>pittermaennche, paeffgen</em>.
1329 lange 618
1330 lange 592 <taglist>
1331 lange 756 <tag>bigfoot</tag> <item> <p>This is a server with much software. It
1332 lange 1115 provides the home directory and <file>/usr</file> for its NFS clients. Also some
1333 lange 628 daemons are installed and activated by default.</p> </item>
1334 lange 756 <tag>ant01,...</tag> <item> <p>These dataless clients mount
1335 lange 783 <file>/usr</file> and <file>/home</file> from <em>bigfoot</em>. Most of
1336 lange 1275 the disk space is spent on a scratch partition, which is exported
1337 lange 1704 to a netgroup of hosts. The host <em>kueppers</em> has a similar
1338     configuration.</p> </item>
1339 lange 771
1340 lange 783 <tag>nucleus</tag> <item> <p>This Beowulf master node is a server with much software. It
1341 lange 1115 provides the home directory and <file>/usr/local</file> for its computing nodes. Also some
1342 lange 771 daemons are installed and activated by default.</p> </item>
1343 lange 817 <tag>atom01,...</tag> <item> <p>These Beowulf clients mount
1344 lange 771 <file>/usr/local</file> and <file>/home</file> from <em>nucleus</em>. Most of
1345 lange 1275 the disk space is spent on a scratch partition, which is exported
1346 lange 1115 to a netgroup of hosts. All scratch partitions are mounted on all
1347     Beowulf clients via the automounter.</p> </item>
1348 lange 1704
1349     <tag>dom</tag> <item> <p>It's a desktop machine, which mounts
1350     <file>/home</file> from a server and synchronizes the
1351     <file>/usr/local</file> partition via <manref name="rsync"
1352     section="1"> from the server. If it belongs to the class
1353     <tt>USR_LOCAL_MOUNT</tt> it will mount this directory from the
1354     server.</p> </item>
1355 lange 592 </taglist>
1356 lange 618 Start looking at these examples and study them. Then change or add
1357     things to these examples. But don't forget to plan your own
1358 lange 1275 installation!
1359 lange 592
1360 lange 783 <sect id=tasks>The default tasks<p>
1361    
1362 lange 795 After the kernel has booted, it mounts the root file system via NFS
1363 lange 1206 from the install server and <manref name="init" section="8"> starts the script
1364     <file>/sbin/rcS_fai</file>. This script controls the
1365 lange 817 sequence of the installation. No other scripts in
1366 lange 1115 <file>/etc/init.d/</file> are used.
1367 lange 783 <p>
1368    
1369 lange 817 The installation script uses many subroutines, which are defined in
1370 lange 1275 <file>/usr/share/fai/subroutines</file>, and an operating system specific
1371 lange 1206 file <footnote><file>/usr/share/fai/subroutines-linux</file> for Linux,
1372 lange 1275 <file>/usr/share/fai/subroutines-sunos</file> for Solaris.</footnote>.
1373     All important tasks of the
1374 lange 1115 installation are called via the subroutine <tt>task</tt>
1375 lange 1275 appended by the name of the task as an option (e.g. <tt>task
1376 lange 817 instsoft</tt>). The subroutine <tt>task</tt> calls hooks with prefix
1377     <em>name</em> if available and then calls the default task (defined as
1378     <tt>task_<em>name</em></tt> in <file>subroutines</file>). The default
1379 lange 1206 task and its hooks can be skipped on demand by using the subroutine
1380     <tt>skiptask()</tt>.<p>
1381 lange 817
1382 lange 1206 Now follows the description of all default tasks.
1383 lange 783 <taglist>
1384    
1385 lange 1483 <tag>confdir</tag> <item><p>The kernel appended parameters define
1386 lange 795 variables, the syslog and kernel log daemon are started. The list of
1387 lange 783 network devices is stored in <var>$netdevices</var>. Then additional
1388 lange 1275 parameters are fetched from a DHCP or BOOTP server and also
1389     additional variables
1390 lange 1704 are defined. The DNS resolver configuration file is created. The
1391 lange 783 configuration space is mounted from the install server to
1392 lange 1206 <file>/fai</file> or it is checked out from the corresponding <manref
1393     name="cvs" section="1"> repository. To use a cvs repository, you have
1394     to set the variables <var>$FAI_CVSROOT, $FAI_CVSTAG,
1395     $FAI_CVSMODULE</var>. For details look a the subroutine
1396     <prgn>get_fai_cvs()</prgn>. After that, the file
1397 lange 1275 <file>/fai/hooks/subroutines</file> is sourced if it exists. Using
1398 lange 1206 this file, you can define your own subroutines or override the
1399     definition of FAI's subroutines.
1400 lange 783
1401 lange 795 <tag>setup</tag> <item><p>This task sets the system time, all
1402 lange 817 <var>FAI_FLAGS</var> are defined and two additional virtual
1403 lange 795 terminals are opened on demand. A secure shell daemon is started
1404 lange 1704 on demand for remote logins.
1405 lange 783
1406 lange 1704 <tag>defclass</tag> <item><p>Calls <manref name="fai-class"
1407     section="1"> t odefine classes using scripts and
1408 lange 817 files in <file>/fai/class</file> and classes from
1409 lange 1193 <file>/tmp/fai/additional-classes</file>.</p> </item>
1410 lange 817
1411     <tag>defvar</tag> <item><p>Sources all files
1412     <file>/fai/class/*.var</file> for every defined class. If a hook
1413     has written some variable definitions to the file
1414 lange 1193 <file>/tmp/fai/additional.var</file>, this file is also
1415 lange 817 sourced.</p></item>
1416    
1417 lange 795 <tag>action</tag> <item><p>Depending on the value of
1418     <var>$FAI_ACTION</var> this subroutine decides which action FAI
1419 lange 1704 should perform. The default available actions are:
1420     <tt>sysinfo</tt> and <tt>install</tt>. If <var>$FAI_ACTION</var>
1421     has another value, a user defined action is called if a file
1422     <file>/fai/hooks/$FAI_ACTION</file> exists. So you
1423     can easily define your own actions.<p>
1424 lange 783
1425 lange 817
1426 lange 783 <tag>sysinfo</tag> <item><p>Called when no installation is
1427 lange 795 performed but the action is <tt>sysinfo</tt>. It shows information
1428     about the detected hardware and mounts the local hard disks read
1429 lange 1704 only to <file>/tmp/target/<var>partitionname</var></file> or with regard to a
1430 lange 825 <file>fstab</file> file found inside a partition. Log files are
1431     stored to the install server.</p> </item>
1432 lange 783
1433     <tag>install</tag> <item><p>This task controls the installation
1434 lange 1704 sequence. You will here three beeps before the installation
1435     starts. The major work is to call other tasks and to save the
1436 lange 1193 output to <file>/tmp/fai/rcS.log</file>. If you have any problems
1437 lange 1704 during installation, look at all files in
1438     <file>/tmp/fai/</file>. You can find examples of the log files
1439     for some hosts in the download directory of the FAI homepage.</p>
1440     </item>
1441 lange 783
1442 lange 795 <tag>partition</tag> <item><p>Calls <prgn>setup_harddisk</prgn>
1443 lange 817 to partition the hard disks. The task writes variable
1444 lange 1206 definitions for the root and boot partition and device (<var>$ROOT_PARTITION,
1445     $BOOT_PARTITION, $BOOT_DEVICE</var>) to
1446 lange 1275 <file>/tmp/fai/disk_var.sh</file> and creates a <file>fstab</file> file.</p></item>
1447 lange 783
1448     <tag>mountdisks</tag> <item><p>Mounts the created partitions
1449 lange 1193 according to the created <file>/tmp/fai/fstab</file> file relative to
1450 lange 795 <var>$FAI_ROOT</var>.</p> </item>
1451 lange 783
1452 lange 795 <tag>extrbase</tag> <item><p>Extracts the base tar file
1453 lange 1206 <file>base.tgz</file>, which consists of all required
1454 lange 1226 packages. This is a snapshot of a basic Debian system created
1455 lange 1206 by <manref name="debootstrap" section="8"></p> </item>
1456 lange 783
1457 lange 1206 <tag>mirror</tag> <item><p>If a local Debian mirror is accessed via NFS
1458 lange 1275 (when <var>$FAI_DEBMIRROR</var> is defined), this directory will
1459 lange 1206 be mounted to <var>$MNTPOINT</var>.</p> </item>
1460 lange 783
1461 lange 1704 <tag>updatebase</tag> <item><p>Prepares the extracted Debian
1462     base system for further installation and updates the list of
1463     available packages. Updates the packages to the newest
1464     version. It also fakes some commands (called diversions) inside
1465     the new installed system using <manref name="dpkg-divert"
1466     section="8">.</p>
1467     </item>
1468 lange 783
1469 lange 795 <tag>instsoft</tag> <item><p>Installs the desired software
1470     packages using class files in
1471     <file>/fai/packages_config</file>.</p> </item>
1472 lange 783
1473 lange 795 <tag>configure</tag> <item><p>Calls scripts in
1474 lange 1206 <file>/fai/scripts/</file> and its subdirectories for every
1475     defined class.</p> </item>
1476 lange 783
1477 lange 1115 <tag>finish</tag> <item><p>Unmounts all filesystems in the
1478 lange 825 new installed system and removes diversions of files
1479 lange 1704 using the command <prgn>fai-divert</prgn>.</p></item>
1480 lange 783
1481 lange 1226 <tag>faiend</tag> <item><p>Wait for background jobs to finish
1482 lange 1704 (e.g. emacs compiling lisp files) and automatically reboots the install
1483 lange 795 clients or waits for manual input before reboot.</p> </item>
1484 lange 783
1485 lange 1275 <tag>chboot</tag> <item><p>Changes the symbolic link on the install
1486     server which indicates which kernel image to load on the next
1487 lange 1206 boot from network card via TFTP.</p> </item>
1488 lange 783
1489 lange 795 <tag>savelog</tag> <item><p>Saves log files to local disk and to
1490 lange 1341 the account <var>$LOGUSER</var> on <var>$LOGSERVER</var> (defaults to
1491 lange 1704 the install server). Currenty the file <file>error.log</file>
1492     will not be copied to the log server.</p> </item>
1493 lange 783
1494     </taglist>
1495    
1496    
1497 lange 795 <sect id=s1>The setup routines of the install clients<p>
1498 lange 562
1499 lange 795 After the subroutine <prgn>fai_init</prgn> has done some basic
1500 lange 1206 initialization (create ramdisk, read <file>fai.conf</file> and all
1501     subroutines definitions, set path, print copyright notice), the setup
1502     continues by calling the task <tt>confdir</tt> and the task
1503 lange 1704 <tt>setup</tt>. The command <prgn>get-boot-info</prgn> is called to
1504     get all information from the BOOTP or DHCP server. This command writes
1505     the file <file>/tmp/fai/boot.log</file>, which then is sourced to
1506     define the corresponding global variables. This is an example for this
1507     log file when using a BOOTP server.
1508 lange 562 <example>
1509 lange 1704 # cat /tmp/fai/boot.log
1510 lange 562
1511 lange 1704 netdevices_all=" eth0"
1512     netdevices_up=""
1513     netdevices="eth0"
1514 lange 838 # --- network device eth0 ---
1515 lange 1704 SERVER='134.95.9.150'
1516 lange 562 IPADDR='134.95.9.200'
1517 lange 1704 BOOTFILE='/boot/fai'
1518 lange 562 NETMASK='255.255.255.0'
1519     NETWORK='134.95.9.0'
1520     BROADCAST='134.95.9.255'
1521     GATEWAYS_1='134.95.9.254'
1522     GATEWAYS='134.95.9.254'
1523     ROOT_PATH='/usr/lib/fai/nfsroot'
1524     DNSSRVS_1='134.95.9.136'
1525 lange 1704 DNSSRVS_2='134.95.129.23'
1526 lange 562 DNSSRVS_3='134.95.100.208'
1527     DNSSRVS_4='134.95.140.208'
1528 lange 1704 DNSSRVS='134.95.9.136 134.95.129.23 134.95.100.208 134.95.140.208'
1529 lange 562 DOMAIN='informatik.uni-koeln.de'
1530     SEARCH='informatik.uni-koeln.de uni-koeln.de'
1531     YPSRVR_1='134.95.9.10'
1532     YPSRVR='134.95.9.10'
1533     YPDOMAIN='informatik4711.YP'
1534     TIMESRVS_1='134.95.9.10'
1535     TIMESRVS='134.95.9.10'
1536 lange 1704 NTPSRVS_1='192.76.170.145'
1537     NTPSRVS_2='134.95.4.37'
1538     NTPSRVS='192.76.170.145 134.95.4.37'
1539 lange 562 HOSTNAME='bigfoot'
1540 lange 1704 T172='verbose sshd createvt syslogd'
1541     # define variable if T17x is defined
1542     [ "$T170" ] && FAI_LOCATION=$T170
1543     [ "$T171" ] && FAI_ACTION=$T171
1544     [ "$T172" ] && FAI_FLAGS=$T172
1545 lange 562 </example>
1546    
1547 lange 1704 The last part is shell code which maps the T17X tags to shell variables.
1548 lange 817 The tag <tt>T172</tt> is the definition for <var>$FAI_FLAGS</var>. It
1549 lange 1275 contains a space separated list of flags. The following flags are known:
1550 lange 576 <taglist>
1551 lange 704 <tag>verbose</tag> <item> <p>Create verbose output during
1552 lange 1275 installation. This should always be the first flag, so consecutive
1553 lange 727 definitions of flags will be verbosely displayed.</p> </item>
1554 lange 576
1555 lange 1206 <tag>debug</tag> <item> <p>Create debug output. No unattended
1556 lange 576 installation is performed. During package installation you have to
1557 lange 1206 answer all questions of the postinstall scripts on the
1558 lange 1275 client's console. </p> </item>
1559 lange 576
1560 lange 817 <tag>sshd</tag> <item> <p>Start the ssh daemon to enable remote
1561     logins.</p> </item>
1562 lange 576
1563 lange 1341 <tag>syslogd</tag> <item> <p>Start the system and kernel log daemon, so
1564     processes can use it to give out information. This flag should only be
1565     used when the syslogd is not already running on the system, so it should
1566     only be set when initially installing, <em>not</em> on updates!
1567     </p> </item>
1568    
1569 lange 817 <tag>createvt</tag> <item> <p>Create two virtual terminals and
1570     execute a bash if <tt>ctrl-c</tt> is typed in the console
1571     terminal. The additional terminals can be accessed by typing
1572 lange 825 <tt>Alt-F2</tt> or <tt>Alt-F3</tt>. Otherwise no terminals are
1573 lange 817 available and typing <tt>ctrl-c</tt> will reboot the install
1574 lange 1704 client. Setting this flag is useful for debugging. If you want an
1575     installation which should not be interruptible, do not set this
1576     flag.</p> </item>
1577 lange 704
1578 lange 1114 <tag>reboot</tag> <item> <p>Reboot the install client after installation
1579 lange 1704 is finished without typing RETURN on the console. This is only useful if you can
1580 lange 1114 change the boot image or boot device automatically or your assembly robot
1581 lange 1704 can remove the boot floppy via remote control :-)
1582     Currently this should only be used when
1583 lange 1206 booting from network card and using <var>$TFTPLINK</var>.</p> </item>
1584 lange 576 </taglist>
1585    
1586    
1587 lange 633 <sect id=classc> The class concept<p>
1588    
1589 lange 1151 Classes determine which configuration file to choose from a list of
1590     available templates. Classes are used in all further tasks of the
1591     installation. To determine which config file to use, an install
1592 lange 1275 client searches the list of defined classes and uses all
1593 lange 1151 configuration files that match a class name. It's also possible to use
1594     only the configuration file with the highest priority since the order
1595 lange 1275 of classes define the priority from low to high. There are some
1596 lange 1206 predefined classes (DEFAULT, LAST and the hostname), but classes can
1597     also be listed in a file or defined dynamically by scripts. So it's
1598     easy to define a class depending on the subnet information or on some
1599     hardware that is available on the install client.
1600 lange 1151 <p>
1601 lange 633 The idea of using classes in general and using certain files matching
1602     a class name for a configuration is adopted from the installation
1603     scripts by Casper Dik for Solaris. This technique proved to be very
1604     useful for the SUN workstations, so I also use it for the fully
1605     automatic installation of Linux. One simple and very efficient feature
1606 lange 1226 of Casper's scripts is to call a command with all files (or on the
1607 lange 1275 first one) whose file
1608     names are also a class. The following loop implements this function
1609 lange 1704 in pseudo shell code:
1610 lange 633
1611     <example>
1612 lange 825 for class in $all_classes; do
1613 lange 633 if [ -r $config_dir/$class ]; then
1614 lange 1704 your_command $config_dir/$class
1615 lange 1275 # exit if only the first matching file is needed
1616 lange 633 fi
1617     done
1618     </example>
1619 lange 1115 Therefore it is possible to add a new file to
1620 lange 633 the configuration without changing the script. This is because the
1621 lange 1226 loop automatically detects new configurations files that should be
1622 lange 633 used. Unfortunately cfengine does not support this nice feature, so
1623     all classes being used in cfengine need also to be specified inside
1624     the cfengine scripts. Classes are very important for the fully
1625     automatic installation. If a client belongs to class <tt>A</tt>, we
1626     say the class <tt>A</tt> is defined. A class has no value, it is just
1627     defined or undefined. Within scripts, the variable <var>$classes</var>
1628     holds a space separated list with the names of all defined classes.
1629     Classes determine how the installation is performed. For example, an
1630 lange 1704 install client can be configured to become a FTP server by just adding
1631     the class <tt>FTP</tt> to it.
1632 lange 633
1633     Mostly a configuration is created by only changing or appending the
1634     classes to which a client belongs, making the installation of a new
1635 lange 1704 client very easy. Thus no additional information needs to be added to
1636 lange 1275 the configuration files if the existing classes suffice for your needs.
1637 lange 633 There are different possibilities to define classes:
1638     <enumlist>
1639 lange 634 <item><p>Some default classes are defined for every host:
1640     DEFAULT, LAST and its hostname.</p> </item>
1641 lange 1115 <item><p>Classes may be listed within a file.</p> </item>
1642 lange 633 <item><p>Classes may be defined by scripts.</p> </item>
1643     </enumlist>
1644    
1645     The last option is a very nice feature, since these scripts will
1646 lange 1704 define classes automatically. For example, several classes are
1647     defined only if certain hardware is identified. We use Perl and shell
1648     scripts to define classes. All names of classes, except the hostname,
1649 lange 633 are written in uppercase. They must not contain a hyphen, a hash or a
1650     dot, but may contain underscores. A description of all classes can be
1651     found in <file>/usr/share/doc/fai/classes_description.txt</file>.
1652     <p>
1653    
1654     Hostnames should rarely be used for the configuration files in the
1655 lange 1114 configuration space. Instead, a class should be defined and
1656 lange 1704 then added for a given host. This is because most of the time the
1657     configuration data is not specific for one host, but is can be shared
1658     among several hosts.
1659 lange 633
1660 lange 756 <sect id=s2> Defining classes<p>
1661 lange 562
1662 lange 1354 The default task <em>defclass</em> calls the script <manref
1663 lange 1704 name="fai-class" section="1"> to define classes. Therefore, scripts
1664     matching <tt>[0-9][0-9]*</tt> in <tt>/fai/class</tt> are
1665     executed. Additionally, files in this directory can contain a list of
1666     classes. We use a file <file>koeln</file> which is used for all our
1667     hosts that belong to a certain subnet. When we want to add a class to
1668     all these hsots, we just add the class to this file.
1669     For more information on defining class, read the manual pages for <manref
1670     name="fai-class" section="1">. <p>
1671 lange 1354
1672 lange 795 The list of all defined classes is stored in the variable
1673 lange 1704 <var>$classes</var> and saved to
1674     <file>/tmp/fai/FAI_CLASSES</file>. The list of all classes is
1675     transfered to <prgn>cfengine</prgn>, so it can use them too. The
1676     script <file>01alias</file> (see below) is used to define classes for
1677     several groups of hosts. First this script defines the class with the
1678     name of the hardware architecture in uppercase letters. All hosts
1679     with the prefix <var>ant</var> use all classes in the file
1680     <file>anthill</file>. Hosts which have an IP address in subnet
1681     134.95.9.0 also belong to the class <tt>NET_9</tt>, hosts in ther
1682     class B subnet 134.95 use all classes of the file
1683     <file>koeln</file>. All Beowulf nodes with prefix <var>atom</var>
1684     except <var>atom00</var> (master server) will belong to the classes
1685     listed in file <file>atoms</file>. Some notebooks get also some
1686     special classes.
1687 lange 576
1688     <example>
1689 lange 1354 # cat 01alias
1690 lange 576
1691 lange 1483 uname -s | tr /a-z/ /A-Z/
1692 lange 1704 [ -x "`which dpkg`" ] && dpkg --print-installation-architecture | tr /a-z/ /A-Z/
1693 lange 1151
1694 lange 576 # all hosts named ant?? are using the classes in file anthill
1695     case $HOSTNAME in
1696 lange 795 ant??) cat anthill ;;
1697 lange 576 esac
1698    
1699 lange 1704 # all hosts named nuerburg? are becoming web kiosk systems
1700     case $HOSTNAME in
1701     nuerburg?) cat wwwkiosk ;;
1702     esac
1703    
1704     # the Beowulf cluster; all nodes except the master node
1705 lange 795 # use classes from file class/atoms
1706     case $HOSTNAME in
1707 lange 1704 atom00) echo BEOWULF_MASTER ;;
1708 lange 795 atom??) cat atoms ;;
1709     esac
1710    
1711 lange 576 # if host belongs to class C subnet 134.95.9.0 use class NET_9
1712 lange 1483 # exclude all hosts with an IP address above 200
1713 lange 576 case $IPADDR in
1714 lange 1483 134.95.9.2??) ;;
1715 lange 1704 134.95.*.*) cat koeln ; echo "CS_KOELN NET_9" ;;
1716     134.95.9.*) echo "CS_KOELN NET_9" ;;
1717 lange 576 esac
1718 lange 1704
1719     # our notebooks
1720     case $HOSTNAME in
1721     paeffgen|schlaeffli)
1722     cat notebook
1723     echo "BOOTWINDOWS"
1724     ;;
1725     pittermaennche)
1726     cat notebook
1727     echo "BOOTP_SERVER"
1728     ;;
1729     esac
1730 lange 576 </example>
1731    
1732 lange 1354 Script <file>18disk</file> can be used to define classes depending
1733 lange 1151 on the number of local disks or the size of these disks<footnote>
1734 lange 634 <p>It uses the library <file>Fai.pm</file>, which includes some useful
1735     subroutines, e.g. <tt>class</tt>, <tt>classes</tt>,
1736     <tt>read_memory_info</tt>, <tt>read_ethernet_info</tt>.</p>
1737 lange 628 </footnote>. But you can also use a range of partition size in the
1738     disk configuration file (in <file>disk_config</file>), so you may not
1739 lange 1114 need a class for every different disk size.
1740     <p>
1741 lange 1704 The script <file>24nis</file> automatically defines classes
1742     corresponding to NIS. The name of the NIS domain (defined via BOOTP or
1743     DHCP) will also become a class (only uppercase letters and minus is
1744     replaced by underscore). If no NIS domain is defined, then only the
1745     class NONIS is defined.
1746 lange 1114 <p>
1747     Depending on partition names defined in the first matching
1748 lange 1704 <file>disk_config</file> found, <file>70partitions</file> defines
1749     additional classes. For example, if a partition
1750     <file>/files/scratch</file> exists, the class FILES_SCRATCH is
1751     defined, which forces the install client to export
1752     this directory via NFS and to install the NFS server packages.
1753 lange 562 <p>
1754 lange 1354 The script <prgn>11modules.source</prgn> does not define any class, but
1755 lange 562 is responsible for loading kernel modules. Kernel modules are
1756 lange 825 important for detecting hardware. This script calls the script
1757     <var>$HOSTNAME</var><tt>.mod</tt> and all scripts that have the format
1758 lange 576 <tt>&lt;classname&gt;.mod</tt> and those class names are already
1759 lange 1275 defined. Classes which are used for loading modules must be defined
1760     before this script is called. For example, if class <tt>DEFAULT</tt> is
1761 lange 576 defined (this class is always defined) and a file
1762     <file>DEFAULT.mod</file> exists, this script is executed. These
1763 lange 1275 scripts should contain all commands for loading kernel modules:
1764 lange 562
1765     <example>
1766     DEFAULT.mod:
1767    
1768 lange 1704 kernelmodules="rtc floppy parport_pc usbkbd usb-uhci keybdev"
1769 lange 1483
1770     for mod in $kernelmodules; do
1771     [ "$verbose" ] && echo loading kernel module $mod
1772     modprobe -a $mod
1773     done
1774 lange 562 </example>
1775    
1776 lange 1193 You can find messages from modprobe in <file>/tmp/fai/dmesg.log</file> and
1777 lange 825 the on the fourth console terminal by pressing <tt>Alt-F4</tt>.<p>
1778 lange 562
1779 lange 1151 <sect id=classvariables> Defining Variables<p>
1780 lange 576
1781 lange 1206 The task <tt>defvar</tt> defines the variables for the install
1782 lange 1704 client. Variables are defined by scripts in
1783     <tt>class/*.var</tt>. All global variables can be set in
1784 lange 795 <file>DEFAULT.var</file>. For certain groups of hosts use a class file
1785     or for a single host use the file
1786 lange 825 <var>$HOSTNAME</var><tt>.var</tt>. Also here, it's useful to study all
1787     the examples.
1788 lange 756
1789 lange 1275 The following variables are used in the examples and may be also useful
1790 lange 795 for your installation:
1791 lange 576
1792     <taglist>
1793 lange 1704 <tag>FAI_ACTION</tag> <item> <p>Set the action fai should
1794     perform. Currently this is done in the script <file>LAST.var</file>.
1795 lange 576
1796 lange 1275 <tag>FAI_CONSOLEFONT</tag> <item> <p>Is the font which is loaded during
1797 lange 576 installation by <manref name="consolechars" section="8">.</p> </item>
1798    
1799 lange 1704 <tag>FAI_KEYMAP</tag> <item> <p>Defines the keyboard map files in
1800     <file>/usr/share/keymaps</file> and <file>$FAI/files</file>. You
1801     need not specify the complete path, since this file will be located
1802     automatically.</p> </item>
1803 lange 576
1804     <tag>kernelimage</tag> <item> <p>The kernel that is installed to
1805     the new system. If a Debian package
1806 lange 825 <file>/fai/files/packages/</file><var>$kernelimage</var> exists,
1807     install this kernel package. Otherwise install the package
1808 lange 1275 <var>$kernelimage</var> from the Debian mirror. For example, if
1809 lange 727 <tt>kernelimage=kernel-image-&kver;-idepci</tt> this kernel will be
1810 lange 1704 installed. To install a special kernel for host bigfoot, set the
1811     variable
1812     <example>kernelimage=kernel-image-&kver;_bigfoot1_i386.deb</example>
1813     and this kernel will be installed from
1814     <file>/fai/files/packages/</file>.
1815     <p>The easiest way to install your local kernel package is to put
1816     this Debian package in
1817     <file>/usr/local/share/fai/files/packages/</file> on the install
1818     server. Then define the kernel name with
1819     <example>kernelimage=kernel-image-&kver;-wwwkiosk</example> without
1820     specifining the revision of the Debian package. Now fai will
1821     install this kernel using <manref name="apt-get" section="8">.
1822     </p></item>
1823 lange 576
1824 lange 1704 <tag>rootpw</tag> <item> <p>The root password for the new
1825     system. Additionally, FAI creates an root account with the same
1826     password called <tt>roott</tt>, which uses the <manref name="tcsh"
1827     section="1">.</p> </item>
1828    
1829     <tag>UTC</tag> <item> <p>Set hardware clock to UTC if
1830     <tt>$UTC=yes</tt>. Otherwise set clock to local time. See <manref
1831     name="clock" section="8"> for more information.</p> </item>
1832    
1833     <tag>time_zone</tag> <item> <p>Is the file relative to
1834     <file>/usr/share/zoneinfo/</file> which indicates your time
1835     zone.</p> </item>
1836    
1837 lange 576 <tag>liloappend</tag> <item> <p>Append parameters for the kernel of
1838     the new system (written to <file>/etc/lilo.conf</file>).</p> </item>
1839    
1840 lange 825 <tag>moduleslist</tag> <item> <p>Can be a multi line
1841 lange 1275 definition. List of modules (including kernel parameters) which are
1842 lange 825 loaded during boot of the new system (written to /etc/modules).</p>
1843     </item>
1844 lange 576
1845 lange 1275 <tag>TFTPLINK</tag> <item> <p>Link to the TFTP kernel image which boots
1846 lange 576 using the root file system from the local disk. </p> </item>
1847    
1848 lange 825 <tag>hserver, bserver</tag> <item> <p>The names of the NFS servers for
1849 lange 576 <file>/home</file> and <file>/usr</file>.</p> </item>
1850    
1851 lange 825 <tag>printers</tag> <item> <p>List of printers, for which a spool
1852     directory is created. The config scripts does not set up
1853     <file>/etc/printcap</file>.</p> </item>
1854 lange 1206
1855 lange 1275 <tag>addpackages</tag> <item> <p>The list of additional packages
1856     which are installed on the new system if they are available in
1857 lange 1518 <file>/fai/files/packages</file>. You can create a simple
1858 lange 1704 repository by using following commands on the install server:
1859 lange 1206
1860 lange 1518 <example>
1861     # cd /usr/local/share/fai/files
1862     # dpkg-scanpackages packages /dev/null | gzip -9 > packages/Packages.gz
1863     </example>
1864    
1865 lange 1704 Additionally, you can also create a Release file in this
1866     directory. Then <var>addpackages</var> can be the list of packages
1867     without a version number. For more information, refer to the
1868     repository HOWTO
1869     <footnote>http://www.isotton.com/debian/docs/repository-howto/</footnote>.
1870 lange 1518 This can be used to install local site specific
1871     packages.
1872    
1873 lange 576 </taglist>
1874    
1875    
1876 lange 727 <sect id=diskconfig>Hard disk configuration<p>
1877 lange 562
1878 lange 727 The format of the hard disk configuration files is described in
1879     <file>/usr/share/doc/fai/README.disk_config.gz</file>. The config file
1880     <file>/fai/disk_config/CS_KOELN</file> is a generic description for
1881     one IDE hard disk, which should fit for most installations. If you
1882 lange 825 can't partition your hard disk using this script <footnote><p>Currently
1883 lange 727 this script uses the command <tt>sfdisk(8)</tt>, which isn't available
1884     on SUN SPARC.</p> </footnote>, use a hook instead. The hook should
1885     write the new partition table, create the file systems and create the
1886 lange 1275 files <file>/tmp/fai/fstab</file> and <file>/tmp/fai/disk_var.sh</file>, which
1887 lange 1704 contains definitions of boot and root partitions.
1888 lange 825 <p>
1889 lange 230
1890     <sect id=packageconfig>Software package configuration<p>
1891 lange 522 The script <prgn>install_packages</prgn> installs the selected software
1892 lange 1275 packages. It uses all configuration files in <file>/fai/package_config</file>
1893     whose file name matches a defined class. The syntax is very
1894 lange 618 simple.
1895 lange 230
1896 lange 522 <example>
1897     # an example package class
1898 lange 230
1899 lange 756 PACKAGES taskinst
1900 lange 1114 german science
1901 lange 756
1902 lange 522 PACKAGES install
1903     adduser netstd ae
1904     less passwd
1905    
1906     PACKAGES remove
1907 lange 531 gpm xdm
1908 lange 522
1909     PACKAGES dselect-upgrade
1910     ddd install
1911     a2ps install
1912     </example>
1913    
1914     Comments are starting with a hash (#) and are ending at the end of
1915     the line. Every command begins with the word <tt>PACKAGES</tt>
1916     followed by a command name. The command name is similar to those of
1917 lange 531 <prgn>apt-get</prgn>. Here's the list of supported command names:
1918 lange 522
1919    
1920     <taglist>
1921 lange 1275 <tag>hold:</tag> <item> <p>Put a package on hold. This package will
1922 lange 912 not be handled by dpkg, e.g not upgraded.</p> </item>
1923    
1924 lange 531 <tag>install:</tag> <item> <p>Install all packages that are specified
1925 lange 522 in the following lines. If a hyphen is appended to the package name
1926     (with no intervening space), the package will be removed, not
1927 lange 1275 installed. All package names are checked for misspellings.
1928     Any package which does not exist, will be removed from the list of
1929     packages to install. So be careful not to misspell any package names.</p> </item>
1930 lange 522
1931 lange 531 <tag>remove:</tag> <item> <p>Remove all packages that are specified in
1932 lange 1275 the following lines. Append a + to the package name if the package
1933 lange 531 should be installed.</p> </item>
1934 lange 522
1935 lange 756 <tag>taskinst:</tag> <item> <p>Install all packages belonging to the
1936 lange 825 task that are specified in the following lines using <manref
1937 lange 1704 name="tasksel" section="1">.</p> </item>
1938 lange 756
1939 lange 522 <tag>dselect-upgrade</tag> <item> <p> Set package selections using the
1940 lange 825 following lines and install or remove the packages specified. These
1941 lange 1704 lines are the output of the command <tt>dpkg --get-selections</tt>.
1942 lange 522 </taglist>
1943    
1944    
1945     Multiple lines with lists of space separated names of packages follows
1946 lange 613 the commands install and remove. All dependencies are resolved and <prgn>apt-get</prgn>
1947 lange 531 is used to perform the installation or removal of packages. The order of the
1948 lange 522 packages is of no matter.
1949     <p>
1950 lange 1275 A line which contains the <tt>PRELOADRM</tt> commands, downloads a
1951 lange 922 file using <manref name="wget" section="1"> into a directory before
1952     installing the packages. Using the <tt>file:</tt> URL, this file is copied
1953     from <var>$FAI_ROOT</var> to the download directory.
1954     For examples the package
1955     <prgn>realplayer</prgn> needs an archive to install the software, so
1956 lange 1704 this archive is downloaded to the directory <file>/root</file>. After
1957 lange 922 installing the packages this file will be removed. If the file
1958     shouldn't be removed, use the the command <tt>PRELOAD</tt> instead.
1959 lange 522
1960 lange 634 <p>
1961 lange 1704 Now it's possible to append a list of class names after the command for
1962     apt-get. So this <tt>PACKAGE</tt> command will only be executed when
1963     the corresponding class is defined. So you can combine many small
1964     files into the file DEFAULT. <tt>WARNING!</tt> Use this feature only
1965     in the file DEFAULT. See this file for some examples.
1966    
1967     <p>
1968 lange 1193 If you specify a package that does not exists this package will be
1969     removed from the installation list. You can also test all software package
1970 lange 707 configuration files with the utility <prgn>chkdebnames</prgn>, which
1971 lange 899 is available in <file>/usr/share/fai/utils/</file>.
1972 lange 707 <example>
1973     > chkdebnames stable /usr/local/share/fai/package_config/*
1974     </example>
1975 lange 634
1976 lange 592 <sect id=cscripts>Scripts in <tt>/fai/scripts</tt><p>
1977 lange 312
1978 lange 576 The default set of scripts in this directory is only an example. But
1979 lange 817 they should do a reasonable job for your installation. You can edit them
1980 lange 576 or add new scripts to match your local needs.
1981 lange 1151 <p>
1982     If a directory with a class name exists, all scripts matching
1983 lange 1704 <file>S[0-9]*</file> are executed in alphabetical order. So it's
1984     possible to use scripts of different lanuages (sheel, cfengine,
1985     perl,..) for one class.
1986 lange 312
1987 lange 618 <sect1 id=shell>Shell scripts<p>
1988 lange 576
1989 lange 1275 Most scripts are Bourne shell scripts. Shell scripts are useful if the
1990 lange 618 configuration task only needs to call some shell commands or create a
1991 lange 1275 file from scratch. In order not to write many short scripts, it's
1992 lange 618 possible to distinguish classes within a script using the command
1993     <tt>ifclass</tt>. For copying files with classes, use the command
1994     <manref name="fcopy" section="8">. If you like to extract an archive
1995     using classes, use <manref name="ftar" section="8">.
1996     But now have a look at the scripts and see what they are doing.
1997 lange 592
1998 lange 618 <sect1 id=perl>Perl scripts<p>
1999 lange 1114 Currently no Perl script is used for modifying the system
2000 lange 618 configuration.
2001    
2002     <sect1 id=expect>Expect scripts<p>
2003 lange 687 Currently no expect scripts are used for modifying the system
2004 lange 618 configuration.
2005    
2006     <sect1 id=cfengine>Cfengine scripts<p>
2007    
2008     Cfengine has a rich set of functions to edit existing configuration
2009     files, e.g <tt>LocateLineMatching, ReplaceAll, InsertLine,
2010     AppendIfNoSuchLine, HashCommentLinesContaining</tt>. But it can't
2011 lange 1275 handle variables which are undefined. If a variable is undefined,
2012 lange 1704 the whole cfengine script will abort. Study the examples that are
2013     included in the fai package.
2014 lange 618
2015 lange 817 More information can be found in the manual page <manref
2016 lange 825 name="cfengine" section="8"> or at the cfengine homepage
2017 lange 817 <httpsite>http://www.cfengine.org</httpsite>.
2018 lange 633
2019    
2020 lange 613 <sect id=changeboot>Changing the boot device<p>
2021    
2022 lange 879 Changing the boot sequence is normally done in the BIOS setup. But
2023 lange 825 you can't change the BIOS from a running Linux system as far as I
2024     know. If you know how to perform this, please send me an email. But there's
2025     another way of swapping the boot device of a running Linux system.
2026 lange 613
2027     <p>
2028 lange 879 Change the boot sequence in the BIOS, so the first boot device is the
2029 lange 1704 local disk where the master boot record is located. The second boot
2030 lange 618 device should be set to LAN or floppy disk, depending from which media
2031     you boot when the installation process is performed.
2032     <p>
2033 lange 613 After the installation is performed, <manref name="lilo" section="8">
2034 lange 1704 or <manref name="grub" section="8">
2035 lange 634 will write a valid boot sector to the local disk. Since it's the first
2036     boot device, the computer will boot the new installed system. If you
2037     like to perform an installation again, you have to disable this boot
2038 lange 1704 sector using the command <manref name="bootsector" section="8"><footnote><p>The
2039     command <manref name="bootsector" section="8"> is part of the package
2040 lange 634 <package>fai</package> and will be installed to
2041 lange 639 <file>/usr/local/sbin</file> on the install clients.</p></footnote>
2042 lange 634 . For more information use: <example># bootsector -h
2043 lange 618 </example>
2044 lange 613
2045    
2046 lange 618 This is how to set up the a 3Com network card as second boot device,
2047     even if the BIOS doesn't support this. Enable LAN as first boot device
2048     in the BIOS.
2049 lange 613
2050     <example>
2051     Boot From LAN First: Enabled
2052 lange 618 Boot Sequence : C only
2053 lange 613 </example>
2054    
2055 lange 634 Then enter the MBA setup of the 3Com network card and change it as follows:
2056 lange 613 <example>
2057     Default Boot Local
2058     Local Boot Enabled
2059     Message Timeout 3 Seconds
2060     Boot Failure Prompt Wait for timeout
2061     Boot Failure Next boot device
2062     </example>
2063    
2064 lange 707 This will enable the first IDE hard disk as first boot device. If the
2065     boot sector of the hard disk is disabled, the computer will use the
2066 lange 1275 network interface as second boot device and boot from it. Maybe the
2067 lange 825 disk partitioning tool can't work on such a disk. So you have to
2068 lange 707 enable the boot sector before you want to partition the disk.
2069 lange 613
2070 lange 1114 If booting from a FAI floppy disk, another solution can be used to skip a
2071     re-installation if the BIOS is configured to boot from the floppy disk
2072 lange 1704 first and you are not here to remove the floppy disk : use
2073 lange 1114 <example>
2074     # lilo -R ...
2075     </example>
2076 lange 1704 to instruct the FAI floppy to boot from the hard disk only once (see
2077 lange 1114 <manref name="lilo" section="8">). Thus after this first reboot, the FAI
2078     floppy disk can be used for another FAI installation.
2079    
2080    
2081 lange 689 <sect id=hooks>Hooks<p>
2082 lange 618
2083 lange 1275 Hooks let you specify functions or programs which are run at certain
2084 lange 817 steps of the installation process. Before a default task is called,
2085 lange 1275 FAI searches for existing hooks for this task and executes them. As you
2086 lange 817 might expect, classes are also used when calling hooks. Hooks are
2087     executed for every defined class. You only have to create the hook
2088     with the name for the desired class and it will be used. If
2089     <tt>debug</tt> is included in <var>$FAI_FLAG</var> the option
2090     <tt>-d</tt> is passed to all hooks, so you can debug your own hooks.
2091 lange 1114 If some default tasks should be skipped, use the subroutine
2092 lange 825 <tt>skiptask</tt> and a list of default tasks as parameters. The
2093     example <file>partition.DISKLESS</file> skips some default tasks.
2094 lange 689 <p>
2095 lange 825
2096    
2097 lange 727 The directory <file>/fai/hooks/</file> contains all hooks. The file
2098     name of a hook consists of a hook name as a prefix and a class name,
2099 lange 1275 separated by a dot. The prefix describes the time when the hook is
2100     called, if the class is defined for the install client. For example,
2101 lange 727 the hook <file>partition.DISKLESS</file> is called for every client
2102     belonging to the class <tt>DISKLESS</tt> before the local disks would
2103     be partitioned. If it should become a diskless client, this hook
2104 lange 1193 can mount remote filesystems via NFS and create a <tt>/tmp/fai/fstab</tt>.
2105 lange 1275 After that, the installation process will not try to partition and
2106 lange 1193 format a local hard disk, because a file <file>/tmp/fai/fstab</file>
2107 lange 689 already exists.
2108     <p>
2109     A hook of the form <tt>hookprefix.classname</tt> can't define
2110     variables for the installation script, because it's a subprocess. But
2111 lange 727 you can use any binary executable or any script you wrote. Hooks that
2112 lange 1275 have the suffix <tt>.source</tt> (e.g. <file>partition.DEFAULT.source</file>) must
2113 lange 825 be Bourne shell scripts and are sourced. So it's possible to
2114 lange 727 redefine variables for the installation scripts.
2115 lange 689 <p>
2116 lange 687
2117 lange 1704 In the first part of fai, all hooks with prefix <tt>confdir</tt> are called.
2118 lange 817 Since the configuration directory <file>/fai</file> is mounted in the
2119     default task <tt>confdir</tt>, the hooks for this task are the only
2120 lange 825 hooks located in <var>$nfsroot</var><file>/fai/hooks</file> on the
2121 lange 817 install server. All other hooks are found in
2122     <file>/usr/local/share/fai/hooks</file> on the install server.
2123 lange 756
2124 lange 707 All hooks that are called before classes are defined can only use the
2125     following classes: <tt>DEFAULT $HOSTNAME LAST</tt>. If a hook for
2126     class <tt>DEFAULT</tt> should only be called if no hook for class
2127 lange 825 <var>$HOSTNAME</var> is available, insert these lines to the default
2128 lange 707 hook:
2129 lange 689
2130 lange 707 <example>
2131     hookexample.DEFAULT:
2132    
2133     #! /bin/sh
2134    
2135 lange 1275 # skip DEFAULT hook if a hook for $HOSTNAME exists
2136 lange 727 scriptname=$(basename $0 .DEFAULT)
2137     [-f /fai/hooks/$scriptname.$HOSTNAME ] && exit
2138 lange 707 # here follows the actions for class DEFAULT
2139     .
2140     .
2141     </example>
2142    
2143    
2144 lange 825 <p> Some examples for what hooks could be used:
2145 lange 707
2146 lange 689 <list>
2147     <item> <p>Use <prgn>ssh</prgn> in the very beginning to verify that
2148 lange 707 you mounted the configuration from the correct server and not a
2149     possible spoofing host.</p></item>
2150 lange 689
2151 lange 707 <item> <p>Do not mount the configuration directory, instead get a
2152     compressed archive via HTTP or from floppy disk and extract it into a
2153     new ram disk, then redefine <var>$FAI_LOCATION</var>.</p></item>
2154 lange 689
2155     <item> <p>Load kernel modules before classes are defined
2156     in <file>/fai/class</file>. </p></item>
2157    
2158 lange 1275 <item> <p>Send an email to the administrator if the installation is finished.</p></item>
2159 lange 689
2160 lange 817 <item> <p>Install a diskless client and skip local disk
2161     partitioning. See <file>hooks/partition.DISKLESS</file>.</p></item>
2162 lange 689 </list>
2163    
2164 lange 229 <sect id=errors>Looking for errors<p>
2165 lange 825 If the client can't successfully boot from the network card, use
2166     <manref name="tcpdump" section="8"> to look for Ethernet packets
2167 lange 756 between the install server and the client. Search also for entries in
2168     several log files made by <manref name="in.tftpd" section="8"> and
2169     <manref name="bootpd" section="8">:
2170    
2171     <example>egrep "tftpd|bootpd" /var/log/*</example>
2172    
2173    
2174 lange 1704 If the installation process finishes, the hook
2175     <file>faiend.LAST</file> searches all log files for common errors and
2176     write them to the file <file>error.log</file>. So, you should first
2177     look into this file for errors. To be sure, you should look for errors
2178     in all log files.<p>
2179 lange 173
2180 lange 628 Sometimes the installation seems to stop, but there's only a
2181     postinstall script of a software package that requires manual input
2182     from the console. Change to another virtual terminal and look which
2183 lange 817 process is running with tools like <manref name="top" section="1"> and <manref
2184     name="pstree" section="1">. You can add <tt>debug</tt> to
2185 lange 1275 <tt>FAI_FLAGS</tt> to make the installation process show all output
2186     from the postinst scripts on the console and get its input also from the
2187 lange 817 console. Don't hesitate to send an email to the mailing list or to
2188     <email>fai@informatik.uni-koeln.de</email> if you have any
2189     questions. Sample log files from successful installed computers are
2190     available on the FAI homepage.
2191 lange 628
2192 lange 783 <chapt id=beowulf>How to build a Beowulf cluster using FAI<p>
2193 lange 771
2194 lange 1704 This chapter describes the details about building a Beowulf
2195 lange 822 cluster using &dgl; and FAI. For more information about the Beowulf
2196 lange 899 concept look at <httpsite>http://www.beowulf.org</httpsite>.
2197 lange 771
2198 lange 1275 <sect id=beoplan> Planning the Beowulf setup<p>
2199 lange 899
2200     The example of a Beowulf cluster consists of one master node and 25
2201 lange 1275 clients. A big rack was assembled which all the cases were put into. A
2202     keyboard and a monitor, which are connected to the master server
2203     most of the time,
2204     were also put into the rack. But since we have very long
2205 lange 899 cables for monitor and keyboard, they can also be connected to all
2206 lange 1275 nodes if something has to be changed in the BIOS, or when looking for
2207     errors when a node does not boot. Power supply is another topic you
2208 lange 899 have to think about. Don't connect many nodes to one power cord and
2209     one outlet. Distribute them among several breakout boxes and outlets.
2210 lange 1275 And what about the heat emission? A dozen nodes in a small room can
2211 lange 1704 create too much heat, so you will need an air conditioner. Will the
2212 lange 1275 power supplies of each node go to stand by mode or are all nodes
2213     turned on simultaneously after a power failure?
2214 lange 899
2215 lange 771 <p>
2216 lange 899
2217     All computers are connected to a Fast Ethernet switch. The master node
2218     (or master server) is called <em>nucleus</em>. It has two network
2219     cards. One for the connection to the external Internet, one for the
2220     connection to the internal cluster network. If connected from the
2221     external Internet, it's called <em>nucleus</em>, but the cluster nodes
2222 lange 1275 access the master node with the name <em>atom00</em>, which is a name
2223 lange 899 for the second network interface. The master server is also the
2224     install server for the computing nodes. A local Debian mirror will be
2225     installed on the local harddisk. The home directories of all user
2226     accounts is also located on the master server. It will be exported via
2227     NFS to all computing nodes. NIS will be used to distribute account,
2228 lange 1275 host, and printer information to all nodes.
2229 lange 899
2230     <p>
2231     All client nodes <em>atom01</em> to <em>atom25</em> are connected via
2232     the switch with the second interface card of the master node. They can
2233 lange 822 only connect to the other nodes or the master, but can't communicate
2234     to any host outside their cluster network. So, all services (NTP, DNS,
2235 lange 899 NIS, ...) must be available on the master server. I choose the class C
2236     network address <em>192.168.42.0</em> for building the local Beowulf
2237     cluster network. You can replace the subnet 42 with any other number
2238 lange 1114 you like. If you have more that 253 computing nodes, choose a class A
2239 lange 899 network address (10.X.X.X).
2240 lange 817
2241     <p>
2242     In the phase of preparing the installation, you have to boot the first
2243     install client many time, until there's no fault in your configuration
2244     scripts. Therefore you should have physical access to the master
2245 lange 1275 server and one client node. If you have little space, connect both
2246 lange 817 computers to a switch box, so one keyboard and monitor can be shared
2247 lange 822 among both.
2248 lange 817
2249 lange 771 <sect id=master> Set up the master server<p>
2250    
2251 lange 1275 The master server will be installed by hand if it is your
2252     first computer installed with Debian. If you already have a Debian
2253 lange 822 host running, you can also install it via FAI. Create a partition on
2254     <file>/files/scratch</file> for the local Debian mirror with more that
2255 lange 1710 &mirrorsize GB space available.
2256 lange 771
2257 lange 817 <sect1 id=beonetworkmaster> Set up the network<p>
2258 lange 771
2259 lange 1275 Add the following lines for the second network card to
2260     <file>/etc/network/interfaces</file>:
2261 lange 771 <example>
2262 lange 783 # Beowulf cluster connection
2263 lange 1206 auto eth1
2264 lange 771 iface eth1 inet static
2265 lange 825 address 192.168.42.250
2266 lange 771 netmask 255.255.255.0
2267 lange 817 broadcast 192.168.42.255
2268 lange 771 </example>
2269    
2270 lange 832 Add the IP addresses for the client nodes. The FAI package has an
2271 lange 1275 example for this <file>/etc/hosts</file> file:
2272 lange 771 <example>
2273 lange 783 # Beowulf nodes
2274 lange 771 # atom00 is the master server
2275 lange 817 192.168.42.250 atom00
2276     192.168.42.1 atom01
2277     192.168.42.2 atom02
2278 lange 771 </example>
2279    
2280 lange 832 You can give the internal Beowulf network a name when you add this
2281     line to <file>/etc/networks</file>:
2282     <example>beowcluster 192.168.42.0</example>
2283    
2284    
2285 lange 822 Activate the second network interface with: <tt>/etc/init.d/networking start</tt>.
2286    
2287 lange 899 <sect1 id=beonis> Setting up NIS<p>
2288 lange 771
2289 lange 1275 Add a normal user account <var>tom</var> which is the person who edits
2290 lange 822 the configuration space and manages the local Debian mirror:
2291     <example># adduser tom
2292     # addgroup linuxadmin
2293     </example>
2294 lange 771
2295 lange 832 This user should also be in the group <var>linuxadmin</var>. So, add a
2296     line to <file>/etc/group</file>:
2297     <example>
2298 lange 822 linuxadmin:x:101:tom
2299 lange 817 </example>
2300    
2301 lange 832 To initialize the master server as NIS server call <tt>ypinit -m</tt>.
2302 lange 822 Then, copy the file <file>netgroup</file> from the examples directory
2303     to <file>/etc</file> and edit other files there. Adjust access to the
2304     NIS service.
2305 lange 817
2306 lange 822 <example># cat /etc/ypserv.securenets
2307     # Always allow access for localhost
2308     255.0.0.0 127.0.0.0
2309     # This line gives access to the Beowulf cluster
2310     255.255.255.0 192.168.42.0
2311     </example>
2312    
2313 lange 1206 Rebuild the NIS maps:
2314     <example># cd /var/yp; make</example>
2315 lange 822
2316 lange 817 <sect1 id=beomirror> Create a local Debian mirror<p>
2317    
2318 lange 1275 Now the user <var>tom</var> can create a local Debian mirror on
2319 lange 822 <file>/files/scratch/</file> using <prgn>mkdebmirror</prgn>. This will
2320 lange 1710 need about &mirrorsize GB disk space for Debian 3.0 (aka woody). Export this
2321 lange 825 directory to the netgroup <tt>@faiclients</tt> read only.
2322 lange 817
2323 lange 822 <sect1 id=fai1> Install FAI package on the master server<p>
2324 lange 817
2325 lange 1275 Add the following packages to the install server:
2326 lange 1206 <example>nucleus:/# apt-get install ntp tftp bootp nfs-kernel-server fai fai-kernels
2327     nucleus:/# tasksel -q -n install dns-server
2328     nucleus:/# apt-get dselect-upgrade
2329     </example>
2330     Configure NTP so that the master server will have the correct system time.
2331 lange 817
2332 lange 822 <p>
2333 lange 832 It's very important to use the internal network name <var>atom00</var>
2334     for the master sever (not the external name <var>nucleus</var>) in
2335 lange 936 <file>/etc/bootptab</file> and &fc;. Replace
2336 lange 832 the strings FAISERVER with <tt>atom00</tt> in
2337     <file>/etc/bootptab</file> and uncomment the following line in &fc;
2338     so the Beowulf nodes can use the name for connecting their master
2339     server.
2340 lange 783 <example>
2341     NFSROOT_ETC_HOSTS="192.168.42.250 atom00"
2342     </example>
2343    
2344 lange 771 <file>/etc/bootptab:</file>
2345     <example>
2346 lange 817 .
2347     .
2348 lange 771 .failocal:\
2349     :tc=.faiglobal:\
2350     :sa=atom00:\
2351     :ts=atom00:\
2352     :T172="verbose createvt sshd":\
2353     :sm=255.255.255.0:\
2354 lange 817 :gw=192.168.42.250:\
2355     :dn=beowulf.debian.org:\
2356     :ds=192.168.42.250:\
2357 lange 771 :ys=atom00:yd=nisnucleus:\
2358     :nt=atom00:
2359 lange 817 .
2360     .
2361 lange 771 </example>
2362    
2363 lange 822 <sect1 id=bootp1> Prepare network booting<p>
2364 lange 771
2365 lange 822 Uncomment the following line in <file>/etc/inetd.conf</file>:
2366     <example>#bootps dgram udp wait root /usr/sbin/bootpd bootpd -i -t 120
2367     </example>
2368     and restart the inetd daemon.
2369    
2370 lange 1275 The user <var>tom</var> should have permission to create the
2371 lange 822 symlinks for booting via network card, so change the group and add
2372     some utilities.
2373    
2374     <example># chgrp -R linuxadmin /boot/fai; chmod -R g+rwx /boot/fai
2375 lange 899 # cp /usr/share/fai/utils/* /usr/local/bin
2376 lange 822 </example>
2377    
2378     Now, the user <var>tom</var> can create a symlink in
2379 lange 1206 <file>/boot/fai</file> using
2380     <example>> tlink atom_install atom01</example>
2381 lange 822 to boot the first client node for the first
2382     time. Then start to adjust the configuration for your client
2383     nodes. Don't forget to build the kernel for the cluster nodes using
2384 lange 1206 <manref name="make-kpkg" section="8"> and store it in <file>/usr/local/share/fai/files/packages</file>.
2385 lange 822
2386 lange 1275 <sect id=beotools> Tools for Beowulf clusters<p>
2387 lange 817
2388 lange 1275 The following tools for a Beowulf cluster are now available in
2389     <file>/usr/local/bin</file>:
2390 lange 817
2391 lange 832 <taglist>
2392 lange 1275 <tag> tlink <item> <p>Change the symbolic link that points to
2393     the kernel image for booting from a network card.</p></item>
2394 lange 817
2395 lange 832 <tag> all_hosts <item> <p>Print a list of all hosts, print
2396     only the hosts which respond to a ping or the hosts which
2397 lange 855 do not respond. The complete list of hosts is defined by the
2398     netgroup <tt>allhosts</tt>. Look at
2399     <file>/usr/share/doc/fai/examples/etc/netgroup</file> for an
2400     example.</p></item>
2401 lange 817
2402 lange 832 <tag>rshall<item><p>Execute a command on all hosts which are
2403     up via rsh. Uses <prgn>all_hosts</prgn> to get the list of all
2404 lange 855 hosts up. You can also use the <manref name="dsh" section="1">
2405     command (dancer's shell, or distributed shell).
2406    
2407 lange 1206 <tag>rgang</tag> <item> <p>For a huge cluster try
2408     <prgn>rgang</prgn>. It's is a tool which executes commands on or
2409 lange 1275 distributes files to many nodes. It uses an algorithm to build a
2410 lange 1206 tree-like structure to allow the distribution processing time to
2411     scale very well to 1000 or more nodes (available at
2412     <httpsite>http://fermitools.fnal.gov/</httpsite>
2413     <httppath>abstracts/rgang/abstract.html</httppath>). </p></item>
2414    
2415 lange 1704 <tag>jmon</tag><item><p>For observing the resources of all
2416     clients (CPU, memory, swap,...) you can use <manref
2417     name="jmon" section="1"> which installs a simple daemon on
2418     every cluster node. </item>
2419    
2420     <tag>ganglia</tag><item><p>This toolkit is very good for monitoring
2421     your cluster. Available at
2422     <httpsite>http://ganglia.sourceforge.net/</httpsite> </p> </item>
2423    
2424 lange 832 </taglist>
2425    
2426 lange 1275 But there are a lot of other tools
2427     available which are not yet included in a Debian package. </p>
2428 lange 832
2429 lange 877 <sect id=wol> Wake on LAN with 3Com network cards<p>
2430 lange 832
2431 lange 877 Wake on LAN is a very nice feature to power on a computer without
2432 lange 1226 having physical access to it. By sending a special ethernet packet to
2433 lange 1704 the network card, the computer will be turned on. The following things
2434 lange 877 have to be done, to use the wake on LAN (WOL) feature.<p>
2435 lange 832
2436 lange 877 <enumlist>
2437     <item><p>Connect the network card to the Wake-On-LAN connector on the
2438     motherboard using a 3 pin cable.</p></item>
2439     <item><p>My ASUS K7M motherboard has a jumper called
2440     <tt>Vaux (3VSBSLT)</tt> which allows to select the voltage supplied to add-in
2441     PCI cards. Set it to <tt>Add 3VSB</tt> (3 Volt stand by).</p></item>
2442 lange 879 <item><p>Turn on the wake on LAN feature in BIOS</p></item>
2443 lange 877 <item><p>For a 2.2 kernel you have to use the following driver:
2444     <httpsite>http://www.uow.edu.au/</httpsite><httppath>~andrewm/linux/#3c59x-bc</httppath></p></item>
2445     </enumlist>
2446    
2447     There's a little problem to enable the wake on LAN feature with a
2448     2.2.19 kernel and a 3Com 3C905C network card. You have to use a
2449 lange 1275 patched 3c59x driver. But I managed to get it to work. Download the file
2450 lange 877 <file>poll-ioctl-2.2.18-pre16.c.gz</file> and copy it to kernel
2451     sources to <file>drivers/net/3c59x.c</file>. Then make a new kernel
2452     package and install this new kernel.
2453    
2454     To wake up a computer use the tool etherwake (in woody) or get the
2455 lange 879 single C source file. For more information look at
2456 lange 877 <httpsite>http://www.scyld.com/</httpsite><httppath>expert/wake-on-lan.html</httppath>.
2457    
2458 lange 1193 <chapt id=sparc>FAI on SUN SPARC hardware running Linux<p>
2459 lange 1275 Although FAI is architecture independent, there are some packages which
2460     are only available for certain architectures (e.g. silo, sparc-utils).
2461 lange 173
2462 lange 1275 SUN SPARC computers can boot from their boot prompt and don't need a
2463 lange 825 boot floppy. To boot a SUN use: <example>boot net</example>
2464 lange 531
2465 lange 825 You have to convert the kernel image from ELF format to a.out
2466 lange 1275 format. Use the program <prgn>elftoaout</prgn> (mentioned in
2467 lange 825 the FAQ). The symlink to the kernel image to be booted is not the host
2468     name. Look at the FAQ at
2469     <httpsite>http://www.ultralinux.org</httpsite> for more information.
2470 lange 531
2471 lange 825 A success report is available at
2472 lange 1704 <httpsite>http://www.opossum.ch/</httpsite><httppath>fai/</httppath>
2473     and a HOWTO can be found at
2474     <httpsite>http://toolbox.rutgers.edu/</httpsite><httppath>~amurphy/fai</httppath>.
2475 lange 825
2476 lange 1114 <chapt id=hints>Various hints<p>
2477 lange 173
2478 lange 1275 This chapter has various hints which may not always be explained in great
2479 lange 795 detail.
2480 lange 1710 <p>
2481 lange 1756 When using HTTP access to a Debian mirror, the local <tt>/var</tt>
2482     partition on all install clients must be big enough to keep the
2483     downloaded Debian packages. Do not try with less than 250 Mbytes
2484     unless you know why.
2485     <p>
2486 lange 562
2487 lange 1114
2488 lange 1710 You can merge two directories which contain configuration
2489     information, if one is a global one, and the other a local one. We use
2490     it to merge the temples from the fai package, and our local
2491     configuration, which contains encrypted passwords and other
2492     information that should not be readable for others. This is how our
2493     setup looks like.
2494     <p>
2495     We have a local configuration space located in
2496     <file>~admin/additional-fai/</file> which contains following files:
2497     <example>
2498     ./files
2499     ./files/etc
2500     ./files/etc/hosts
2501     ./files/etc/hosts/NUERBURG1
2502     ./files/etc/hosts/NUERBURG2
2503     ./files/etc/network
2504     ./files/etc/network/interfaces
2505     ./files/etc/network/interfaces/NUERBURG1
2506     ./files/etc/network/interfaces/NUERBURG2
2507     ./files/etc/bootptab
2508     ./files/etc/bootptab/kueppers
2509     ./files/etc/kueppers.tar.gz
2510     ./files/packages
2511     ./files/packages/kernel-image-2.4.20-cskoeln_2_i386.deb
2512     ./files/packages/cloop-2.4.20-cskoeln_0.63.1-4+2_i386.deb
2513     ./files/packages/xv-doc_3.10a-26_all.deb
2514     ./files/packages/xv_3.10a-26_i386.deb
2515     ./files/packages/Packages.gz
2516     ./files/packages/ltmodem-2.4.20_8.26a9_i386.deb
2517     ./files/packages/cloop-2.4.20-acer_0.63.1-4+1_i386.deb
2518     ./files/packages/kernel-image-2.4.20-acer_1_i386.deb
2519     ./files/packages/pcmcia-modules-2.4.20-acer_3.1.33-6+1_i386.deb
2520     ./files/packages/kernel-headers-2.4.20-acer_1_i386.deb
2521     ./files/packages/ltmodem-2.4.20-acer_8.26a9_i386.deb
2522     ./files/packages/debmirror_20020427-1_all.deb
2523     ./files/usr
2524     ./files/usr/local
2525     ./files/usr/local/ACROREAD5.tar.gz
2526     ./files/usr/local/share
2527     ./files/usr/local/share/LPRng
2528     ./files/usr/local/share/LPRng/pcfilter
2529     ./files/usr/local/share/LPRng/pcfilter/NISLPRCLIENT
2530     ./files/usr/lib
2531     ./files/usr/lib/mozilla
2532     ./files/usr/lib/mozilla/CS_KOELN.tar.gz
2533     ./class
2534     ./class/dom.var
2535     ./class/NET_9.var
2536     ./mk-packages-gz
2537     ./scripts
2538     ./scripts/kueppers
2539     ./README
2540     ./disk_config
2541     ./disk_config/dom
2542     ./disk_config/kueppers
2543     </example>
2544    
2545     The file <file>mk-packages-gz</file> is just the simple script which
2546     creates the <file>Packages.gz</file> as explained above. In order to
2547     copy this local configuration data into the fai config space we use
2548     this command:
2549    
2550     <example>cp -a ~admin/additional-fai/* /usr/local/share/fai
2551     </example>
2552    
2553     If you remove a file in you local configuration, do not forget to
2554     remove this file also in the configuration space, otherwise it will
2555     still be used.
2556     <p>
2557 lange 1721 AFter calling <prgn>set-dis-kinfo</prgn>, a list of all local hard disks is
2558     stored to <var>$disklist</var> and <var>$device_size</var>
2559     contains a list of disk devices and their sizes.
2560     <p>
2561 lange 1710
2562    
2563 lange 1704 Use <prgn>fai-divert -a</prgn> if a postinst script calls a
2564 lange 1114 configuration program, e.g. the postinst script for package apache calls
2565 lange 1275 apacheconfig, which needs manual input. You can fake the configuration
2566 lange 1114 program so the installation can be fully automatic. But don't forget
2567 lange 1704 to use <prgn>fai-divert -R</prgn> to remove all faked script.
2568 lange 562
2569 lange 795 <p>
2570 lange 817 During the installation you can execute commands
2571     inside the newly installed system in a chroot environment by using <tt>chroot /tmp/target</tt>
2572 lange 1275 or just <tt>$ROOTCMD</tt> followed by the command you want to call; for
2573     example <tt>$ROOTCMD dpkg -l</tt> shows the packages installed on
2574     the new system.
2575 lange 795 <p>
2576 lange 173
2577 lange 1275 The only task which has to be done manually for new hardware is to
2578     assign the MAC address to a hostname and to an IP address, and to define
2579     classes for this host if the existing configuration files are not generic
2580 lange 1114 enough to deal with this new host.
2581 lange 795 <p>
2582     There's a tradeoff between writing a few large configuration scripts,
2583 lange 825 or many short scripts, one for each class. Large scripts can
2584 lange 1114 distinguish classes by using case statements, the <tt>ifclass</tt>
2585     test or with class mechanisms for <tt>cfengine</tt> scripts.
2586 lange 795 <p>
2587 lange 1275 If your computer can't boot from the network card, you do not always need to boot
2588 lange 795 from floppy. Define a partition <file>/fai-boot</file> in your
2589     <file>disk_config</file> configuration file. Then the class
2590 lange 1275 <tt>FAI_BOOTPART</tt> will automatically be defined and will create a lilo entry for
2591 lange 795 booting the FAI bootfloppy from this partition. So you can start the
2592 lange 1226 re-installation without a boot floppy. This will also make the test
2593 lange 825 phase shorter, since booting from hard disk is much faster than booting
2594 lange 817 from floppy.
2595 lange 961 <p>
2596 lange 1275 To use the <file>/file/scratch</file> partitions on all Beowulf nodes,
2597     use the kernel automounter and the following configuration.
2598 lange 961
2599     <example>
2600     nucleus[~]> cat /etc/auto.master
2601     /scratch /etc/nodes.scratch
2602     </example>
2603    
2604     <example>
2605     nucleus[~]> cat /etc/nodes.scratch
2606     * -rw,soft,intr &:/files/scratch
2607     </example>
2608    
2609 lange 1069 <sect id=functions>Useful functions for advanced administrators<p>
2610    
2611     <taglist>
2612 lange 1704 <tag>fai-divert</tag> <item> <p>Add or remove a file to the list of diversions
2613 lange 1069 and replace the file with a dummy script. This is useful when a
2614 lange 1275 postinst script needs manual input. At the end of the installation all
2615 lange 1069 diversions are removed.</p> </item>
2616    
2617 lange 1114 <tag>skiptask</tag> <item> <p>This given list of tasks are
2618 lange 1275 skipped. For use e.g. in <file>partition.DISKLESS</file>.</p> </item> </taglist>
2619 lange 1069
2620 lange 795 </book>
2621     </debiandoc>
2622 lange 173
2623     <!-- Keep this comment at the end of the file
2624     Local variables:
2625     mode: sgml
2626     sgml-omittag:t
2627     sgml-shorttag:t
2628     sgml-minimize-attributes:nil
2629     sgml-always-quote-attributes:t
2630     sgml-indent-step:2
2631     sgml-indent-data:nil
2632     sgml-parent-document:nil
2633     sgml-exposed-tags:nil
2634     sgml-declaration:nil
2635     sgml-local-catalogs:nil
2636     sgml-local-ecat-files:nil
2637     End:
2638     -->

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.5