| fai-cd(8) | System Manager's Manual | fai-cd(8) |
fai-cd - make a bootable CD-ROM or USB stick that performs an FAI
fai-cd [OPTION] -m MIRROR ISOFILE
fai-cd [OPTION] -B FILE
fai-cd [OPTION] -d URL
fai-cd [OPTION] -S IMAGEFILE
This command creates a bootable ISO CD-ROM image that performs the fully automatic installation from the CD-ROM without an install server. The ISO image will be written to FILE. To create the image the command requires the NFSROOT, configuration space, and optionally a partial mirror (which is created by fai-mirror). The ISO image will contain a compressed squashfs filesystem. This hybrid CD image can be written to an USB stick using dd(1).
NOTE: By default, fai-cd uses the grub file from /etc/fai/grub.cfg, which is designed for demo purposes. This grub menu passes the "menu" flag to the FAI_FLAGS parameter, which causes a menu with various installation and boot options to be displayed on each boot. To avoid this, you must specify your own grub file using the -g flag, as described below.
After you've created a mirror with fai-mirror in /media/mirror, you can create a CD using:
# fai-cd -m /media/mirror fai-cd.iso
If you want to create a bootable USB stick (here /dev/sdf), write the CD image to the stick via dd(1).
# dd if=fai-cd.iso of=/dev/sdf bs=1M
Building a live ISO:
You can create a live ISO using two FAI commands. First, you need to build your own live environment, containing all software including configuration that you like to use. Using the command "fai dirinstall" you do an installation using the FAI config space into a directory which will become your live system. After that you create a bootable ISO which includes this directory tree.
Define the FAI classes:
cl="DEBIAN,BOOKWORM64,AMD64,FAIBASE,XFCE,XORG,DHCPC,DEMO,LIVEISO,LAST"
Build the live environment directory tree:
# LC_ALL=C fai -v dirinstall -u xfce33 -c $cl \
-s file:///srv/fai/config /srv/xfce
Then create the live ISO:
# fai-cd -s500 -MH -d none -g /etc/fai/grub.cfg.live \
-n /srv/xfce live.iso
Hint: The FAI nfsroot is not needed when building a live ISO.
More advanced usage:
You can build a special installation ISO for an USB stick that contains the config space on a writeable partition instead inside the read-only ISO. The log files of the installations will be save to this partition. After you have created the mirror in /tmp/mirror, build the ISO using the following two commands:
# fai-cd -d detect:// -m /tmp/mirror fai.iso
# mk-data-partition -c fai.iso /srv/fai/config
After that copy this ISO onto the USB stick.
It is possible to install over the network without using NFS, i.e. by getting the nfsroot via an http request. To do so you have to create a squashfs image using the following command:
# fai-cd -S squashfs.img
In addition to that you can create said image without a config space and without a mirror. This is useful for when you want to avoid creating a new image after modifying your config space or updating your mirror:
# fai-cd -d "" -SMeJ squashfs.img
To fetch the image via http, use the following kernel command line option:
root=live:http://your_server_or_IP/path/to/squashfs.img
Create the autodiscover boot image:
# fai-cd -JAg /etc/fai/grub.cfg.autodiscover fai-autod.iso
Create a minimalistic compressed network boot ISO image (~60MB) without nfsroot, the partial mirror and basefiles:
# fai-cd -BMJe fai-cd.iso
This ISO image can even be further reduced in size using the -s flag to fai-make-nfsroot(8).
Specify your own grub file:
# fai-cd -g /srv/fai/config/my_extras/grub.cfg -m /srv/fai/mirror
/srv/fai/iso/fai-cd.iso
Additional kernel command line options can be found in the man page of dracut.cmdline(7). fai-cd needs enough disk space in TMPDIR (/tmp by default) for creating the compressed filesystem. You may want to set it to another directories, before calling fai-cd.
Thomas Lange <lange@cs.uni-koeln.de>
| Mar 2025 | FAI 6 |