When a LUN is presented from a SAN to Windows Server 2008, the following error may pop up and Event ID: 10 may be logged in the Event log when trying to use the disk for the first time.
“The Media is Write Protected
System Event Log:
Log Name: System
Source: Virtual Disk Service
Event ID: 10
Task Category: None
VDS fails to write boot code on a disk during clean operation. Error code:
In Windows Server 2008 there is a policy new to Windows related to SAN disks. This “SAN policy” determines whether a newly discovered disk is brought online or remains offline, and whether it is made read/write or remains read-only.
On Windows Server 2008 Enterprise and Windows Server 2008 Datacenter, the default SAN policy is VDS_SP_OFFLINE_SHARED. On all other Windows Server 2008 editions, the default SAN policy is VDS_SP_ONLINE.
VDS_SP_ONLINE: All newly discovered disks are brought online and made read-write.
VDS_SP_OFFLINE_SHARED: All newly discovered disks that do not reside on a shared bus are brought online and made read-write.
VDS_SP_OFFLINE: All newly discovered disks remain offline and read-only.
If the policy is such that newly discovered disks are set to offline and readonly, then the administrator can use DiskPart at the command line or Diskmanagement from Server Manager\storage to prepare the disks for use.
When using the diskmanagement snap in to Online a disk, the new disk will be set to online and read-write. When using DiskPart, only those flags you specify will be changed. Thus if you issue the command to bring a disk online, it will only be put into online state. You must issue a separate command to make the disk read/write. In this way, Diskpart allows you to have finer control than Disk Management.
Using diskpart to online a disk does not change the read only attribute. This needs to be done manually using the following steps:
1. Run DiskPart
2. List and select the disk that needs to be made available.
SELECT DISK )
3. If the disk is offline, bring it online by running ONLINE DISK
4. View the attributes by running DETAIL DISK
The command DETAIL DISK may give an output similar to the following
DISKPART> detail disk
Disk ID: ########
Bus : #
Target : #
LUN ID : #
Read-only : Yes
Boot Disk : No
Pagefile Disk : No
Hibernation File Disk : No
Crashdump Disk : No
5. To clear the read only flag, run ATTRIBUTE DISK CLEAR READONLY
6. Exit DiskPart
You should now be able to write to the disk.