TARFS(5)
๐ TARFS(5) โ tarfs
okay so bestie, buckle up, because this one is the tarfs manual page from the File Formats Manual and it's genuinely so cool. it's a whole filesystem that lives inside a tarball. no cap. ๐
โจ NAME โจ
tarfs โ the tarball filesystem, aka the moment a .tar file said "i'm a filesystem now" and honestly? it ate. ๐
๐ธ SYNOPSIS ๐ธ
so there's two ways to get this driver into your life, depending on the vibe you're going for.
option one: compile it straight into the kernel. drop this line into your kernel configuration file:
options TARFS
option two: load it as a module at boot time instead. put this in loader.conf(5):
tarfs_load="YES"
pick your fighter, both slay. โจ
๐ฆ DESCRIPTION ๐ฆ
the tarfs driver implements a read-only filesystem backed by a tar(5) file. read-only means read-only, bestie, it's not gonna let you write anything, periodt. rn only POSIX archives are supported, optionally compressed with zstd(1). that's the whole guest list, iykyk. ๐ซถ
the preferred I/O size for tarfs filesystems can be adjusted using the vfs.tarfs.ioshift sysctl setting and tunable. set it to 0 and it'll reset itself back to its default value. and listen โ this is the important part โ changes to this setting only apply to filesystems mounted after the change. so if you're sitting there wondering why your already-mounted fs isn't picking up the new number... that's why. sorry babe ๐
when the backing tar file is compressed with zstd(1), you can improve I/O performance by making sure the compressed data is broken up into multiple frames. this helps minimize unnecessary decompression work, which is exactly the kind of efficiency we stan. ๐
if you're using bsdtar(1) to create the tar file, you can pull this off with the zstd:max-frame-size and zstd:frame-per-file options. sensible frame sizes? powers of 2, sitting between the system's base page size (see arch(7)) and the value of the kern.maxphys sysctl. that's the sweet spot, no notes.
and here's the tradeoff tea, because there's always a tradeoff:
- smaller frames will generally give you a worse compression ratio and need extra kernel memory to maintain an index. not the vibe. ๐ญ
- larger frames will on average need more CPU time to access data when you're doing random I/O. also not the vibe, just a different flavor of not the vibe.
๐ฅ DIAGNOSTICS ๐ฅ
if it's enabled by the TARFS_DEBUG kernel option, the vfs.tarfs.debug sysctl setting controls debugging output from the tarfs driver. ๐ต๏ธโโ๏ธ
want debugging output for individual sections of the driver? you enable them by adding together the relevant values from the table below. yes, adding. it's a bitmask situation, math girlies rise. ๐งฎโจ
0x01โ memory allocations0x02โ checksum calculations0x04โ filesystem operations (vfsops)0x08โ path lookups0x10โ file operations (vnops)0x20โ general I/O0x40โ decompression0x80โ decompression index0x100โ sparse file mapping0x200โ bounce buffer usage
๐ SEE ALSO ๐
tar(1), zstd(1), fstab(5), tar(5), mount(8), sysctl(8) โ go read them, they're all icons in their own right. ๐
๐ HISTORY ๐
the tarfs driver was developed by Stephen J. Kiernan <stevek@FreeBSD.org> and Dag-Erling Smรธrgrav <des@FreeBSD.org> for Juniper Networks and Klara Systems. this manual page was written by Dag-Erling Smรธrgrav <des@FreeBSD.org> for Juniper Networks and Klara Systems. we love a credited author moment, absolute main character energy. โญ
and that's the whole page bestie ๐ this one's from the Debian crew, dated February 14, 2023 โ a whole Valentine's Day gift to us all ๐โจ๐
๐ฆ where this page comes from
- freebsd 14.5: base 14.5
- ๐ the page's license: BSD-2-Clause
- Copyright (c) 2022 Klara, Inc
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms