REASSIGN BLOCKS Command Peripheral Device Type: Direct Access and Write-Once Read-Multiple Operation Code Type: Optional REASSIGN BLOCKS Command ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 | Operation Code (07h) | -----|-----------------------------------------------------------------------| 1 | Logical Unit Number | Reserved | -----|-----------------------------------------------------------------------| 2 | Reserved | -----|-----------------------------------------------------------------------| 3 | Reserved | -----|-----------------------------------------------------------------------| 4 | Reserved | -----|-----------------------------------------------------------------------| 5 | Vendor Unique | Reserved | Flag | Link | ============================================================================== The REASSIGN BLOCKS command (Table 8-8) requests the target to reassign the defective logical blocks to an area on the logical unit reserved for this purpose. The initiator transfers a defect list that contains the logical block addresses to be reassigned. The target shall reassign the physical medium used for each logical block address in the list. The data contained in the logical blocks specified in the defect list may be altered, but the data in all other logical blocks on the medium shall be preserved. The effect of specifying a logical block to be reassigned that previously has been reassigned is to reassign the block again. Thus, over the life of the medium, a logical block can be assign to multiple physical addresses (until no more spare locations remain on the medium). The REASSIGN BLOCKS defect list (Table 8-9) contains a four-byte header followed by one or more defect descriptors. The length of each defect descriptor is four bytes. The defect list length specifies the total length in bytes of the defect descriptors that follow. The defect list length is equal to four times the number of defect descriptors. NOTE: This command does not alter the location or contents of the P list (see FORMAT UNIT command). .pa REASSIGN BLOCKS Defect List ============================================================================== Byte | Defect List Header | ============================================================================== 0 | Reserved | -----|-----------------------------------------------------------------------| 1 | Reserved | -----|-----------------------------------------------------------------------| 2 | (MSB) | -----|--- Defect List Length ---| 3 | (LSB) | ============================================================================== | Defect Descriptor(s) | ============================================================================== 0 | (MSB) | -----|--- ---| 1 | | -----|--- Defect Logical Block Address ---| 2 | | -----|--- ---| 3 | (LSB) | ============================================================================== The defect descriptor specifies a four-byte defect logical block address that contains the defect. The defect descriptors shall be in ascending order. MODIFIED MOVE HERE FROM BELOW: More than one physical or logical block may be relocated by each defect descriptor in this command. If the logical unit is unable to successfully complete a REASSIGN BLOCKS command, the command shall terminate with a CHECK CONDITION status with the appropriate sense information. The logical block address of the first DELETE: logical block ADD: defect descriptor not reassigned shall be returned in the Command-Specific Information Bytes of the sense data. If no information about the first unreassigned defect descriptor is available, these bytes shall be set to FFFFFFFFh. If the logical unit has insufficient capacity to reassign all of the DELETE: defective logical blocks, ADD: defect descriptors, the command shall terminate with a CHECK CONDITION status and the sense key shall be set to DELETE: MEDIUM ERROR. ADD: HARDWARE ERROR with proper Additional Sense Code indicating lack of sufficient spare space. DELETE: The logical block address of the first logical block not reassigned shall be returned in the information bytes of the sense data. [There is still some question over whether the above paragraph is completely superseded by the following two paragraphs:] If the REASSIGN BLOCKS command terminated due to an unexpected unrecoverable read error DELETE: in another block that would cause the loss of data in a block not specified in the defect list, the logical block address of the first unrecoverable block shall be returned in the Information Bytes of the sense data and the valid bit shall be set to one. [covered in REQUEST SENSE] .pa DELETE: IMPLEMENTORS NOTES: If an unrecoverable error on a logical block other than those in the current defect list is returned, the initiator should add that logical block to its defect list, delete all defect descriptors prior to the one returned in the command-specific information bytes and reissue the REASSIGN BLOCKS command with the new defect list. ADD: IMPLEMENTORS NOTE: If a REASSIGN BLOCKS command terminates with CHECK CONDITION and the Command Specific Information Bytes contain a valid logical block address, the Initiator should delete all defect descriptors from the defect list prior to the one returned in the Command Specific Information Bytes and reissue the REASSIGN BLOCKS command with the new defect list after any corrective action indicated by the rest of the sense information. Additionally if the sense key is MEDIUM ERROR and the Information Bytes contain a valid logical block address (valid bit set), the Initiator should insert that new defective logical block address into the defect list and reissue the REASSIGN BLOCKS command with the new defect list. If a logical unit processes more than one defect descriptors concurrently (such as multiple spare sectors in a zone), the logical unit shall retain such information as required to ensure that the above Initiator algorithm reassigns all specified defect descriptor. The logical unit may cause unnecessary media area to be reassigned to fulfill this requirement. MODIFED AND MOVED ABOVE FROM HERE: More than one physical or logical block may be relocated by this command.