SQL SERVER – The Operating System Returned the Error 21(The Device is Not Ready.) While Attempting ‘GetDiskFreeSpace’ on ‘A:\’

I always try to keep myself up-to-date with new released of SQL Server. This blog is part of my learning, while using SQL Server 2017, which I always share with my blog readers. This is the error related to Error 21 about a device not ready.

Note: I am using the pre – release version of SQL Server 2017, so information might change in future.

I was looking at ERRORLOG of SQL Server 2017 instance and found below the message, which I have not seen earlier.

2017-09-19 01:28:28.490 spid52 The operating system returned the error ’21(The device is not ready.)’ while attempting ‘GetDiskFreeSpace’ on ‘A:\’.

The error was clear that it was trying to get information from A drive on this machine (which is a floppy drive)

Floppy Disk Drive (A:).

While looking further, I figured out that this was caused due to new DMV

Later I realized that it happened when I was using Restore Database in SSMS and looks like that time the DMV was fired. I was able to confirm that using profiler and launching the UI again.

SQL Server error 21 'The device is not ready' on a fixed drive.

To double check, I also ran the same DMV manually and I can see that again but not as an error message but as an informational message.

To reproduce, you can run below command on SQL Server 2017.

Select * from sys.dm_os_enumerate_fixed_drives

If your machine has a DVD drive, then you may also get

2017-09-20 14:47:24.380 spid58 The operating system returned the error ’21(The device is not ready.)’ while attempting ‘GetDiskFreeSpace’ on ‘D:\’.

The only difference is the drive letter.

Based on above, I think we can safely ignore this error message in the SQL Server ERRORLOG.

Published by Pinal Dave on SQLAuthority. More of my work at pinaldave.com.


Discover more from SQL Authority with Pinal Dave

Subscribe to get the latest posts sent to your email.

SQL Error Messages, SQL Scripts, SQL Server
Previous Post
SQL SERVER – New DMV in SQL Server 2017 – sys.dm_os_enumerate_fixed_drives. A Replacement of xp_fixeddrives
Next Post
SQL SERVER – Simple Explanation of AT TIME ZONE Feature

Related Posts

Leave a Reply

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

Fill out this field
Fill out this field
Please enter a valid email address.