Purpose
This IOCtl may be used with any logical volume to which a drive letter has been assigned. This function will be used by FORMAT and will also be of use to those writing disk utilities for OS/2.
Parameter Packet Format
Field Length C Datatype Command Information BYTE UCHAR Drive Unit BYTE UCHAR Table Number WORD USHORT LSN 4 BYTES ULONG
Command Information
The Identify Volume Type command provides a way to determine whether a volume is a Compatibility or LVM Volume.
The Enable Bad Block Relocation command enables bad block relocation on the specified volume if that volume supports it.
The Disable Bad Block Relocation command disables bad block relocation on the specified volume.
Get Bad Block Information returns the total number of bad block relocations which are currently in effect for the specified volume, as well as the number of relocation tables being used to perform bad block relocation for the specified volume. There is one bad block relocation table per physical disk partition, so, for LVM volumes employing drive linking, there may be several such tables.
Get Table Size returns the number of active entries in the specified bad block relocation table, as well as the maximum number of entries that the table can hold. The size of a bad block relocation table is dependent upon the size of the partition it is supporting. Larger partitions have larger relocation tables, while smaller partitions have smaller relocation tables.
Get Relocated Sector List returns an array of Logical Sector Numbers (LSN). Each LSN in the array is a sector whose data had to be relocated because of a problem writing to that sector. The array returned is specific to a Relocation Table. The user supplied buffer must be large enough to hold the entire array. The size of the array can be determined by using the Get Table Size command to find the number of active entries in the table, and then multiplying that value by the size of a Logical Sector Number (currently, 4 bytes).
Get Relocated Data returns the data associated with a sector that appears in a relocation table for the specified volume. The user supplied buffer must be at least 512 bytes in length, because 512 bytes are returned.
Remove Relocation Table Entry removes the specified LSN from the relocation tables on the specified volume. This function is typically used by utilities which adjust the file system on a volume so that all LSNs requiring relocation are removed from use. Since the file system will never use these LSNs again, they can be safely removed from the relocation tables for the volume, thereby freeing those entries to be used again.
Clear Relocation Table is used to remove all of the entries in a relocation table in a single operation. This function is intended to be used by FORMAT immediately before a long format is performed. Typically, FORMAT will disable bad block relocation and clear the bad block relocation tables prior to a long format so that all bad sectors may be detected by FORMAT. FORMAT will place any bad sectors detected into the bad block list for the appropriate file system.
Get Drive Name is used to return the user defined name associated with the physical drive on which the specified relocation table resides. This function can be used to identify which physical drive contains a specific relocation table associated with a volume. The name returned will not exceed 20 characters.
Data Packet Format
Field Length C DatatypeReturn Value BYTE UCHAR Buffer 4 BYTEs void*
Return Value
Command Information Return Value Buffer0 1 = Compatibility V Unused 2 = Logical Volume 1 0 = Success Unused 1 = Failure 2 0 = Success Unused 1 = Failure 3 0 = Success typedef struct_BadBlockInf 1 = Failure ULONG Total_Relocations; ULONG Total_Tables; }BadBlockInfo; 4 0 = Success typedef struct_BadBlackInf 1 = Failure ULONG Active_Relocations; ULONG Max_Relocations; }BadBlockTableInfo; 5 0 = Success Array of LSNs. 1 = Failure Each entry in array is sector requiring relocatio 6 0 = Success Data written to 1 = Failure specified sector 7 0 = Success Unused 1 = Failure 8 0 = Success Unused 1 = Failure 9 0 = Success Text of name being 1 = Failure returned by this function. Name will be null terminat
Returns
Possible values are shown in the following list
15