Escolar Documentos
Profissional Documentos
Cultura Documentos
SCSI: Linux .
.
IDE ( 8.4GB):
(2.0.34 ). ,
BIOS LBA .
IDE ( 33.8 GB): ``IDE
34+ GB '' .
LILO , linear
etc/lilo.conf
/LILO/fdisk.
fdisk ``''
: , cfdisk
.
,
``'',
df
.
, ,
.
3.
kilobyte (kB) 1000 bytes. megabyte (MB) 1000 kB.
gigabyte (GB) 1000 MB. terabyte (TB) 1000 GB.
SI . ,
1 MB=1024000 bytes 1.44 MB
1 MB=1048576 bytes.
standard Ki, Mi, Gi, Ti
, 1440 KiB (1.47 MB, 1.41 MiB), 1 MiB
1048576 bytes (1.05 MB), 1 GiB 1073741824 bytes (1.07 GB)
1 TiB 1099511627776 bytes (1.1 TB).
, SI
. ,
Linux fdisk MB GB
, - . ,
,
( bytes).
,
Knuth ,
KKB, MMB, GGB, TTB, PPB, EEB, ZZB, YYB
kilobyte, megabyte, ... yottabyte. `
. , ` gigabyte'
`gibibyte'.
megabyte 1000000 bytes,
.
3.1.
512 bytes.
, MO 2048 bytes,
. ( fdisk ,
2.9i ,
`-b 2048'.)
3.2.
C , S
C*H*S C*H*S*512 bytes.
, C/H/S=4092/16/63
4092*16*63=4124736 4124736*512=2111864832 bytes
(2.11 GB). , C/H/S=16383/16/63
8.4 GB,
C/H/S .
4.
,
, .
SCSI,
SCSI . IDE
LBA, . RLL
MFM IDE -LBA ,
(, , ) .
3D
: C , H S /
(c,h,s) 3D CHS c*H*S + h*S + (s-1)
LBA. (
1, 0 3D).
, o -SCSI ,
, , C, H S.
4.1. BIOS 1024
Linux BIOS,
. BIOS, LBA,
INT13 (c,h,s) . (: AH
, CH 8 bits
, CL bits 7-6 bits
bits 5-0 , DH
, DL (80h
81h). .)
, CHS 3 bytes, 10 bits
, 8 bits 6 bits
(1-63).
0 1023 1024
BIOS.
4092/16/63.
over2gb.htm.
3.2 GB
bug Phoenix 4.03 4.04 BIOS
CMOS setup
3227MB. over3gb.htm.
4.2 GB ( 1997)
BIOS (ECHS=Extended CHS,
`Large disk support' `Large')
DOS,
1024. DOS Windows
95 256 ,
16 ,
8192*16*63*512=4227858432 bytes ( 1024
, 128 , 63 /).
ECHS ,
63, .
over4gb.htm.
7.9 GB
BIOS
15 (`revised ECHS'),
240 ,
1024*240*63*512=7927234560 bytes.
8.4 GB
, BIOS ,
, 255 63 /
(`assisted LBA' or just `LBA')
1024*255*63*512=8422686720 bytes,
8.5 GB, 256
. (
16, 32, 64, 128,
255
1024*H*63*512, C
(H*63*512).)
The 33.8 GB limit (August 1999)
33.8 GB.
16 63/
65535,
short . BIOS
. ( Asus upgrades
.) 2.2.14 / 2.3.21
patch. ``IDE 34+ GB ''
.
Breaking the Barriers
, , IDE Hard Drive Capacity Barriers.
8.4 GB
16383/16/63. ''
.
5.
, BIOS 0 (
MBR - Master Boot Record) ( CD-ROM)
- .
BIOS. Linux
1024 .
:
,
LILO)
1024 BIOS
- .
: , 10MB,
,
1024 .
/boot LILO , .
( CHS Cylinder/Head/Sector).
:
24-bit begin end,
32-bit start length.
Linux start length , ,
2^32 , ,
2 TiB. 100
, 8
. (, ,
ext2
32-bit
2 GiB.)
DOS begin end , BIOS
INT13 ,
8.4GB, BIOS . (
2.1 GB FAT16
). Windows 3.11 WfWG
Windows NT 3.* Novell NetWare.
Windows 95 Extended INT13,
(c, e, f b, 6, 5)
.
, begin end
(1023/255/63). Windows 95 OSR2 FAT32
( b or c),
2 TiB.
fdisk `'
, ;
'': begin end ,
DOS, . ( ,
1024 - '' 1024
.). , start length ,
Linux, Windows 95
c, e f, . ,
cfdisk
Linux. DOS.
cfdisk -Ps /dev/hdx cfdisk -Pt /dev/hdx
/dev/hdx.
7.
( , )
MFM RLL.
. , IDE SCSI,
`' . ,
:
`'
. : IDE INITIALIZE DRIVE PARAMETERS (91h)
/
.
2 15 16 BIOS, BIOS
255 .
0, 1, ...,
.
LBA.
: DOS, ,
BIOS, (c,h,s). BIOS LBA
.
LBA
. , (c',h',s')
.
`LBA':
`
= Linear Block Addressing' (
CHS). BIOS Setup,
` LBA = assisted
LBA' - ```'''.
LBA
BIOS . ( setup
`Large'.) BIOS (C,H,S)
(C',H',S') .
S = S', C = C'/N H = H'*N, e N
C' <= 1024 (
C' = C/N).
8.4 GB (7.8 GiB).
( setup `Normal',
.)
BIOS `Large' `LBA',
. OnTrack EZ-Drive
BIOS .
MBR ( OnTrack
DDO: Dynamic Drive Overlay),
.
.
- BIOS -
.
Linux OnTrack 1.3.14, EZ-Drive
1.3.29. .
8. IDE
IDE , ,
Linux ,
, DOS OnTrack EZ-Drive. ,
`hd=cyls,heads,secs'
.
4, 8, 16, 32, 64, 128, 255
( H*C ) C <= 1024 H = 255.
-
.
.
8.1. EZD
EZ-Drive
55.
0 - 1.
,
0 1.
#define
FAKE_FDISK_FOR_EZDRIVE 0 ide.c.
8.2. DM6:DDO
OnTrack DiskManager ( )
54.
63
( 63 0). ,
MBR ( )
0. DDO -
.
8.3. DM6:AUX
OnTrack DiskManager ( )
51 53.
.
8.4. DM6:MBR
OnTrack DiskManager
. (
2 3 bytes MBR
430, 055AA
byte). .
8.5. PTBL
,
start end :
1 63
31, 63, 127 254, ,
, , , IDE
16 , BIOS
32, 64, 128 255 .
,
63 63 (
).
9.
; Linux :
LILO fdisk
, fdisk
,
LILO BIOS
( ).
fdisk ; ,
HDIO_GETGEO ioctl, .
LILO ;
HDIO_GETGEO ioctl.
`disk=' /etc/lilo.conf ( lilo.conf(5)).
linear LILO,
LBA CHS ,
( INT 13 Function 8
).
; ' ,
`hda=cyls,heads,secs'
( bootparam(7)), boot
loader .
LILO
`append = "hda=cyls,heads,secs"' /etc/lilo.conf (
lilo.conf(5)). ,
BIOS .
( 2.1.79)
/proc.
# sfdisk -g /dev/hdc
/dev/hdc: 4441 cylinders, 255 heads, 63 sectors/track
# cd /proc/ide/ide1/hdc
# echo bios_cyl:17418 bios_head:128 bios_sect:32 > settings
# sfdisk -g /dev/hdc
/dev/hdc: 17418 cylinders, 128 heads, 32 sectors/track
#
9.1. LILO
`hda=cyls,heads,secs' .
secs=63,
heads. ( heads=16
heads=255.) cyls?
C*H*S .
, 71346240 (36529274880 bytes) C
71346240/(255*63)=4441 (
bc),
hdc=4441,255,63. ; ,
# hdparm -g /dev/hdc | grep sectors
geometry
= 4441/255/63, sectors = 71346240, start = 0
# hdparm -i /dev/hdc | grep LBAsects
CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=71346240
71346240.
# dmesg | grep hdc
...
hdc: Maxtor 93652U8, 34837MB w/2048kB Cache, CHS=70780/16/63
hdc: [PTBL] [4441/255/63] hdc1 hdc2 hdc3! hdc4 < hdc5 > ...
() 34837*2048=71346176
() 70780*16*63=71346240 . ,
,
.
hdparm
. cyls!
SCSI
:
SCSI device sda: hdwr sector= 512 bytes. Sectors= 17755792 [8669 MB] [8.7
GB]
( MB, GB , ,
`').
10.
10.1. IDE -
IDE .
(G_user) .
(G_bios) BIOS (Fixed
Disk Parameter Table) ( )
,
32-bit. (G_phys) (G_log)
IDE IDENTIFY -
`' ` ' .
, :
G_fdisk, HDIO_GETGEO ioctl,
G_used, I/O.
G_user , G_bios
CMOS, G_phys
. G_log
G_used . , G_used
G_phys G_phys
G_used. `'
1-16.
: BIOS,
fdisk, (
16 ), /
IDENTIFY.
G_bios :
SCSI SCSI
BIOS sda
hda. ,
setup BIOS BIOS. , ..,
IDE , hdb BIOS setup,
BIOS
hda hdc.
10.2. SCSI
SCSI ,
SCSI , `'
/. ,
, fdisk ,
HDIO_GETGEO. , fdisk
IDE SCSI . ,
.
.
DOS,
, 64 , 32 / (
1 MiB ), ,
.
SCSI (aha152x, pas16, ppa, qlogicfas, qlogicisp)
DOS
8 GiB Linux.
bug.
;
. ,
fdisk LILO .
SCSI . :
fdisk/LILO/kernel SCSI
.
.
READ CAPACITY
MODE SENSE Rigid Disk
Drive Geometry (04)
( ) Format (03)
bytes .
, /
:
/. scsiinfo Linux
.
( )
. , fdisk LILO,
C/H/S=4476/27/171 -
fdisk
10/8/6 bits C/H/S.
HDIO_GETGEO ;
SCSI .
, , ,
DOS fdisk OS/2 ( AFDISK Adaptec, ) .
fdisk linux
/ S LBA c/h/s
C .
(C,H,S) = (1023,255,63)
1023*255*63 sectors. ,
fdisk
8 GiB - .
,
C, H, S , /.
H, S C M / (H*S).
, H=64, S=32.
aha1740, dtc, g_NCR5380, t128, wd7000:
H=64, S=32.
2.1.90.
11.1. BIOS
, C=16383, H=16, S=63
,
LBAcapacity. BIOS
16383/16/63
, .. 1024/255/63 1027/255/63. ,
16383/16/63,
BIOS. 2.2.2
( S BIOS
C = /(H*S)).
Normal BIOS ( None,
BIOS).
DOS/Windows
2.2.2 ,
.
BIOS 16320/16/63, 8
1024/255/63 .
.
,
hda: [PTBL] [1027/255/63].
8.4GB. 2.3.21. ,
.
11.2.
(jumpers)
15 16 .
16 .
, 15
. : Petri
Kaukasoina : ` 10.1 Gig IBM Deskstar 16 GP (IBM-DTTA-351010)
16 PC ( AMI BIOS)
15 . hdparm -i
RawCHS=16383/15/63 LBAsects=19807200. 20960/15/63
.' 16383/15/63
, .
http://www.storage.ibm.com/techsup/hddtech/hddtech.htm.
11.3.
. , Linux
, BIOS
. BIOS.
.
4096 (, 16
63/, 2.11GB). , Fujitsu MPB3032ATU 3.24
GB 6704/15/63,
4092/16/63, LBA 4124736 ,
. ( BIOS
) Linux
.
2GB
4092/16/63 4096/16/63,
LBA .
Linux,
.
`` 33.8 GB''.
2.3.21 patch
IDE 33.8GB.
33.8 GB. , IBM Deskstar 37.5 GB
(DPTA-353750) 33.8 GB,
16383/16/63 ,
LBA 66055248 ( 65531/16/63 4111/255/63)).
, 33.8GB,
Linux. the BIOS 33.8 GB limit.
12. 65535 linux
HDIO_GETGEO ioctl
short. 65535 ,
( SCSI 1 MiB )
80 GiB 16 GiB.
, .
12.1. IDE 34+ GB
33.8 GB
2.3.21. :
IBM-DPTA-373420 66835440 (34.2 GB).
2.3.21
769*16*63 = 775152 (0.4 GB),
. hdc=4160,255,63
- . ; idedisk_setup()
( 16383/16/63)
, ,
BIOS.
current_capacity() idedisk_capacity()
66835440/(16*63)=66305, short
, 769. lba_capacity_is_ok()
id->cyls,
769*16*63. patch. 2.0.38
ftp.kernel.org. 2.2.12
www.uwsg.indiana.edu. 2.2.14pre
. 2.3.* , 2.3.21.
, `' ``
'' 33.8 GB.
`` BIOS''
.
13.
``,'' MBR ( 0):
4 16 byte ,
AA55 . 5 F 85
() :
:
. (, ,
,
.)
.
4 : ,
.
,
,
.
:
, :
; .
,
.
sfdisk . ..,
# sfdisk -l -x /dev/hda
Disk /dev/hda: 16 heads, 63 sectors, 33483 cylinders
Units = cylinders of 516096 bytes, blocks of 1024 bytes, counting from 0
Device Boot Start
End
/dev/hda1
0+
101
/dev/hda2
102
2133
/dev/hda3
2134 33482
/dev/hda4
0
-
/dev/hda5
-
2134+ 6197
6198 10261
2134
2133
2134
2133
/dev/hda6
...
/dev/hda10
-
6198+ 10261
10262 16357
6198
6197
6198
6197
30581+ 33482
30581 30580
30581
30581
30580
30580
0
0
0
0
0 Empty
0 Empty
.
.
. ( , fdisk
5, F, 85 5
F.) fdisk
,
. Linux
. ,
. ,
5 DOS 85, DOS, Linux,
fdisk DOS
1024 .
14.
,
.
,
.
:
`linear' LILO
`LI' .
: (
LILO, fdisk )
.
.
: Linux ,
.
LILO fdisk. , LILO
, .
,
. . , mount
.
14.1. : Linux
.
.
BIOS hd0 hd1 ( 80H 81 BIOS)
hda hdb. SCSI,
SCSI ,
IDE hda , sda.
`hda=C,H,S'
C, H S,
/etc/lilo.conf.
14.2. :
` 10GB IBM. fdisk
. :
# fdisk /dev/hdb
Disk /dev/hdb: 255 heads, 63 sectors, 1232 cylinders
Units = cylinders of 16065 * 512 bytes
Device Boot Start
End Blocks Id System
/dev/hdb1
1
1232 9896008+ 83 Linux native
# fdisk /dev/hdd
Disk /dev/hdd: 16 heads, 63 sectors, 19650 cylinders
Units = cylinders of 1008 * 512 bytes
Device Boot Start
/dev/hdd1
1
;'
; , 10GB: hdb
255*63*1232*512 = 10133544960, hdd 16*63*19650*512
= 10141286400,
10.1 GB. ;
IDE
BIOS, BIOS hdb 255 (
16*19650/255=1232 cylinders). 8MB.
hdd
`hdd=1232,255,63'.
14.3. : fdisk df
To fdisk (blocks) .
, .. mke2fs,
4%
, inodes. :
# sfdisk -s /dev/hda9
4095976
# mke2fs -i 1024 /dev/hda9
mke2fs 1.12, 9-Jul-98 for EXT2 FS 0.5b, 95/08/09
...
204798 blocks (5.00%) reserved for the super user
...
# mount /dev/hda9 /somewhere
# df /somewhere
Filesystem
1024-blocks Used Available Capacity Mounted on
/dev/hda9
3574475
13 3369664
0% /mnt
# df -i /somewhere
Filesystem
/dev/hda9
#