xfs filesystem being mounted at /disk supports timestamps until 2038 (0x7fffffff)
Solution 1:
Introduced in kernel 5.10 is the XFS feature "bigtime" that supports dates until 2486. Ubuntu 21.04 uses kernel 5.11 so if you're using that version or newer of Ubuntu then you should be set. The latest LTS Ubuntu 20.04 is still using too old of a kernel. This will change with time of course.
To use this feature you must have a kernel v5.10 or newer and a similarly new version of mkfs.xfs.
When creating the filesystem do:
mkfs.xfs -m bigtime=1 device
To convert an existing filesystem (must be unmounted) do:
xfs_admin -O bigtime=1 device
This is explained in the Arch Linux XFS wiki. Also according to the man page make sure to run xfs_repair -n
on the filesystem before converting an existing filesystem. This checks to make sure there are no errors. If there are errors found then do not convert the filesystem.
Since it's easy to convert an existing filesystem I'm just going to wait until close to 2038 before converting my old filesystems. This leaves lots of time to work out any bugs. By then I will have probably recreated all my filesystems on new hardware anyway.