sdのヘルプ・マニュアル
日本語 英語
sd --help
man sd
SD(4) Linux Programmer’s Manual SD(4)
名前
sd - SCSI ディスクドライブのためのドライバ
書式
#include /* for HDIO_GETGEO */
#include /* for BLKGETSIZE and BLKRRPART */
設定
こ の ブ ロ ックデバイス (block device) の名前は、次のような形式をとる:
sdlp, このうち、 l は物理ドライブを意味する文字であり、 p はその物理 ド
ライブ上のパーティション (partition) を意味する数字である。パーティショ
ンナンバー p がない場合は、そのデバイスファイルはドライブ全体をさす。
SCSI ディスクはメジャーナンバー 8 を持ち、次のような形式のマイナーナ ン
バ ー を持つ。(16 * drive_number) + partition_number、この drive_number
は検出された物理ドライブの番号であり、 partition_number は次のように な
る:
パーティション 0 はドライブ全体
パーティション 1 〜 4 は DOS の "基本 (primary)" パーティション
パーティション 5 〜 8 は DOS の "拡張 (extended)" (または、"論理 (logi-
cal)") パーティション。
例えば、 /dev/sda はメジャーナンバー 8 マイナーナンバー 0 を持ち、シ ス
テムの最初の SCSI ドライブ全体を参照する。そして、 /dev/sdb3 はメジャー
ナンバー 8 マイナーナンバー 19 を持ち、システムの二つ目の SCSI ドライブ
の三番目の DOS "基本" パーティションを参照する。
現 在 は 、 ブ ロ ックデバイスだけが提供されている。ロー・デバイス (raw
device) はまだ実装されていない。
説明
次の ioctl が提供されている:
HDIO_GETGEO
次のような構造体を用いて BIOS のディスクパラメータを返す:
struct hd_geometry {
unsigned char heads;
unsigned char sectors;
unsigned short cylinders;
unsigned long start;
};
この構造体へのポインタが ioctl(2) へのパラメータとして渡される。
こ のパラメータに入れられて返される情報は、 DOS によって理解され
るようなドライブのジオメトリである。このジオメトリは、ドライブの
物 理的なジオメトリ ではない。この情報はドライブのパーティション
テーブルを作成する時に用いられる、また 、 fdisk(1), efdisk(1),
lilo(1) の適切な操作に必要である。もし、ジオメトリの情報が得られ
なければ、それぞれの値全てにゼロが入れられて返される。
BLKGETSIZE
セクタの数で表したデバイスのサイズが返される。 ioctl(2) のパラメ
ータは、 long へのポインタでなければならない。
BLKRRPART
強 制的に、SCSI ディスクのパーティションテーブルの再読み込みを行
う。パラメータは必要ない。
scsi(4) の ioctl(2) 操作も同様にサポートされる。 ioctl(2) のパラ
メータが必要で、それが NULL ならば、 ioctl(2) はエラー EINVAL で
失敗する。
ファイル
/dev/sd[a-h]: ドライブ全体
/dev/sd[a-h][0-8]: 個々のブロックパーティション
Linux 1992-12-17 SD(4)
SD(4) Linux Programmer’s Manual SD(4)
NAME
sd - Driver for SCSI Disk Drives
SYNOPSIS
#include /* for HDIO_GETGEO */
#include /* for BLKGETSIZE and BLKRRPART */
CONFIGURATION
The block device name has the following form: sdlp, where l is a letter
denoting the physical drive, and p is a number denoting the partition
on that physical drive. Often, the partition number, p, will be left
off when the device corresponds to the whole drive.
SCSI disks have a major device number of 8, and a minor device number
of the form (16 * drive_number) + partition_number, where drive_number
is the number of the physical drive in order of detection, and parti-
tion_number is as follows:
partition 0 is the whole drive
partitions 1-4 are the DOS "primary" partitions
partitions 5-8 are the DOS "extended" (or "logical") partitions
For example, /dev/sda will have major 8, minor 0, and will refer to all
of the first SCSI drive in the system; and /dev/sdb3 will have major 8,
minor 19, and will refer to the third DOS "primary" partition on the
second SCSI drive in the system.
At this time, only block devices are provided. Raw devices have not
yet been implemented.
DESCRIPTION
The following ioctls are provided:
HDIO_GETGEO
Returns the BIOS disk parameters in the following structure:
struct hd_geometry {
unsigned char heads;
unsigned char sectors;
unsigned short cylinders;
unsigned long start;
};
A pointer to this structure is passed as the ioctl(2) parameter.
The information returned in the parameter is the disk geometry
of the drive as understood by DOS! This geometry is not the
physical geometry of the drive. It is used when constructing
the drive’s partition table, however, and is needed for conve-
nient operation of fdisk(1), efdisk(1), and lilo(1). If the
geometry information is not available, zero will be returned for
all of the parameters.
BLKGETSIZE
Returns the device size in sectors. The ioctl(2) parameter
should be a pointer to a long.
BLKRRPART
Forces a re-read of the SCSI disk partition tables. No parame-
ter is needed.
The scsi and ioctl(2) operations are also supported. If the
ioctl(2) parameter is required, and it is NULL, then ioctl(2)
will fail with the error EINVAL.
FILES
/dev/sd[a-h]: the whole device
/dev/sd[a-h][0-8]: individual block partitions
COLOPHON
This page is part of release 3.22 of the Linux man-pages project. A
description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
Linux 1992-12-17 SD(4)