Question: I have one master and one detail table as following

```
Master:-
   BatchID
   BatchStatus
Detail
   DetailID
   BatchID
   DetailRecordStatus (Possible values 1,2,3)

```

I am trying to write a single a query that can update the Batch Status in Master based on `detailRecordStatus` values equal to 2 or 3

Answer: 
I think I've found the cause. 

Most likely the problem is due to ["Fast startup" power options](https://msdn.microsoft.com/en-us/library/windows/hardware/ff547781(v=vs.85).aspx).

[![Fast Startup](https://i.stack.imgur.com/MuuPS.png)](https://i.stack.imgur.com/MuuPS.png)

It'a a Windows technique to reduce the boot time; Fast Startup combines elements of a [cold shutdown and the hibernate feature](https://msdn.microsoft.com/en-us/library/windows/hardware/jj835779(v=vs.85).aspx).

Here you can find another [article](https://www.howtogeek.com/243901/the-pros-and-cons-of-windows-10s-fast-startup-mode/) about pros and cons

I have disabled it and the problem seems to be resolved.
This problem has irritated me as well. I have 5 dbs hooked onto my SQL Server instance, 3 of which are working fine, but 2 of which complains 

*The operating system returned error 21(The device is not ready.) to SQL Server during a read at offset 0x00000000204000 in file 'E:\xxxxxxxx.mdf'*

Here is my solution.

1. Turn on **Services.msc**, locate the service called **SQL Server (instance name)**, right click and **restart** it.
2. Go back to ssms, refresh your db, and things should work.

On a side note, I did try taking db offline/online method. It did not work in my case. Brute force restarting the sqlserver service worked nicely. this might be a problem for those whose stake of taking all dbs offline are too high. However, if you're just doing local development like me, then this solution should be fine.