{"id":905,"date":"2017-11-12T21:22:23","date_gmt":"2017-11-13T02:22:23","guid":{"rendered":"https:\/\/ithinkvirtual.com\/?p=905"},"modified":"2018-02-10T09:11:59","modified_gmt":"2018-02-10T14:11:59","slug":"fixing-a-corrupt-domain-controller-stop-code-0x00002e2","status":"publish","type":"post","link":"https:\/\/ithinkvirtual.com\/2017\/11\/12\/fixing-a-corrupt-domain-controller-stop-code-0x00002e2\/","title":{"rendered":"Fixing A Corrupt Domain Controller – Stop Code 0x00002e2"},"content":{"rendered":"

Yesterday morning I discovered that my Synology NAS had an unexpected shutdown in the middle of the night while my homelab VMs\/workloads were still running.\u00a0 This\u00a0caused both of my Domain Controllers databases to become corrupt resulting in being unable to boot those machines.\u00a0 When attempting to boot them, they would get stuck in a BSOD boot-loop and would display a Stop Error Code of 0x00002e2.<\/p>\r\n

. <\/span><\/div>\r\n

After some research I was able to figure out how to recover my VMs and get them to boot up again.\u00a0 This had happened to me once before sometime earlier this year and luckily I remembered that I had taken some notes on how to fix it so I figured this time I would put together a formal “How To:” guide to have it documented for myself and hopefully to help others facing this issue as well.\u00a0 So without further adieu…let’s get to it!<\/p>\r\n

. <\/span><\/div>\r\n

To start, you will need to power-on the machine and then keep pressing the F8<\/strong> key to bring up the “Advanced Boot Options<\/strong>” boot menu.\u00a0 Navigate down to Directory Services Repair Mode<\/strong> enter press Enter<\/strong> to boot you into Safe Mode.<\/p>\r\n

\"\"<\/a><\/p>\r\n

When you reach the login screen, log in with the Local Administrator<\/strong> account since Active Directory Domain Services are obviously unavailable.<\/p>\r\n

\"\"<\/a><\/p>\r\n

Once at the Desktop, open an elevated Command Prompt<\/strong> window.<\/p>\r\n

\"\"<\/a><\/p>\r\n

As a best practice, I feel it is always wise and important to make a backup of the files before doing any modifications.\u00a0 Since we will be backing up the NTDS directory, create a directory at your preferred location to store the backup files.\u00a0 I chose to make a backup folder on the root of “C:\\<\/strong>” and a sub-directory with the name\/date of the directory I am backing up.<\/p>\r\n

md C:\\Backup\\NTDS_11122017<\/pre>\r\n

Then copy everything from the “C:\\Windows\\NTDS” directory to this new location using xcopy.<\/p>\r\n

xcopy C:\\Windows\\NTDS\\* C:\\Backup\\NTDS_11122017 \/E \/Y \/V \/C \/I<\/pre>\r\n

\"\"<\/a><\/p>\r\n

Once done, let’s rename any .log file extensions in the NTDS directory to .log.old<\/p>\r\n

cd C:\\Windows\\NTDS\r\n\r\nren *.log *.log.old<\/pre>\r\n

\"\"<\/a><\/p>\r\n

Now, this is where we get to the good stuff!<\/p>\r\n

First, run the following command to repair the database.<\/p>\r\n

esentutl \/p \"C:\\Windows\\NTDS\\ntds.dit\"<\/pre>\r\n

\"\"<\/a><\/p>\r\n

This will display the following warning message, click “OK<\/strong>“<\/p>\r\n

\"\"<\/a><\/p>\r\n

Let it do its thing and you will see the following once complete.<\/p>\r\n

\"\"<\/a><\/p>\r\n

Now we need to use the NTDS Utility (ntdsutil.exe) to activate the NTDS instance and compact the DB to a new file which will then be used to overwrite the original.\u00a0 I will be compacting it to a new TEMP directory within the NTDS directory.\u00a0 The command will automatically create the new directory if it’s not already present.\u00a0 Enter the following commands.<\/p>\r\n

ntdsutil\r\n\r\nactivate instance ntds\r\n\r\nfiles\r\n\r\ncompact to C:\\Windows\\NTDS\\TEMP<\/pre>\r\n

If successful, you will be presented with instructions to copy the newly compacted file to the NTDS directory, overwriting the original, and also to delete any .log files in the NTDS directory.\u00a0 Before we can do that we need to exit out of the ntdsutil.\u00a0 Type quit<\/strong><\/em> twice to exit.<\/p>\r\n

quit\r\n\r\nquit<\/pre>\r\n

\"\"<\/a><\/p>\r\n

Let’s follow those instructions and also delete the *.log.old files we renamed earlier.<\/p>\r\n

copy \"C:\\Windows\\NTDS\\TEMP\\ntds.dit\" \"C:\\Windows\\NTDS\\ntds.dit\"\r\n\r\nYes<\/pre>\r\n

Ensure you are still in the NTDS directory before entering the following delete commands.<\/p>\r\n

del *.log\r\n\r\ndel *.log.old<\/pre>\r\n

\"\"<\/a><\/p>\r\n

The hard part is now over!\u00a0 Let’s go ahead and reboot the machine normally.<\/p>\r\n

\"\"<\/a><\/p>\r\n

If all goes well and as expected, your machine will boot successfully and you can log in again with an Active Directory Domain Admin account.<\/p>\r\n

\"\"<\/a> \"\"<\/a><\/p>\r\n

Awesome!\u00a0 Well, I hope you’ve found this guide useful.\u00a0 Please feel free to share this and provide me some feedback\/comments below.\u00a0 Thanks for reading!<\/p>\r\n

 <\/p>\r\n

-virtualex-<\/p>

<\/div>

<\/path><\/svg><\/i> \"Loading\"<\/p>

<\/div>","protected":false},"excerpt":{"rendered":"

Yesterday morning I discovered that my Synology NAS had an unexpected shutdown in the middle of the night while my homelab VMs\/workloads were still running.\u00a0 This\u00a0caused both of my Domain Controllers databases to become corrupt resulting in being unable to boot those machines.\u00a0 When attempting to boot them, they would get stuck in a BSOD…<\/p>\n

<\/div>\n

<\/path><\/svg><\/i> \"Loading\"<\/p>\n

<\/div>\n","protected":false},"author":1,"featured_media":928,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"footnotes":"","_jetpack_memberships_contains_paid_content":false,"jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[9],"tags":[4,11,10,29],"jetpack_publicize_connections":[],"aioseo_notices":[],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/i0.wp.com\/ithinkvirtual.com\/wp-content\/uploads\/2017\/11\/2017-11-12_19-12-46.png?fit=884%2C333&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p7k0Z6-eB","jetpack-related-posts":[],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/ithinkvirtual.com\/wp-json\/wp\/v2\/posts\/905"}],"collection":[{"href":"https:\/\/ithinkvirtual.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ithinkvirtual.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ithinkvirtual.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ithinkvirtual.com\/wp-json\/wp\/v2\/comments?post=905"}],"version-history":[{"count":0,"href":"https:\/\/ithinkvirtual.com\/wp-json\/wp\/v2\/posts\/905\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ithinkvirtual.com\/wp-json\/wp\/v2\/media\/928"}],"wp:attachment":[{"href":"https:\/\/ithinkvirtual.com\/wp-json\/wp\/v2\/media?parent=905"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ithinkvirtual.com\/wp-json\/wp\/v2\/categories?post=905"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ithinkvirtual.com\/wp-json\/wp\/v2\/tags?post=905"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}