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)
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.
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.
Reference: Pinal Dave (https://blog.sqlauthority.com)
First appeared on SQL SERVER – The Operating System Returned the Error 21(The Device is Not Ready.) While Attempting ‘GetDiskFreeSpace’ on ‘A:\’