ZFSBOOT(8)

πŸ“¦ version 14.5, in freebsd 14.5

πŸ’… ZFSBOOT(8) β€” the manual page, bestie edition ✨

okay so real talk β€” this is zfsboot from the System Manager's Manual, and we're gonna get you comfy with it. no gatekeeping, no cap. let's go 🫢


✨ NAME ✨

zfsboot β€” bootcode for ZFS on BIOS-based computers

like, it's the little guy that wakes up first and goes "bestie, your pool is right here" πŸ’–


🌸 DESCRIPTION 🌸

zfsboot is what BIOS-based computers use to boot from a filesystem inside a ZFS pool. that's the whole vibe. no UEFI situations here, we're old school ✨

here's the part you gotta know: zfsboot gets installed in two parts on a disk or a partition that a ZFS pool uses.

  • part one β€” a single-sector starter boot block, installed at the very beginning of the disk or partition. main character energy, first to arrive πŸ’…
  • part two β€” a main boot block, installed at a special offset within the disk or partition. the one that actually does the work, lowkey πŸ‘‘

both of those areas are reserved by the ZFS on-disk specification for boot use β€” so don't go putting your own stuff there, that's literally their spot πŸŽ€

and hmm, one more thing: if you install zfsboot in a partition, then that partition should be made bootable using the appropriate configuration and boot blocks described in boot(8). iykyk πŸ”₯


πŸ¦‹ BOOTING πŸ¦‹

the zfsboot boot process is very similar to that of gptzfsboot(8). siblings fr fr πŸ’œ

but β€” one significant difference, and it's kind of a big one: zfsboot does not currently support the GPT partitioning scheme. 😭

so what does it probe for ZFS disk labels? only:

  • whole disks, and
  • MBR partitions (traditionally referred to as slices)

that's it. that's the list.

and also β€” check the BUGS section in gptzfsboot(8) for some limitations of the MBR scheme support. there are caveats, bestie, go read 'em πŸ™ˆ


πŸŽ€ USAGE πŸŽ€

zfsboot supports all the same prompt and configuration file arguments as gptzfsboot(8). literally all of them. same energy, different partitioning situation πŸ’–


⭐ FILES ⭐

  • /boot/zfsboot β€” boot code binary
  • /boot.config β€” parameters for the boot block (optional)
  • /boot/config β€” alternative parameters for the boot block (optional)

πŸ”₯ EXAMPLES πŸ”₯

zfsboot is typically installed using dd(1). classic. iconic. a little unhinged but we move πŸ’€

to install zfsboot on the ada0 drive:

dd if=/boot/zfsboot of=/dev/ada0 count=1
dd if=/boot/zfsboot of=/dev/ada0 iseek=1 oseek=1024

two commands, one starter block, one main block at that offset. slay ✨

⚠️ important warning bestie: if the drive is currently in use, the GEOM safety will prevent writes, and you must disable it before running the above commands: sysctl kern.geom.debugflags=0x10 yeah. it's that one. you've been warned 🫢

zfsboot can also be installed in an MBR slice:

gpart create -s mbr ada0
gpart add -t freebsd ada0
gpart bootcode -b /boot/boot0 ada0
gpart set -a active -i 1 ada0
dd if=/dev/zero of=/dev/ada0s1 count=2
dd if=/boot/zfsboot of=/dev/ada0s1 count=1
dd if=/boot/zfsboot of=/dev/ada0s1 iseek=1 oseek=1024

one big beautiful block of commands. copy it exactly, don't get creative πŸ’…

πŸ“ note: commands to create and populate a pool are not shown in the example above. this is just the bootcode part. you gotta handle the pool yourself, bestie, that's a whole other manpage 🧚

🌈 SEE ALSO 🌈

dd(1), boot.config(5), boot(8), gptzfsboot(8), loader(8), zpool(8)

go read them. all of them. i'll wait πŸ’œ


πŸ‘‘ HISTORY πŸ‘‘

zfsboot appeared in FreeBSD 7.3. vintage. retro. ate and left no crumbs πŸŽ€


πŸ“ AUTHORS πŸ“

This manual page was written by Andriy Gapon <avg@FreeBSD.org>. ty for your service legend πŸ«‘πŸ’–


πŸ’€ BUGS πŸ’€

Installing zfsboot with dd(1) is a hack.

i said what i said. ZFS needs a command to properly install zfsboot onto a ZFS-controlled disk or partition. until then we're all out here with dd and vibes 😭


<div align="center">

⭐ and that's the whole page bestie ⭐

this one came from Debian, dated March 27, 2018, and the section's called ZFSBOOT(8) β€” it's giving classic manpage but make it cute πŸ’–

stay slay, boot safe, and always iseek=1 πŸŽ€βœ¨πŸ¦‹

</div>

πŸ“¦ where this page comes from
  • freebsd 14.5: base 14.5
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms