SG_READCAP(8)

NAME
sg_readcap - calls a READ CAPACITY command on a SCSI device

SYNOPSIS
sg_readcap [-lba=<block>] [-pmi] [-V] <device>

DESCRIPTION

The normal usage is to find the number of blocks (and block size) of the given device and output them.

-lba=<block>
    used in conjunction with "-pmi" option. This variant of READ CAPACITY will yield the last block address after "<block>" prior to a delay. For a disk, given a "<block>" address it yields the highest numbered block on the same cylinder (i.e. before the heads need to move). "<block>" is in hex (from 0 to ffffffff) and defaults to zero.

-pmi
    partial medium indicator: for finding the next block address prior to some delay (e.g. head movement). In the absence of this switch, the total number of blocks and the block size of the device are output.

-V  outputs version string then exits.

In the 2.4 series of Linux kernels the given device must be a SCSI generic (sg) device. In the 2.6 series block devices (e.g. disks and SCSI DVDs) can also be specified. For example "sg_readcap /dev/sda" will work in the 2.6 series kernels.

AUTHORS
Written by Douglas Gilbert

COPYRIGHT
Copyright © 1999-2003 Douglas Gilbert
This software is distributed under the GPL version 2. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.