| I just migrated from a QNAP NAS to a custom build with ZFS. I have files with creation times dating back to the 90s on my original FAT16 filesystem and I didn't want to lose them, so I recently did a (way-too-)deep dive on this, I'll summarize my notes for you. First, ext4 actually does support creation times, called "crtime". But there's some internet confusion about it since this support predated linux kernel support, so you had to use ext4-specific tooling (on an unmounted filesystem) to access it, e.g.: debugfs -R 'stat <inode>' /dev/nvme0n1p1
debugfs -R -w 'set_inode_field <inode> crtime <new-time>' /dev/nvme0n1p1
The btrfs situation is similar, but btrfs called it "otime" (for some reason?). Linux 4.11 introduced kernel-level support unified across all filesystems, calling it "btime" (birth time).But the normal file syscalls only support reading btimes, not setting them to arbitrary values. And rsync on linux, as you saw, can't do anything the kernel doesn't have a syscall for. For a while the only option was to: 1. set the system clock 2. create a file (at which point the kernel sets btime to the system time, plus a few nanoseconds) 3. restore the system clock Obviously a huge hack, and needs root, but tools like s-tar automated it (search for "time storm" in this manpage): https://web.archive.org/web/20220331080358/http://schilytool... I almost gave up and spun up a Windows VM (since Windows has supported reading and writing creation times since the beginning). But then it clicked -- the kernel interface to the filesystem module takes the btime as an explicit parameter. So if you could find a kernel module that talks to the filesystem module directly (instead of going through the usual high-level file syscalls), you can pass along any btime you want. And there just so |