HP-UX Reference (11i v3 07/02) - 7 Device (Special) Files, 9 General Information, Index (vol 10)
s
scsi_disk(7) scsi_disk(7)
char ** argv;
{ int ret, fd; if (argc != 2) {
printf ("Usage: %s <disk_device> \n", argv[0]);
exit(1);
}
if ((fd = open (argv[1], O_RDWR)) < 0) {
exit (1);
}
Describe_ext(fd);
Describe (fd);
Exclusive (fd);
Enable_WOE (fd);
}
WARNINGS
Historically, disk devices have had small (typically 512 byte) block sizes; however, many newer disk devices
(such as optical disks and disk arrays) have relatively large block sizes. Applications using direct raw disk
access should use the DIOC_DESCRIBE
, DIOC_CAPACITY, DIOC_DESCRIBE_EXT,or
SIOC_CAPACITY ioctl to determine the appropriate minimum I/O size.
Media removal and insertion while a disk device is open is unsupported and unpredictable. Do not attempt
to circumvent prevention of media removal. Device capacity changes resulting from such intervention may
not be recognized.
Often larger I/O operation sizes are expected to be more efficient. However, SCSI disk I/O operations that
are large relative to the device’s cache can result in insufficient cache space for the device to maintain full-
media-speed data transfer rates. This can result in decreased I/O performance relative to smaller I/O sizes.
DEPENDENCIES
Optical Disk Devices
The SIOC_VERIFY_WRITES
ioctl controls the write mode. Normally written data is assumed to be
correctly stored on the media. Verify-writes mode causes verification of written data to ensure that data
has been correctly written. Verification can substantially reduce write performance and is not generally
needed.
The
SIOC_VERIFY_WRITES
ioctl can be used to enable or disable write verification. A zero value dis-
ables write verification. The value
1 enables write verification. Although write verification is primarily
intended for optical media, some systems may support write verification on normal disk devices.
The SIOC_VERIFY ioctl verifies that a media area contains valid data (that is, data that has been
correctly written). Verified media will not cause I/O errors when reading is attempted. The media area to
be verified is specified via the start_lba and block_cnt fields. Although verification is intended pri-
marily for optical media, some systems may support verify operations on normal disk devices.
The SIOC_WRITE_WOE ioctl controls the write mode used for magneto-optical disk devices. Normally
magneto-optical write operations require two physical head passes. The first pass erases the media area to
be written. The second pass actually writes the data. Write-without-erase mode dramatically increases
write performance by skipping the first (erase media area) pass. To ensure that the correct data results, it
is essential that write-without-erase operations be performed only on media that is known to be blank (pre-
viously erased or never used). The
SIOC_WRITE_WOE ioctl can be used to enable or disable write-
without-erase. A zero value disables write-without-erase. The value
1 enables write-without-erase.
The
SIOC_ERASE ioctl allows media areas to be explicitly erased. The media area to be erased is specified
via the start_lba and block_cnt fields. Media areas erased in this manner can be written using
write-without-erase mode. Note that an erased media area is different from a media area written with
some data values (e.g. zeros). An erased media area should not be read. Attempting to read an erased
media area generally results in an I/O error.
The SIOC_VERIFY_BLANK ioctl verifies that a media area has been erased and is suitable for being writ-
ten using write-without-erase mode. The media area to be verified is specified via the
start_lba and
block_cnt fields.
The following optical disk device specific information is included from <sys/scsi.h> :
#define SIOC_WRITE_WOE _IOW(’S’, 17, int)
#define SIOC_VERIFY_WRITES _IOW(’S’, 18, int)
#define SIOC_ERASE _IOW(’S’, 19, struct scsi_erase)
166 Hewlett-Packard Company − 3 − HP-UX 11i Version 3: February 2007