SQL Server Error 5184: Cannot use file ‘I:\Path\Techyaz.mdf’ for clustered server

Today, one of my team mate was trying to attach a database on one of the clustered SQL Server instance. He got error 5184 while attaching the database. The details about error 5184 is given below.

Msg 5184, Level 16, State 2, Line 1
Cannot use file ‘I:\Path\Techyaz.mdf’ for clustered server.
Only formatted files on which the cluster resource of the server has a dependency can be used. Either the disk resource containing the file is not present in the cluster group or the cluster resource of the Sql Server does not have a dependency on it.

Msg 1802, Level 16, State 1, Line 1
CREATE DATABASE failed. Some file names listed could not be created. Check related errors.

While troubleshooting this error we came to know that the storage or LUN on which we have placed the database files are not added to cluster group. It means disk is not visible in failover cluster manager.

Solution – Error 5184

We performed below steps to fix this issue.

  1. Added the storage on which databases files are placed as shared storage in the failover cluster manager.
  2. Launch SQL Server properties window in Failover Cluster Manager.
  3. Added all newly added disks in Dependencies tab.
  4. Attached the database again.

Here i will explain above steps in detail with screenshots.

  • We were attaching a database using T-SQL statement on one of the SQL Server cluster instance. While executing the command we get error 5184. Error details are given in below screenshot.

Fix SQL Server Error 5184

  • As error suggests that “Either the disk resource containing the file is not present in the cluster group” so I checked cluster group for the disk and found that database files storage was not showing in failover cluster manager.
  • Next step was to add these storage disks to the cluster group. Launch failover cluster manager. Click at Roles tab from left side pane. You can see SQL Server as role in right side pane. Right click at the SQL Server role and click at “Add Storage” option. You can see this in below screenshot.

Add Storage to Cluster group

  • Once you will click at “Add Storage” option you will get below window to add the identified disks to cluster group. You can see I have selected all required disks in below screenshot. You can choose your disks where your database files are placed.

Add Storage to cluster group

  • Once you click at OK button post selecting all respective check boxes in above step, you will see all your storage disks in failover cluster manager under storage tab.
  • Now again click at the SQL Server role and then go to “Resources” tab from down side pane where you can see SQL Server and all resources that are aligned for the SQL Server role. Here, right click at SQL Server and click at Properties tab as shown in below screenshot.

Add Disk Dependencies in FCM

  • Once you get SQL Server properties windows in failover cluster manager, next you should click at dependencies tab. Here, you need to insert one row for each disk system that you have added in above steps. Once you will insert dependencies for all newly added disks then it will look like below screenshot. Now click at OK button to apply this change.

Add Disk Dependencies in FCM

  • Now again go to SQL Server query window and run the T-SQL command to  attach the database. This time you will successfully attach the database to the clustered SQL Server instance.

Let me know if this article helped you to fix your issue. You can follow our facebook page and Twitter handle to get latest updates.

Read More:

Manvendra Deo Singh
Follow me:

Manvendra Deo Singh

I am working as a Technical Architect in one of the top IT consulting firm. I have expertise on all versions of SQL Server since SQL Server 2000. I have lead multiple SQL Server projects like consolidation, upgrades, migrations, HA & DR. I love to share my knowledge. You can contact me on my social accounts for any consulting work.
Manvendra Deo Singh
Follow me:

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *