Custom File Attribute (xattr)

The ext4 filesystem supports extended attributes, which are name-value pairs that can be associated with a file. - chatGPT

If you need to move files with xattr between filesystems (e.g., from ZFS to ext4), you may encounter compatibility issues. Use tools like tar or rsync with โ€“xattrs to preserve attributes.

Notes

Custom attribute are of the form user.tag and the prefix user is not customizable, only the tag part is, eg trying to set:

$ xattr -w blake3.h 1234 src/blake3.rb     # [Errno 95] Operation not supported

$ xattr -w user.blake3 1234 src/blake3.rb  # works fine
# Alternatively
$ getfattr -d filename     # List extended attributes of a file or directory
$ getfattr -d -h symlink   # List attributes without following symlinks

Lang support

Written on January 11, 2025, Last update on December 20, 2025
filesystem file metadata ext4 zfs