Is there a way to disable the mtime of an filesystem?
There is an Filesystem independend noatime Option, but no "nomtime". Also in the Filesystem specific documentation for ext4 and/or btrfs i couldn't find this.
Does this exist?
Server Fault is a question and answer site for system and network administrators. It only takes a minute to sign up.Sign up to join this community
There is no such option in the kernel.
#define ST_NOATIME 0x0400 /* do not update access times */ #define ST_NODIRATIME 0x0800 /* do not update directory access times */ #define ST_RELATIME 0x1000 /* update atime relative to mtime/ctime */
I cannot think of any functional purpose for this option other than for testing purposes (your use case).
Your options are:
I found that there is the
S_NOCMTIME flag in
#define S_NOCMTIME 128 /* Do not update file c/mtime */
which seems to do what's needed. Apparently it's not exposed to users though, but there are examples of using it (just grep for it), so one should be able to hack a little patch for the according file system.
An actual use case would be avoiding inode updates when writing small chunks of data to a fixed-size circular buffer (e.g. to avoid needless erase cycles on NAND-based storage).