The operating system returned error 21(The device is not ready.) to SQL Server during a read at offset.. RRS feed

  • Question

  • Just started to get this error. Anyone know how to fix this?

    "The operating system returned error 21(The device is not ready.) to SQL Server during a read at offset 0x000000000e8000 in file '...\accessreports.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."

    nothing for members to see
    • Moved by Kris Wagner - MVP Friday, August 12, 2011 1:37 AM Moved to SQL Forums.. Mod please move to correct area. (From:SharePoint 2010 - General Questions and Answers)
    • Edited by cecilita Friday, August 12, 2011 3:19 PM misspelling corrected
    Thursday, August 11, 2011 7:32 PM

All replies

  • Could be a bunch of things as 21 is a really generic system error code, not a SQL error , it literally is "Device not ready" but usually can be down to a disk not being readable or reachable, or any disk sector not being readable.  That can be caused by full disks, full tempdb for example, firmware for disk controllers needing an update etc etc,

    Get your DBA to runxp_ReadErrorLog to try an narrow it down

    Regards John Timney
    Thursday, August 11, 2011 10:48 PM
  • From what I know of this error it does not look good.  I would be checking my backups and see if there are some disks which have errors on them, you might want to read over this post.


    Good luck,




    Gary Newman MCSE, MCT, CCNA MCDBA, MCAD, MCSA MCTS SharePoint 2007 Dev & Admin MCPD SharePoint 2010 Development My Blog
    Thursday, August 11, 2011 11:44 PM
  • will restoring the 'accessreports.mdf'' work?

    nothing for members to see
    Friday, August 12, 2011 3:20 PM
  • It depends on how long you have been getting the error, and if your backups go back far enough to the point where that file wasn't corrupted, but that's even assuming it is a DB error passed suggesting a corruption and not a hardware error.  So it also critically depends on whether you do or do not have a disk failure as you might be wasting your time without fixing the root cause but it would likely do little harm if you did restore it.
    Regards John Timney
    Friday, August 12, 2011 9:48 PM
  • This error will occur, when the service account doesn't have access onto the file location for MDF/LDF. Usually this happens, when we detach a DB and attach the same DB files from a different folder.

    Thursday, September 3, 2015 9:29 AM
  • Hi,

    Dear All I faced the similar problem today morning. In my case I just extended my storage capacity in which the database instance is residing from that point onwards those instances were developers working unfortunately got corrupted @ first i just did the DB restore it works for that particular instance. Tested the other instances dint work. I suggested the team ,I would do a restart to the server. When I do the restart all the Instances is Up and running . For God sake don't do the below step for this corrupted my database.

    alter database [database name] set offline

    ...wait a few seconds...

    alter database [database name] set online 

    Sunday, January 31, 2016 1:20 PM
  • Hi

    I had the same problem and doing below steps solved my problem: 

    1- Copy database files to another location

    2- Delete main files

    3- Restart SQL Service.

    4- In management studio the database will be shown with "Recovery Pending" in front of its name, delete it.

    5- Attach your database with copied files of the first step.

    • Proposed as answer by MuraliB91Dev Friday, June 15, 2018 9:13 AM
    Tuesday, June 21, 2016 7:24 AM
  • Perfect!!! Thanks

    Wednesday, March 21, 2018 3:06 PM
  • Did it work for you finally?
    Saturday, May 19, 2018 11:03 AM
  • I Had the same problem.

    Since i have the multiple customer databases on single SQL server rather than restart i have followed below process.

    1. Copy the DB files to some other location of Problematic DB. (it will allow to copy).
    2. Use this copied files to attach with different database name.(Lets say Test db)
    3. Take backup of Test Db.
    4. Restore Test DB backup with overwrite and replace on Problematic DB.
    5. Now Problematic DB will come to online.
    Friday, July 6, 2018 9:27 AM
  • Hi,

    If your on Windows 8+ it's because of windows fast start.

    If your on a Server Edition, then see other peoples answer. (serious issue)

    Tuesday, November 12, 2019 1:53 PM