User FAQ

From FAIWiki
Revision as of 13:16, 14 February 2014 by Mrfai (talk | contribs) (fix script names)
Jump to navigation Jump to search

FAQs for new users

I'm new to FAI. How should I start ?

  • Read the FAI guide and this FAQ.
  • Start with the simple examples by copying them to FAI_CONFIGDIR.
  • Install the stable distribution on your first clients!

debian@layer-acht.de


Where do I find the FAI mailing list ?

There's info on mailing lists and archives in this Wiki: Linux-fai mailing list infos

sanso 10:30, 11 Aug 2005 (CEST)

There also is a section "Mailing list" on the FAI homepage at

http://fai-project.org Please use your favorite search engine to search for your questions before posting to the list. Also don't post complete logs. Most times it's sufficient to describe the setup (which version of fai, which version of debian on the fai server and which version to be installed with fai) and to post the part of the log(s) where the error occurs. It's the first error that matters. Or provide logfiles on a webserver and post a link.

debian@layer-acht.de


Where do I find the log files?

  • During installation the are available in /tmp/fai/ on the install client
  • At the end of the installation they will be copied to /tmp/target/var/log/fai
  • If $LOGSERVER and $LOGUSER are set, they are copied to the install server in the home directory of the user $LOGUSER
  • After rebooting the install client, the are available in /var/log/fai

Somewhat more advanced FAQs

Can I write a hook that is executed after a certain task?

(freely) quoting #fai:

<sanso> is there a way to define post-hooks other than defining a (pre-)hook for the following task?
<Mrfai> sanso: yes post hooks are possible. Define a pre hook, and inside this hook, you 
first call the default task using task_taskname, then add your code for the post hook. 
And don't forget to call skiptask.
Mmmm, do you like to add this to the faiwiki, maybe a FAQ or tip?

More technical stuff / troubleshooting

I try to install testing or sid/unstable and something goes wrong. Why?

testing and unstable sid change every day. So it's possible that your problems are solved today or tomorrow. You should try again. It's recommendable to use a local mirror and freeze it when you found a working install. But we also recommend to use stable and local backport repositories whenever possible.

debian@layer-acht.de

As for sid - that's why it's called unstable You might want to get used to things braking.

You should only try to install unstable or testing if You know what you're doing and You know You definitely need something other than stable

sanso 10:20, 11 Aug 2005 (CEST)

What order are scripts executed in?

Scripts are executed in class definition order, and in numerical order within each class.

For example, if the classes FOO and BAR were defined (in that order), and $FAI_CONFIGDIR/scripts/FOO contained 20-foo and 40-bar, and $FAI_CONFIGDIR/scripts/BAR contained 30-mycode, the order of execution would be:

  1. $FAI_CONFIGDIR/scripts/FOO/20-foo
  2. $FAI_CONFIGDIR/scripts/FOO/40-bar
  3. $FAI_CONFIGDIR/scripts/BAR/30-mycode


make-fai-nfsroot dies silently, Why?

Restarted it with more debug output (-v) and (-r) to recover yielded: Reading Package Lists...

E: Dynamic MMap ran out of room E: Error occured while processing 
phpgroupware-
netsaint (NewPackage) E: Problem with MergeList 
/var/lib/apt/lists/172.25.1.52:9999
_debian_dists_unstable_main_binary-i386_Packages E: The package lists or
status file could not be parsed or opened.

Reason: As I my default /etc/apt/sources.list read in stable, testing and unstable, apt-get needs a lot of space for its internal tables. Therefore I had also a special apt.conf which is missing in the nfsroot of FAI. This is a known problem of apt.

Solution: Copied /etc/apt/sources to /etc/fai/sources.list, then minimised it to contain just one version (e.g. stable) of Debian

ngiger@mus.ch


Why does the system reboot after entering ctrl-c following an installation?

The default actions for FAI do not allow you to get a shell since it is insecure and it will reboot on <ctrl-c> by design.

If you want to get a shell you need to change FAI's actions by adding 'createvt' to the FAI_FLAGS variable that is passed to the kernel on startup. You can do this via fai-chboot (e.g. fai-chboot -iFv -k "FAI_ACTION=install" hostname) for network installs or for floppy installs you can use something similar to make-fai-bootfloppy "FAI_FLAGS=verbose,createvt,sshd".

dawsons@augsburg.edu

Why can't I login via ssh to my install client(s) anymore? It used to work but suddenly stopped working.

After you have reinstalled FAI on your server a new ssh host key is generated. This also happens when you call fai-setup or make-fai-nfsroot. Remove the relevant line from ~/.ssh.known_hosts and try again.

debian@layer-acht.de

(The relevant lines are the ones containing the client's hostname and/or IP-address --sanso 10:32, 11 Aug 2005 (CEST))

How to do a headless install from floppy on my i386 pc?

So how do you install Debian on a stripped down, headless i386 pc, without network booting, from floppy? For a first time user, it was pretty hard. I spent half a day on this, but if I had known the following, the job could have been done in less than an hour. (Not including the actual installation of packages). I had to hook up my monitor once in a while to see what was happening. The following tips apply to FAI in sid (Debian unstable). 1. Initial setup, before stripping the client PC from unneeded hardware. 1.a. If you don't attach input devices: somewhere in your BIOS there should be a "Halt on <X>" setting to handle possible hardware problems on startup, not allowing your system to boot e.g. when no keyboard is connected. Set this to "Halt on No Errors" 1.b. If you want to work without a graphics adaptor: check if your motherboard allows to boot without a graphics card. Even with the "Halt on No Errors" setting, your mobo can refuse to boot without a graphics device. 1.c. In the BIOS, check if your boot sequence starts with the floppy ("A" in general) 1.d. Check that the floppy device you are planning to boot from, is connected to the END of the floppy cable to have it recognized as disk "A"

2. Configuration of FAI 2.a. Make sure to explicitly set the LOGSERVER variable in /etc/fai/fai.conf (and nfsroot/etc/fai.conf if you already issued "make-fai-nfsroot"), otherwise FAI will complain with a "SERVER not set" error and can't publish the install logs. (I think this is a bug) 2.b. Use "make-fai-bootfloppy" at least _twice_ to write the bootdisk. The system could not boot from the disk if it was written once. Also check the disk with "e2fsck -c /dev/fd0" to make sure. 2.c. The "faimond" feature didn't work. That's quite inconvenient but no showstopper. 3. After package installation 3.a. At the end of installation, for some reason the newly installed system thinks it should reboot using tftp, but it hangs. It waits for a user to press ENTER or CTRL-C. You can safely ignore this and reboot manually. 3.b. There is NO "fai" account on the newly installed system, and the default root password is "fai", not "roott" which is used in another part of the installation.

tboloney@lycos.com

I need a /boot partition, how do I create one?

If your disk is larger than your BIOS can handle, you will need to create a boot partition to boot from. If you don't have a boot partition you will get GRUB Error: 18 when the client boots [1]. Use a disk_config like this one to boot from the /boot partition:

disk_config disk1
primary     /boot           100         rw              ; ext2 boot 
logical     /               5000        rw              ; -j ext3
logical     swap            100-400     rw              

It is important that only the /boot partition is primary, that its filesystem is ext2 and that the boot option is set. If not, FAI will assume that the root partition (/) is the boot partition and GRUB will try to boot from that one. It will result in GRUB Error 15.


Device missing or not a block device - where did my device go?

If Rebooting fails because of modules missing (e.g. can't mount root fs ...) Chances are in error.log You'll find a line saying

---%<---
rcS.log:Failed to create initrd image.
---%<---

rcS.log says:

---%<---
Setting up kernel-image-2.6.8-2-686-smp (2.6.8-12) ...
/usr/sbin/mkinitrd: device /dev/sda1 is not a block device
Failed to create initrd image.
---%<---

I modified Steffen Grunewald's script:

Yes. udev is the culprit, [...] As a workaround, you may set up a hook for configure,

e.g. in $CONFIGSPACE/hooks/configure.DEFAULT

---%<---
echo $0 udev bug workaround
# work-around for udev bug
if [ -x $target/etc/init.d/udev ]; then
   chroot $target /etc/init.d/udev stop
   chroot $target /usr/bin/dpkg --configure --pending
   chroot $target /etc/init.d/udev start
fi
---%<---

AUFS crashing on first install

There seems to be a bug in AUFS (AnotherUnionFS) when the FAI configuration is exported via NFS version 4. In this case you may get a kernel panic right after starting the kernel.

There are two work arounds

  • With Debian wheezy you can use an empty directory and add it to /etc/exports:
 /srv/nfs4 {your-net}/{netmask} (sync,rw,fsid=0,no_subtree_check,no_root_squash)
  • The above solution seems not to work with Debian squeeze. Here you can add a ,nfsvers=3 to the append line if you boot via PXE. So add in the relevant file in pxelinux.cfg in the part with nfsroot= the option ,nfsvers=3, e.g.:
   ... root=/dev/nfs nfsroot=/srv/fai/nfsroot,nfsvers=3 ...

Using Debian kernel 3.12 from wheezy backports, you can use NFS v4 for the nfsroot without problems (see Grml_kernel).

Strange AUFS error messages

Sometimes you may see strane error message from AUFS regarding files and directories. In this case it is very likely that you have forgotten to add a $ROOTCMD or $target in your FAI scripts. They will work well on an installed system but fail on a fresh install.

The reason is, that you want to edit the new installation, this is in /target during the installation and if you miss it, you are editing/configuring the live system, which may cause stranfe AUFS messages.

During installation $target points to the new installation directory, usually /target/ and $ROOTCMD will do a chroot in this directory before the given command is executed.