fai-diskimage(8)

πŸ“¦
version 6.6ubuntu1 Β· 4 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

πŸ’– 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, --class CLASS[,CLASS] β€” define your list of FAI classes. comma-separated, she contains multitudes. ✨
  • -C CFDIR β€” 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 the fai call. it then executes the scripts in class/[0-9]* for defining classes. ✨
  • -S, --size SIZE β€” set the size of the raw image. suffixes k M G T are supported, so go feral. πŸ“
  • -s, --cspace URI β€” location of the config space. if the location starts with /, the prefix file:// will be added. see fai.conf(5) for all supported protocols. default is /srv/fai/config. πŸ”
  • -u, --hostname name β€” 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