16

Inspired by this answer, I realize I have no idea how to disable the last accessed attribute in Windows to increase performance. If you can, how?

I know in Linux you can mount the partition with the 'noatime' option, but is there a similar feature in Windows for NTFS?

romandas
  • 3,302
  • 8
  • 39
  • 44
  • 2
    Oooh, this will be a good one, +1 – Avery Payne Jun 30 '09 at 16:30
  • I split the difference between Sven's and J Rennie's answers - they both answer the question but provide different information. – romandas Jun 30 '09 at 17:31
  • 1
    just a comment about the linux "noatime": in many cases it's safer (and almost as efficient) to use "relatime", with linux fs/kernels >2008. relatime will write the atime only if the file was updated since the last atime, or X days/hours passed (default 24h?). – Olivier Dulac Dec 17 '15 at 17:07

2 Answers2

16
fsutil behavior set disablelastaccess 1

But be careful, some program (especially backup programs) might need this.

Sven
  • 98,649
  • 14
  • 180
  • 226
  • Accepted -- nice use of fsutil. +1 went to the reg entry and the technet link from J Rennie. – romandas Jun 30 '09 at 17:23
  • 3
    I don't see why backup programs would use it? I think such software would rely on last modified attribute instead. – matt Aug 03 '12 at 12:39
  • 3
    @lucek: I agree that it should but the Windows platform is full of cheap crap made by morons without a clue and unfortunately, "backup" software people use is way too often the ultra-cheap crap from the last corner of India or China that is preloaded onto equally cheap external disks or thumb drives they use for backup purposes. Since I don't trust that this stuff gets the basics done right, I wrote the warning that it *might* have side effects to turn these attributes off. – Sven Aug 03 '12 at 13:04
  • Is this still working on Windows 10? – Jake Dec 29 '16 at 01:38
  • 1
    Note that it's not just bad programs that use it: MS's own [AgeStore](https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/using-agestore) tool for removing old .pdb debug symbols from, e.g., your local cache uses it, too, which can cause issues since Vista switched the default. – SamB May 28 '19 at 22:27
9

The HKLM\SYSTEM\CurrentControlSet\Control\FileSystem\NtfsDisableLastAccessUpdate (docs) registry entry is a REG_DWORD that can be:

  • 0: update the last-access timestamp, and record each change in the NTFS log (default)
  • 1: don't update the last-access timestamp, and don't record time stamp updates in the NTFS log

Whether it makes much difference is debatable.

JR

David Fraser
  • 406
  • 6
  • 12
John Rennie
  • 7,776
  • 1
  • 23
  • 35
  • +1 for the registry entry and technet link -- I was rather torn as to which would be 'better', but wanted to promote the use of fsutil. – romandas Jun 30 '09 at 17:24
  • 1
    I did this before plugging in a cheap USB2 flash drive that is formatted in NTFS with lots of files. The read performance increase is HUGE! Thank you. I also created .reg files on my desktop to turn the feature on and off. – Alex Cannon Aug 29 '19 at 20:29