Clandestine Development Guides and utilities for sysadmins

Media is write protected

Posted 12. April 2010 14:23 in Support

I ran into a problem a while back with a testserver. It used Windows 2008 and a cheap Promise RAID controller for it's data drive (4 SATA disks, RAID 5). After rebooting the server, I was suddenly unable to write or modify any files on the data drive, but I was able to read and copy all files to the system drive. I constantly got the error message "media is write protected".

Apparently it's a problem in a SAN policy in Windows, that resets the readonly attribute of the disk. Microsoft states that it is a SAN only problem, but it also seems to apply to SATA drives (or the cheap RAID controller).

To fix this, use DiskPart to clear the readonly attribute on the faulty disk.

Run "DiskPart" from a command prompt. Then type:

  • SELECT DISK <number>
  • If the disk is offline, then type: ONLINE DISK
  • DETAIL DISK (note: ignore the read only attribute here, it's probably wrong).
  • EXIT

    You should now be able to write or modify files on the disk again. The operation won't harm any files on your drive. For more information take a look at the Microsoft knowledgebase article on the problem.