#include <linux/hdreg.h> /* HDIO_GETGEO용 */
#include <linux/fs.h> /* BLKGETSIZE 및 BLKRRPART용 */
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 partition_number is as follows:
- •
- 파티션 0은 모든 드라이브이다.
- •
- 파티션 1에서 4는 도스"프라이머리"파티션이다.
- •
- 파티션 5에서 8은 도스 "확장(혹은 "논리")" 파티션이다.
예를 들면, /dev/sda 는 메이저 8과, 마이너 0을 갖게되고, 시스템의 모든 스카시드라이브와 관련될 것이다; 그리고 /dev/sdb3 는 메이저 8과 마이너 19를 갖게되고, 시스템의 두번째 스카시 드라이브상의 세번째 도스"프라이머리"파티션과 관련될 것이다.
이때, 블록 장치가 제공된다. Raw장치는 아직 구현되지 않았다.
iotcls는 아래와 같이 제공된다:
- HDIO_GETGEO
- 는 아래 구조인 바이오스 디스크 매개변수를 반환한다:
struct hd_geometry {
unsigned char heads;
unsigned char sectors;
unsigned short cylinders;
unsigned long start;
};
- 이 구조에서 포인터는 ioctl(2)EN 매개변수에 의해 전달된다.
- 매개변수의 정보는 디스크 도스에 의해 이해되는 드라이브의 디스크구성도이다. 이 구성도는 드라이브의 물리적인 구성도는 아니다. 그것은 드라이버의 파티션 테이블을 구성할때 사용되지만, fdisk(1), efdisk(1), 및 lilo(1) 의 용이한 실행을 위해 필요하다. 구성도 정보가 유효하지 않다면, 모든 매개변수를 위해 0이 반환될 것이다.
- BLKGETSIZE
- 섹터의 장치크기를 반환한다. ioctl(2)EN 매개변수는 long을 포인터한다.
- BLKRRPART
- 스카시디스크 파티션 테이블의 다시읽기를 강제한다. 어떤 매개변수도 필요하지 않다.
- The SCSI ioctl(2)EN operations are also supported. If the ioctl(2)EN parameter is required, and it is NULL, then ioctl(2)EN fails with the error EINVAL.
- /dev/sd[a-h]
- 모든 장치
- /dev/sd[a-h][0-8]
- 개별 블록 파티션