Email or username:

Password:

Forgot your password?
sam

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.. 🧵

8 comments
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

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

glib will do the same in >=2.78 thanks to gitlab.gnome.org/GNOME/glib/-/.

EDIT: I forgot to mention, KDE's kio handles it too. So, together, the respective KDE and GNOME file managers and such should be fine.

sam

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

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

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

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!

Go Up