Twitter Updates

    follow me on Twitter

    G-AVLN in front of her home

    G-AVLN in front of her home

    Mostly Unix and Linux topics. But flying might get a mention too.

    Thursday, February 12, 2009

    Filesystem with "relatime" attribute

    Many debates have been carried out on the subject of time wasting when writing to i-node table (i.e. accessing the disk) when a user performes file access. Many alternatives have been offered over the years to avoid this.

    One of them is a filesystem attribute called relatime. It has been in existence for a while, but because nobody has been using it (by this I mean vendors rather than users), I never took sufficient time to remember how it works.

    Well, Ubuntu now uses relatime by default. Time to learn...

    Here is a quote from the best resource I found on the subject. It comes from an article posted by Jonathan Corbet on

    "Another approach was added in 2.6.20: the relatime mount option. If this flag is set, access times are only updated if they are (before the update) earlier than the modification time. This change allows utilities to see if the current version of a file has been read, but still cuts down significantly on atime updates. This option is not heavily used, perhaps because few people have heard of it and many distributions lack a version of mount which is new enough to know about it. Using relatime can still confuse tools which want to ask questions like "has this file been accessed in the last week?"

    Hint: if you want to exeriment with the behaviour, use the stat command. Read and modify a file few times, and observe how the atime (access time) is only updated if the last access was done before the last content change.

    Blog Archive