How to enable write caching on domain controller

Hi,

   After adding Domain Controller role to my Windows 2008 R2 Enterprise server, write caching on my (the only) disk is being disabled every time I reboot the server.

   My question is how to enable write caching permanently on DC disk? I understand why this behavior is enforced and take full responsibility on possible data loss.

Regards,

Dmitry

October 9th, 2010 3:58am

Enabling or Disabling the Disk Write Caching

  1. Right-click My Computer , and then click Properties .
  2. Click the Hardware tab.
  3. Click Device Manager .
  4. Click the plus sign (+) next to the Disk Drives branch to expand it.
  5. Right-click the drive on which you want to enable or disable disk write caching, and then click Properties .
  6. Click the Disk Properties tab.
  7. Click to select or clear the Write Cache Enabled check box as appropriate.
  8. Click OK .

Source http://support.microsoft.com/kb/259716

Also Check http://support.microsoft.com/kb/324805

Free Windows Admin Tool Kit Click here and download it now
October 9th, 2010 7:24am

Please see this as well

http://blogs.msdn.com/b/dhawan/archive/2009/10/05/enable-or-disable-enable-write-caching-on-disk-behavior-on-disk.aspx

October 9th, 2010 7:32am

Actually, once a server is promoted to a DC, write cache is disabled by default. You can try to enable it, but it will revert back to disabled. This is default and can't be changed. It's done to protect the AD database as well as improve AD DC performance.

Event ID 1539 — Database integrity - Domain controllers attempt to protect this data from accidental loss or by disabling write-caching...
http://technet.microsoft.com/en-us/library/dd941847(WS.10).aspx

Slow Network Performance After You Promote a Windows 2000-Based ...If you use the Dcpromo tool to promote a Windows 2000-based server to a domain controller, the write caching functionality (write-back cache is a firmware ...
http://support.microsoft.com/kb/321543

Things to consider when you host Active Directory domain ...Discusses the issues that affect a domain controller that runs as a guest ...
http://support.microsoft.com/kb/888794

Event 13512 Logged on a Domain ControllerThe File Replication Service has detected an enabled disk write cache on the ...
http://support.microsoft.com/kb/316504

 

Is Exchange on the DC?

On another note, if Exchange is installed on a DC, Exchange requires write-cache enabled. The two services conflict with each other and cause issues, hence why it's recommended to never install Exchange on a DC. If Exchange is installed on it, you may want to read more info on the ramifications in the following link:

Exchange on a Domain Controller - Ramifications and How to Move Exchange off a DC  
Published by acefekay on Aug 8, 2009 at 7:00 PM 
http://msmvps.com/blogs/acefekay/archive/2009/08/08/moving-from-exchange-2000-currently-on-a-windows-2000-domain-controller-to-a-new-exchange-2003-server-on-a-windows-2003-member-server.aspx

 

Free Windows Admin Tool Kit Click here and download it now
October 9th, 2010 6:39pm

...

This is default and can't be changed.

...


Thank you, this answers the question. Too bad though, I fail to understand why I can't enable write caching on my own risk.

October 10th, 2010 5:38am

...

This is default and can't be changed.

...


Thank you, this answers the question. Too bad though, I fail to understand why I can't enable write caching on my own risk.


You are welcome. However, unfortunately you won't be able to do it.

Curious, why do you want to enable it? Is it for an app or service? If so, may I suggest a non-DC to run it on?

Free Windows Admin Tool Kit Click here and download it now
October 10th, 2010 2:52pm

This is to run standalone TFS server with WSS 3.0 and Lab Manager. Lab Manager wants SCVMM. VMM server wants domain account during installation. DC disables write caching, so entire thing is slow like ____.

I hoped to spin out this box quickly to get hands-on experience configuring and running TFS on "dummy project".

From my understanding, I can add another HDD or flash drive to the box and store on it domain database, log and sysvol. Write caching will be disabled on this drive only, but not on the system drive. Am I correct?

October 10th, 2010 6:26pm

Team Foundation Server, WSS and VMWare Lab Manager on a DC? Those apps are heavy hitters. Something like that I would highly suggest a non-DC anyway because you're pretty much loading up the box and a DC is just not designed for something like this.

I haven't tried with another drive whether a SATA, PATA, SCSI, SAS, IDE or USB, but from my understanding, if it's on the same controller, write cache will be disabled, but I'm not sure if there are additional controllers. What links have you read that state otherwise?

 

Free Windows Admin Tool Kit Click here and download it now
October 11th, 2010 1:18am

IMHO, DC disables write cache on particular physical disk, not on all the disks across some controller.

Single server TFS configuration works for small teams, and so far I did not see any problems with an extra IO added by DC (besides sneaky disabling write caching when installed on physical host).

Anyway, I ended up installing DC on VM. So, currently I have Hyper-V host with VMM Server joined to a domain which runs following VMs: DC, SSTP/PPTP VPN, single server TFS + WSS 3.0, 2 build agents and 2 test agents. If I find any issues with IO, later I'll move few VMs to a new disk(s).

I see why this kind of configuration might be a bad idea for enterprise, but for my purpose it works fairly well. It is cheap, fits my current hardware, and I know exactly how to scale it up an out if necessary.

Thanks again for your time, Ace.

October 11th, 2010 4:53am

You are welcome, Demchuk. For lab/testing purposed, it sounds like a good plan. However, as i mentioned, I haven't tested it with any other disks, and I would be curious of your findings.

Cheers!

Ace

Free Windows Admin Tool Kit Click here and download it now
October 11th, 2010 2:40pm

You can use utility Dskcache.exe from http://support.microsoft.com/?id=811392 to enable Write Cache by command script:

c:\dskcache.exe +w
exit

Also you can add this script to startup scripts:

Start gpedit.msc and use
Local Computer Policy\Computer Configuration\Windows Settings\Scripts
 
Thanks to http://forums.techarena.in/windows-server-help/59435.htm

September 26th, 2011 10:24am

Path: HKLM\System\CurrentControlSet\Services\NTDS\Parameters

Value: "DSA Heuristics"

Type: REG_SZ

Setting this to "1" (Note: the type MUST be a string type) prevents AD service from disabling write cache.

The relevant logic is in ntdsa.dll .

Checked in Win 2003 SBS SP2.
  • Proposed as answer by native_api Tuesday, April 24, 2012 8:40 PM
  • Unproposed as answer by native_api Tuesday, April 24, 2012 10:46 PM
  • Edited by native_api Tuesday, April 24, 2012 10:48 PM fix
  • Proposed as answer by native_api Tuesday, April 24, 2012 10:48 PM
Free Windows Admin Tool Kit Click here and download it now
April 24th, 2012 8:38pm

Just a note, that's something you wouldn't want to do on a production DC. It will cause issues with AD database functionality causing the possibility of losing data. For testing purposes, that's fine.
April 24th, 2012 11:14pm

AFAIK, not "will cause" but "increases chance". It increases chance of partial write to AD DB and it's potential corruption in case of power or hardware failure.

Whether or not to do this is simply a choice between investment into reliability and taking risk + cost of recovery. Enterprise would want reliability. SOHO and SMB may prefer less hardware to manage, 100% virtualization up to DCs, and relying on backup in case of a failure.

Free Windows Admin Tool Kit Click here and download it now
April 25th, 2012 7:01am

Path: HKLM\System\CurrentControlSet\Services\NTDS\Parameters

Value: "DSA Heuristics"

Type: REG_SZ

Setting this to "1" (Note: the type MUST be a string type) prevents AD service from disabling write cache.

The relevant logic is in ntdsa.dll .

Checked in Win 2003 SBS SP2.

Where do i find that exact spot? Having this issue with SSD EVO 850 Server 2012 R2
April 6th, 2015 5:46pm

Path: HKLM\System\CurrentControlSet\Services\NTDS\Parameters

Value: "DSA Heuristics"

Type: REG_SZ

Setting this to "1" (Note: the type MUST be a string type) prevents AD service from disabling write cache.

The relevant logic is in ntdsa.dll .

Checked in Win 2003 SBS SP2.

Still applies but logic moved to ntdsai.dll post Windows Server 2003.
Free Windows Admin Tool Kit Click here and download it now
April 7th, 2015 10:22pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics