Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Mar 2024 14:59:46 +0100
From:      =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= <des@FreeBSD.org>
To:        Mark Saad <nonesuch@longcount.org>
Cc:        FreeBSD Hackers <freebsd-hackers@freebsd.org>
Subject:   Re: TarFS
Message-ID:  <86edbyh0od.fsf@ltc.des.dev>
In-Reply-To: <CAMXt9NYOA4KJu86gnCwOZeDp31gsxwwrzdb%2Bc6KLsOQxxD6r5A@mail.gmail.com> (Mark Saad's message of "Fri, 22 Mar 2024 11:48:21 -0400")
References:  <CAMXt9NYOA4KJu86gnCwOZeDp31gsxwwrzdb%2Bc6KLsOQxxD6r5A@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Mark Saad <nonesuch@longcount.org> writes:
> I was wondering if anyone has started to play with tarfs in FreeBSD 14?

I wrote it, does that count?

> It appears to puke with larger tarballs.

On the contrary, one of the use cases I tested was buildworld from a
tarball of the source tree, which it handled just fine.

> For example, if I fetch a copy of ports or pkgsrc and decompress it to
> just a posix tar archive I can't get it to mount.
>
> root@mono:/home/nonesuch # file ports.tar
> ports.tar: POSIX tar archive
> root@mono:/home/nonesuch # mount -t tarfs ./ports.tar /tarfs/ports
> mount: ./ports.tar: Inappropriate file type or format

% fetch ftp://ftp.freebsd.org/pub/FreeBSD/ports/ports/ports.tar.zst
ports.tar.zst                                           47 MB 5431 kBps    =
09s
% sudo mount -rt tarfs $PWD/ports.tar.zst /mnt
mount: /home/des/ports.tar.zst: Inappropriate file type or format
% dmesg | grep tarfs=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20
tarfs_alloc_one: unsupported global extended header at 0
% zcat ports.tar.zst | hexdump -C | head -3
00000000  70 61 78 5f 67 6c 6f 62  61 6c 5f 68 65 61 64 65  |pax_global_hea=
de|
00000010  72 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |r.............=
..|
00000020  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |..............=
..|

This is a non-standard extension header emitted by `git archive` which
contains metadata about the git tree from which the archive was created.
I believe you can safely strip it off (zcat ports.tar.zst | dd bs=3D1k
skip=3D1 >ports.tar), but you'll run into issues with very long paths in
devel/electron*.  I will take a closer look when I find the time.

Note that tarfs can mount tarballs compressed with zstd, but performance
will be poor unless you create a multi-frame archive (try using --zstd
--options=3Dzstd:frame-per-file,zstd:min-frame-size=3D65536).

DES
--=20
Dag-Erling Sm=C3=B8rgrav - des@FreeBSD.org



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86edbyh0od.fsf>