When an Exchange database gets corrupt or damaged, it enters the Dirty Shutdown state and dismounts from the Exchange Server. As a result, mailboxes stored in the database become inaccessible. Users having mailboxes in a corrupt or dismounted Exchange database can’t access, send, or receive emails. However, if their profile is set up in Outlook with default Cached Exchange Mode, they can access the mail items stored in the local cache.
It is to be noted that the database in Dirty Shutdown state can’t be mounted unless you fix the database inconsistencies or corruption. If you try mounting it just like that, you are likely to receive an error, such as “Unable to mount database. (hr=0x80004005, ec=1032) in Exchange Management Shell (EMS)” or “Unable to mount database (hr=0x80004005, ec=1108) in the Exchange Admin Center (EAC).”
In such a case, you have two options:
- Restore database copy from a recent backup
- Repair or recover the database using EseUtil or an Exchange recovery software
But sometimes, even after restoring the database from the online or offline backup successfully, it may fail to mount and display the following error message:
“Failed to mount Exchange database after a successful restore to the recovery storage group.”
This may happen due to reasons, such as:
- Missing or deleted logs
- Non-contiguous transaction logs
Now, let’s discuss the ways to fix the database that fails to mount even after a successful restore.
Fix Database that Fails to Mount after Restore
When a database is restored from the backup, it is in Dirty Shutdown state or inconsistent. Thus, it’s critical to bring the database back to Clean Shutdown state. For this, you can use the EseUtil Hard Recovery Storage Group (EseUtil /cc). However, before you use Hard Recovery, you can try Soft Recovery on the inconsistent database copy on your server.
Perform Soft Recovery
You can run Soft Recovery on an inconsistent database to bring it back to the Clean Shutdown state and then mount it. The steps are as follows:
- Open Command Prompt as administrator.
- Type Eseutil and click Enter. If you see the output displaying EseUtil information, continue. Otherwise, use the cd command to navigate to the EseUtil location. For instance,
cd C:\Program Files\Microsoft\Exchange Server\Vxx\Bin\
- Execute the following command in the Command Prompt window to run Soft Recovery on the database.
Eseutil /r e01 /l “M:\DB01\logs” /d “M:\DB01\database”
Here e01 is the log file extension.
- After the repair, run the following command to check the database status:
Eseutil /mh PathToDatabaseFolder\Database.edb
- If the database is in the Clean Shutdown state, you can mount it using the Mount-Database cmdlet in EMS or EAC.
Perform Hard Recovery
If you have successfully restored the database from the backup but it fails to mount, you need to run Hard Recovery on the database to repair it.
The steps are as follows:
- Open elevated Command Prompt and find the restore.env file (located in the folder where the database is restored from the backup).
- Then execute the following command:
ESEUTIL /CC <PathToFolderContainingRestore.env>
ESEUTIL /CC C:\MyDBFolder\
Warning: Hard Recovery purges irrecoverable mail items and mailboxes from the damaged or corrupt Exchange database file (edb) and may lead to data loss. Always create a backup of your original database file before performing Hard Recovery.
- After the successful recovery, the “Operation completed successfully” message is displayed. First, check the database state by using the eseutil /mh command.
- If the state is Clean Shutdown, execute the following command on the database to defrag it and then take a database backup.
Eseutil /d <DatabasePath>
- Now you can mount the Exchange database via EAC or EMS cmdlet.
However, if both Soft Recovery and Hard Recovery fail to restore the database to Clean Shutdown state, you can create a new Exchange database and use an Exchange server recovery software, such as Stellar Repair for Exchange, to repair the inconsistent or corrupt database, extract mailboxes, and restore them to the newly created database.
The software can help you restore all mailboxes from an irrecoverable Exchange database in a few clicks with complete integrity and consistency. And there’s no risk of data loss.
It’s a fast, reliable, and convenient way of restoring user mailboxes from corrupt, inaccessible, or damaged Exchange database (.edb) files.
To Wrap Up
Exchange database mounts only when it’s in the Clean Shutdown state and log files are intact. If the transaction logs are missing, deleted, or non-contiguous, the database enters the Dirty Shutdown state and becomes inconsistent. When you restore the mailbox database from a backup, the restored database remains inconsistent. However, you can fix it by performing Hard Recovery using EseUtil. But if you don’t want to risk data loss, try Soft Recovery on the inconsistent or corrupt database. If that fails, use an Exchange recovery software to restore mailboxes from the inconsistent database to a new healthy database directly.