fai-diskimage(8)
π fai-diskimage β the girlboss guide to making bootable disk images π
okay so bestie, welcome to fai-diskimage β it's a System Manager's Manual page, it lives in section 8, and it's genuinely one of the most iconic tools in the FAI universe. sit down, grab a strawberry drink π, and let's get into it.
β¨ NAME β¨
fai-diskimage β create a disk image for booting a VM. that's it. that's the whole vibe. π¦
β¨ SYNOPSIS β¨
fai-diskimage imagename
literally one argument, main character energy, no notes. π
β¨ DESCRIPTION β¨
okay so here's the tea π«: fai-diskimage creates a disk image, and that image is bootable β like, it will actually start up. it plays nice with Qemu/KVM, VirtualBox, VMware, Xen, an Android device, or your whole cloud infrastructure. pick your fighter. π
the way it works is it runs the Fully Automatic Installation using a list of FAI classes (iykyk), and when it's done you have yourself a bootable disk image. slay.
these formats are supported, no cap:
.raw.raw.xz.raw.zst.qcow2.qcow2.zst.vdi.vhdx.vmdk.simg
β¨ OPTIONS β¨
-c,--classCLASS[,CLASS] β define your list of FAI classes. comma-separated, she contains multitudes. β¨-CCFDIR β use CFDIR as the configuration directory. default is/etc/fai. π-h,--helpβ print help. we love a supportive queen. π«Ά-N,--newβ this option gets passed straight to thefaicall. it then executes the scripts inclass/[0-9]*for defining classes. β¨-S,--sizeSIZE β set the size of the raw image. suffixeskMGTare supported, so go feral. π-s,--cspaceURI β location of the config space. if the location starts with/, the prefixfile://will be added. seefai.conf(5)for all supported protocols. default is/srv/fai/config. π-u,--hostnamename β set hostname to name. name her, bestie. π-v,--verboseβ be verbose. tell me everything. π¬
β¨ EXAMPLES β¨
first things first: set up the configuration space. you'll get an initial configuration including several examples. very demure, very mindful.
# fai-mk-configspace
now you can build your first disk image π₯Ή
# export FAI_BASEFILEURL=https://fai-project.org/download/basefiles/
# cl="DEBIAN,BOOKWORM64,AMD64,FAIBASE,GRUB_PC,DHCPC,DEMO,CLOUD,LAST"
# fai-diskimage -vu cloud3 -S2G -c$cl cloud.raw
this creates a Debian system with a small set of software packages without a graphical desktop (minimalist queen π§). the disk image cloud.raw will be of size 2 GB and the host is called cloud3.
and now for the glow-up edition:
# export FAI_BASEFILEURL=https://fai-project.org/download/basefiles/
# export NIC1=ens3
# cl=DEBIAN,FAIBASE,UBUNTU,JAMMY64,AMD64,GRUB_PC,DHCPC,XORG,DEMO,LAST
# fai-diskimage -vNu ubuntu -S15G -c$cl ubuntu.qcow2
this creates a disk image of size 15GB called ubuntu.qcow2 for a Ubuntu 22.04 desktop. π₯ you have to set the variable NIC1 to the name of the network interface inside the environment you will run this disk image. here, ens3 is the network name inside a KVM/QEMU virtual machine.
β¨ NOTES β¨
fai-diskimage will use zerofree if it's available on the host, for getting better compression of the raw images. teamwork makes the dream work. π€
fai-diskimage is not limited to creating images for virtual machines. the raw images can also be copied (via dd) onto a real disk for booting bare metal hosts. she does it all, fr fr. πͺ
you can start fai-diskimage in a clean shell environment by calling:
# env -i /usr/sbin/fai-diskimage -vNu cloudhost -S5G -cBOOKWORM64,CLOUD
disk.raw
you can also build cross-architecture disk images using fai-disimage. see the chapter "Building cross-architecture disk images" in the FAI guide for details. π¦
β¨ SEE ALSO β¨
this program is part of FAI (Fully Automatic Installation). see the FAI manual for more information on how to use fai-monitor. the FAI homepage is https://fai-project.org. go look, it's giving resources. π
β¨ AUTHOR β¨
Thomas Lange <lange@cs.uni-koeln.de> β thank you for your service, king π
and that's the whole page bestie!! this was FAI 6, dated December 2023, and honestly? iconic. periodt. ππΈβ¨
π¦ where this page comes from
- debian trixie: fai-server 6.4.3
- ubuntu resolute: fai-server 6.4.3ubuntu1
- 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