2 .\" Copyright 1992 Rickard E. Faith (faith@cs.unc.edu)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date. The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein. The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
24 .\" Japanese Version Copyright (c) 1996,1997 ISHIKAWA Mutsumi
25 .\" all rights reserved.
26 .\" Translated 1997-02-06, ISHIKAWA Mutsumi <ishikawa@linux.or.jp>
27 .\" Updated 2005-11-19, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
29 .\" WORD: pointer ¥Ý¥¤¥ó¥¿
30 .\" WORD: structure ¹½Â¤ÂÎ
31 .\" WORD: geometry ¥¸¥ª¥á¥È¥ê
32 .\" WORD: sector ¥»¥¯¥¿
33 .\" WORD: implement ¼ÂÁõ
34 .\" WORD: raw device ¥í¡¼¥Ç¥Ð¥¤¥¹
36 .TH SD 4 1992-12-17 "Linux" "Linux Programmer's Manual"
39 .\"O sd \- Driver for SCSI Disk Drives
40 sd \- SCSI ¥Ç¥£¥¹¥¯¥É¥é¥¤¥Ö¤Î¤¿¤á¤Î¥É¥é¥¤¥Ð
44 .BR "#include <linux/hdreg.h> " "/* for HDIO_GETGEO */"
45 .BR "#include <linux/fs.h> " "/* for BLKGETSIZE and BLKRRPART */"
47 .\"O .SH CONFIGURATION
49 .\"O The block device name has the following form:
53 .\"O is a letter denoting the physical drive, and
55 .\"O is a number denoting the partition on that physical drive.
56 .\"O Often, the partition number,
58 .\"O will be left off when the device corresponds to the whole drive.
59 ¤³¤Î¥Ö¥í¥Ã¥¯¥Ç¥Ð¥¤¥¹ (block device) ¤Î̾Á°¤Ï¡¢¼¡¤Î¤è¤¦¤Ê·Á¼°¤ò¤È¤ë:
63 ¤ÏʪÍý¥É¥é¥¤¥Ö¤ò°ÕÌ£¤¹¤ëʸ»ú¤Ç¤¢¤ê¡¢
65 ¤Ï¤½¤ÎʪÍý¥É¥é¥¤¥Ö¾å¤Î¥Ñ¡¼¥Æ¥£¥·¥ç¥ó (partition) ¤ò°ÕÌ£¤¹¤ë¿ô»ú¤Ç¤¢¤ë¡£
66 ¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¥Ê¥ó¥Ð¡¼
68 ¤¬¤Ê¤¤¾ì¹ç¤Ï¡¢¤½¤Î¥Ç¥Ð¥¤¥¹¥Õ¥¡¥¤¥ë¤Ï¥É¥é¥¤¥ÖÁ´ÂΤò¤µ¤¹¡£
70 .\"O SCSI disks have a major device number of 8, and a minor device number of
72 .\"O .IR drive_number ") + " partition_number ,
75 .\"O is the number of the physical drive in order of detection, and
76 .\"O .I partition_number
78 SCSI ¥Ç¥£¥¹¥¯¤Ï¥á¥¸¥ã¡¼¥Ê¥ó¥Ð¡¼ 8 ¤ò»ý¤Á¡¢¼¡¤Î¤è¤¦¤Ê·Á¼°¤Î¥Þ¥¤¥Ê¡¼¥Ê¥ó¥Ð¡¼
80 .IR drive_number ") + " partition_number ¡¢
83 ¤Ï¸¡½Ð¤µ¤ì¤¿ÊªÍý¥É¥é¥¤¥Ö¤ÎÈÖ¹æ¤Ç¤¢¤ê¡¢
87 .\"O partition 0 is the whole drive
89 .\"O partitions 1-4 are the DOS "primary" partitions
91 .\"O partitions 5-8 are the DOS "extended" (or "logical") partitions
92 ¥Ñ¡¼¥Æ¥£¥·¥ç¥ó 0 ¤Ï¥É¥é¥¤¥ÖÁ´ÂÎ
94 ¥Ñ¡¼¥Æ¥£¥·¥ç¥ó 1 ¡Á 4 ¤Ï DOS ¤Î "´ðËÜ (primary)" ¥Ñ¡¼¥Æ¥£¥·¥ç¥ó
96 ¥Ñ¡¼¥Æ¥£¥·¥ç¥ó 5 ¡Á 8 ¤Ï DOS ¤Î "³ÈÄ¥ (extended)" (¤Þ¤¿¤Ï¡¢"ÏÀÍý
97 (logical)") ¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¡£
101 .\"O will have major 8, minor 0, and will refer to all of the first SCSI drive
102 .\"O in the system; and
104 .\"O will have major 8, minor 19, and will refer to the third DOS "primary"
105 .\"O partition on the second SCSI drive in the system.
108 ¤Ï¥á¥¸¥ã¡¼¥Ê¥ó¥Ð¡¼ 8 ¥Þ¥¤¥Ê¡¼¥Ê¥ó¥Ð¡¼ 0 ¤ò»ý¤Á¡¢¥·¥¹¥Æ¥à¤ÎºÇ½é¤Î SCSI
109 ¥É¥é¥¤¥ÖÁ´ÂΤò»²¾È¤¹¤ë¡£¤½¤·¤Æ¡¢
111 ¤Ï¥á¥¸¥ã¡¼¥Ê¥ó¥Ð¡¼ 8 ¥Þ¥¤¥Ê¡¼¥Ê¥ó¥Ð¡¼ 19 ¤ò»ý¤Á¡¢¥·¥¹¥Æ¥à¤ÎÆó¤ÄÌܤÎ
112 SCSI ¥É¥é¥¤¥Ö¤Î»°ÈÖÌܤΠDOS "´ðËÜ" ¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤ò»²¾È¤¹¤ë¡£
114 .\"O At this time, only block devices are provided.
115 .\"O Raw devices have not yet been implemented.
116 ¸½ºß¤Ï¡¢¥Ö¥í¥Ã¥¯¥Ç¥Ð¥¤¥¹¤À¤±¤¬Ä󶡤µ¤ì¤Æ¤¤¤ë¡£¥í¡¼¡¦¥Ç¥Ð¥¤¥¹ (raw device)
117 ¤Ï¤Þ¤À¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£
129 .\"O Returns the BIOS disk parameters in the following structure:
130 ¼¡¤Î¤è¤¦¤Ê¹½Â¤ÂΤòÍѤ¤¤Æ BIOS ¤Î¥Ç¥£¥¹¥¯¥Ñ¥é¥á¡¼¥¿¤òÊÖ¤¹:
136 unsigned char sectors;
137 unsigned short cylinders;
143 .\"O A pointer to this structure is passed as the
146 ¤³¤Î¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤¬
148 ¤Ø¤Î¥Ñ¥é¥á¡¼¥¿¤È¤·¤ÆÅϤµ¤ì¤ë¡£
150 .\"O The information returned in the parameter is the disk geometry of the drive
151 .\"O .I "as understood by DOS!"
152 .\"O This geometry is
154 .\"O the physical geometry of the drive.
155 .\"O It is used when constructing the
156 .\"O drive's partition table, however, and is needed for convenient operation
162 .\"O If the geometry information is not available, zero will be returned for all
163 .\"O of the parameters.
164 ¤³¤Î¥Ñ¥é¥á¡¼¥¿¤ËÆþ¤ì¤é¤ì¤ÆÊÖ¤µ¤ì¤ë¾ðÊó¤Ï¡¢
165 .I "DOS ¤Ë¤è¤Ã¤ÆÍý²ò¤µ¤ì¤ë¤è¤¦¤Ê"
166 ¥É¥é¥¤¥Ö¤Î¥¸¥ª¥á¥È¥ê¤Ç¤¢¤ë¡£
167 ¤³¤Î¥¸¥ª¥á¥È¥ê¤Ï¡¢¥É¥é¥¤¥Ö¤ÎʪÍýŪ¤Ê¥¸¥ª¥á¥È¥ê
169 ¤³¤Î¾ðÊó¤Ï¥É¥é¥¤¥Ö¤Î¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¥Æ¡¼¥Ö¥ë¤òºîÀ®¤¹¤ë»þ¤ËÍѤ¤¤é¤ì¤ë¡¢
174 ¤ÎŬÀÚ¤ÊÁàºî¤ËɬÍפǤ¢¤ë¡£
175 ¤â¤·¡¢¥¸¥ª¥á¥È¥ê¤Î¾ðÊó¤¬ÆÀ¤é¤ì¤Ê¤±¤ì¤Ð¡¢¤½¤ì¤¾¤ì¤ÎÃÍÁ´¤Æ¤Ë¥¼¥í¤¬Æþ¤ì
180 .\"O Returns the device size in sectors.
183 .\"O parameter should be a pointer to a
185 ¥»¥¯¥¿¤Î¿ô¤Çɽ¤·¤¿¥Ç¥Ð¥¤¥¹¤Î¥µ¥¤¥º¤¬ÊÖ¤µ¤ì¤ë¡£
189 ¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
192 .\"O Forces a reread of the SCSI disk partition tables.
193 .\"O No parameter is needed.
194 ¶¯À©Åª¤Ë¡¢SCSI ¥Ç¥£¥¹¥¯¤Î¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¥Æ¡¼¥Ö¥ë¤ÎºÆÆɤ߹þ¤ß¤ò¹Ô¤¦¡£
195 ¥Ñ¥é¥á¡¼¥¿¤ÏɬÍפʤ¤¡£
200 .\"O operations are also supported.
203 .\"O parameter is required, and it is NULL, then
205 .\"O will fail with the error
210 Áàºî¤âƱÍͤ˥µ¥Ý¡¼¥È¤µ¤ì¤ë¡£
212 ¤Î¥Ñ¥é¥á¡¼¥¿¤¬É¬Íפǡ¢¤½¤ì¤¬ NULL ¤Ê¤é¤Ð¡¢
219 .\"O /dev/sd[a\-h]: the whole device
220 /dev/sd[a\-h]: ¥É¥é¥¤¥ÖÁ´ÂÎ
222 .\"O /dev/sd[a\-h][0\-8]: individual block partitions
223 /dev/sd[a\-h][0\-8]: ¸Ä¡¹¤Î¥Ö¥í¥Ã¥¯¥Ñ¡¼¥Æ¥£¥·¥ç¥ó
224 .\"O .\".SH "SEE ALSO"