fai-cd(8)
β¨ NAME β¨
fai-cd β makes a bootable CD-ROM or USB stick that performs an FAI πΏβ¨
okay bestie so if you've ever wanted a CD (or a lil USB stick) that just installs your whole setup by itself, no install server, no drama? that's literally this. no cap. π«Ά
π SYNOPSIS π
fai-cd [OPTION] -m MIRROR ISOFILE
fai-cd [OPTION] -B FILE
fai-cd [OPTION] -d URL
fai-cd [OPTION] -S IMAGEFILE
πΈ DESCRIPTION πΈ
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_ β that's your output, girlie. π
To create the image the command requires the NFSROOT, the 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). slay.
π¨ NOTE, bestie, read this one: By default,fai-cduses the grub file from/etc/fai/grub.cfg, which is designed for demo purposes. This grub menu passes the"menu"flag to theFAI_FLAGSparameter, 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-gflag, as described below. it's giving "surprise menu every single time" and honestly? not the vibe for a production setup. π
π OPTIONS π
-Aβ Create a boot only CD image (also usable for an USB stick) with autodiscover functionality. The CD will scan the subnet for a FAI server. By default it shows a menu with all profiles available from which you can select a type of installation. This image only needs 25MB. You can add the-Joption to make the image smaller. tiny icon energy. π-Bβ Create a boot only ISO image which does a network installation. It does not include the nfsroot, the partial mirror and the config space; however for it to automatically initiate the installation-dhas to be set. By defaultCONFIG_SRCwill be empty.-bβ After creating the ISO image burn it by callingwodim(1)(a version ofcdrecord). π₯-c_DIRECTORY_ β Override the value ofFAI_CONFIGDIRset innfsroot.conf.-C_DIRECTORY_ β Use _DIRECTORY_ as the configuration directory instead of the default/etc/fai. You can also set the environment variableFAI_ETC_DIR. β¨-d_URL_ β Do not include the config space in the image. Instead set the variable to the location of the config space to _URL_. This setsFAI_CONFIG_SRCin the grub config, which is obtained from the FAI configuration dir (see-C). Set it to""to not setFAI_CONFIG_SRCat all. If not set, the config space is taken fromFAI_CONFIGDIRand copied to/var/lib/fai/configin the image. Currently nofile:is allowed here, instead setFAI_CONFIGDIRinnfsroot.conf(5). π don't try the file: thing, fr fr.-eβ Exclude the directory/var/tmpfrom the nfsroot. You may put the filebase.tar.xzin the configuration space into the subdirectorybasefiles. This option will save about 50MB of disk space. This option will exclude the directory even when-His given. π-fβ Force removal of an existing ISO image before creating a new one. (yes it will delete it, she said what she said π)-g_FILE_ β Use _FILE_ as thegrub.cfgfile. The script will look for _FILE_ inCFDIR. If _FILE_ is located in another directory then a full path</> must be specified. If not specified, use/etc/fai/grub.cfg.-hβ Show simple help and version. the lil "hi, what's up" option. π«Ά-Hβ Do not hide directories. Using this option will consume about 45MB more disk space on your media. By default, some directories like man pages and locales are hidden and will not be put onto the CD or the USB stick.-Jβ Use xz compression when callingmksquashfs. Default is zstd, which is much faster. β‘-Mβ Do not add the package mirror to the CD. Packages that would be fetched from the mirror are obtained from the normal sources configured elsewhere, usually remote repositories.-m_DIRECTORY_ β Use _DIRECTORY_ as partial FAI mirror. This option is mandatory, unless you use-Mor-B. π-n_DIRECTORY_ β Override the value ofNFSROOTset innfsroot.conf.-s_blocks_ β This option is now unused and will be ignored. rip to a legend, it's just decorative now. π-Sβ Create asquashfsimage file instead of a complete iso. The image contains the nfsroot and can be fetched through various ways over the network. For an example, see the section "FAI without NFS" in the FAI Guide.-Vβ Set the volume id of the ISO. Default id isFAI_CD. You also must adjust theCDLABELin/etc/fai/grub.cfg, or use-gand specify your owngrub.cfg. don't forget this part bestie, or the boot will not find your stuff π
π¦ EXAMPLES π¦
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
β οΈ careful with that of= bestie, that's a whole device you're writing to. main character energy but make it accurate. π
πΏ 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
π NOTES π
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. π
π bestie do not let /tmp run out of space halfway through, it's giving tragedy.
π SEE ALSO π
π FILES π
/etc/fai/fai.confβ The FAI configuration file./etc/fai/grub.cfgβ The default grub2 menu configuration file forfai-cd. (yes, the demo one, remember? π)
π AUTHOR π
Thomas Lange <lange@cs.uni-koeln.de>
okay that's the whole thing, periodt. π«Ά this page is from FAI 6, dated Dez 2025 β go build something iconic with it. you got this bestie β¨π
π¦ where this page comes from
- ubuntu stonking: fai-server 6.6ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms