treehouse.systems is one of the many independent Mastodon servers you can use to participate in the fediverse.
A community of friends mostly surviving in the technology industry. If you sign up, please provide a Twitter, GitHub, or personal blog or website link for us to get to know you better.

Administered by:

Server stats:

526
active users

sam
Public

Today, we changed the default recommended filesystem in the handbook from ext4 to xfs.

XFS is robust and has all the niceties of ext4 (modulo shrinking) but with modern features on top.

(It helps that xfsprogs doesn't have weird endianness bugs too..)

btrfs is of course another option for the future but our users are conservative in some respects, and baby steps > none.

The main benefit of this is reflinks and copy_file_range which automatically takes advantage of that.

Now, as for using it.. 🧵

sam

Portage uses copy_file_range and friends when merging packages to the live filesystem when it can by providing wrappers of some Python stdlib functions.

If XFS (or another "good" backing fs is used), it can take advantage of it for you.

We've found a bunch of bugs over the years through this, in various filesystems, actually!

Take a look at wiki.gentoo.org/wiki/User:Sam/ for a list.

sam
Public

Fortunately, other libraries are starting to allow transparent use!

Jannik Glückert recently implemented support in libstdc++ [0][1] which will arrive in GCC 14.

[0] gcc.gnu.org/git/?p=gcc.git;a=c
[1] gcc.gnu.org/git/?p=gcc.git;a=c

sam
Public
sam
Public

And last but in no way least, GNU coreutils 9.0 defaults to --reflink=auto for cp and install.

Let me know if there's other software out there which supports this transparently.

sam
Public

Reflinks aren't particularly new, and nor is copy_file_range or even sendfile (see the GCC commits), but it's interesting how often these improvements are sittong on the table waiting for someone to claim them.

Check the guts of your favourite libraries, you might be surprised!

sam
Public

Bonus: I should say, zfs doesn't yet support this in a release on Linux, surprisingly.

Support was recently added on master in github.com/openzfs/zfs/pull/13 but only for FreeBSD. I believe Linux support is in the works.

sam
Public

Bonus2: Portage >=3.0.48 won't overwrite identical files on the target filesystem as well: bugs.gentoo.org/722270. Thanks to Michael Egger for the contribution!

bugs.gentoo.org722270 – sys-apps/portage: add FEATURE to skip overwrite of identical files during merge
sam
Public
bugs.openjdk.org[JDK-8282039] (fs) Use copy_file_range system call for copying on GNU/Linux systems - Java Bug System
jlbec
Public

@thesamesam Reflinks live!!!

nina
Public

@thesamesam chimerautils uses copy_file_range for cp(1), due to its freebsd origin (where copy_file_range was first introduced)

Cassandrich
Public

@thesamesam Sadly I think this means fallocate doesn't work and you can ENOSPC even after attempting to reserve space. Basically, overcommit for disk. 🤮 Ext4 is the solid option.