HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlMinor

Enumerate drives available to SQL Server

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
availablesqldrivesserverenumerate

Problem

I'm trying to work out a way of listing the drives that a particular instance of SQL Server is "aware" of, and understand the process.

I can run EXEC master..xp_fixeddrives which gives me a list of drives, but when I look in the GUI (Eg. Databases | Restore Database | From device | Add ) the list of available drives is far fewer.

By what process does SQL server become "aware" of a drive and is there any way to problematically determine the drives it is aware of?

Thanks in advance!

Solution

I'm guessing you're actually running on a clustered instance.

EXEC master..xp_fixeddrives is returning all the drives that the underlying OS is aware of, so a lot aren't available to your cluster instance

use:

SELECT * FROM sys.dm_io_cluster_shared_drives


instead, which will just list the ones available to your instance

Code Snippets

SELECT * FROM sys.dm_io_cluster_shared_drives

Context

StackExchange Database Administrators Q#25796, answer score: 4

Revisions (0)

No revisions yet.