How to mount the root filesystem with "strictatime"?

From: Michael Opdenacker
Date: Thu Apr 28 2022 - 09:48:31 EST


Greetings,

Sorry, this is almost a userspace question ;-)

I need to mount my root filesystem in "strictatime" mode, instead of the
"relatime"  default.

Of course, if I pass "rootflags=strictatime" through the kernel command
line, it doesn't work because the kernel only knows about the
"MS_STRICTATIME" define, and not about the "strictatime"  string, which
is a userspace thing:

    2.351189] EXT4-fs (mmcblk0p2): Unrecognized mount option
"strictatime" or missing value

Would there be a way to do this from the kernel command line anyway?
Otherwise, I'll run "mount -o remount,strictatime /" from my startup
scripts.

Thanks
Michael.

--
Michael Opdenacker, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com