operating system returned error 21

  • Hi Folks,

    Anyone seen this type of error below? The database appeared to be okay no user complaints, the error only arose when I tried to access the replication tools (this is the publisher with 3 subscribers). It is installed on a virtual environment. Rebooting the server fixes the problem but it appears to be a recurring problem. The path is odd (highlighted below) as it is installed on C:\ but somehow references the VM URL? Do I need to do a registry hack somewhere to tell it where SQL lives?

    Thanks in advance for any advice,

    Peter

    The operating system returned error 21(failed to retrieve text for this error. Reason: 15105) to SQL Server during a read at offset 0x00000074690000 in file '\\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy9\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\mydata.MDF'. Additional messages in the SQL Server error log and system event log may provide more detail. This is a severe system-level error condition that threatens database integrity and must be corrected immediately. Complete a full database consistency check (DBCC CHECKDB). This error can be caused by many factors; for more information, see SQL Server Books Online. (.Net SqlClient Data Provider)

  • Peter

    Whenever you get an operating system error like that, go to a command prompt and type (for example) [font="Courier New"]net helpmsg 21[/font]. That will tell you what the message means. In this case, it's "The device is not ready".

    John

  • Thanks John great tip!

    I suspected the drive or path was not found but how to fix? my gut reaction is to change the URL to the drive letter that it lives one but I don't know if that's possible or even a solution.

  • Peter

    I don't know what's going on here. If you do [font="Courier New"]SELECT * FROM sys.master_files[/font], do all the file paths show as drive letters? If so, something is translating them into a UNC. Maybe your VM admin can help?

    John

  • The first 18 rows including my db show E:\program files\Microsoft SQL Server\MSSQL_10_50.MSSQL...

    Then the rest show this URL \\?\GLOBALROOT\Device... most of which is referring to my db.

    I restored the db from a backup.

  • Probably best to use ALTER DATABASE to change those file paths to drive letters, then. Make sure you have backups first.

    John

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply