Next Previous Contents

9. Synepeies

Ti shmainoyn ola ayta; Gia toys xrhstes toy Linux mono ena pragma: prepei na sigoyreytoun oti to LILO kai to fdisk xrhsimopoioun th swsth gewmetria, opoy «swsth» gia to fdisk einai h gewmetria poy xrhsimopoieitai kai apo ta alla leitoyrgika ston idio disko, kai gia to LILO ayth poy 8a epitrecei th swsth epikoinwnia me to BIOS kata thn ekkinhsh (synh8ws ayta ta dyo sympiptoyn).

Pws jerei to fdisk gia th gewmetria; Rwta ton pyrhna, xrhsimopoiwntas to HDIO_GETGEO ioctl, prin o xrhsths epembei sth gewmetria.

Pws jerei to LILO th gewmetria; Rwta thn pyrhna xrhsimopoiwntas to HDIO_GETGEO ioctl. Alla o xrhsths mporei na epembei xrhsimopoiwntas thn epilogh `disk=' sto /etc/lilo.conf (deite to lilo.conf(5)). Mporeite na dwsete kai thn linear epilogh sto LILO, kai 8a apo8hkeusei LBA diey8unseis anti gia CHS ston xarth toy, kai 8a brei th gewmetria kata thn ekkinhsh (xrhsimopoiwntas thn INT 13 Function 8 gia na rwthsei gia th gewmetria).

Pws jerei o pyrhnas ti na apanthsei; Prwta ap' ola, xrhsths mporei na exei dhlwsei th gewmetria me thn entolh `hda=cyls,heads,secs' ston pyrhna (deite bootparam(7)), isws xeirokinhta h zhtwntas ton boot loader na dwsei ayth thn parametro ston pyrhna. Gia paradeigma mporeite na peite sto LILO na dwsei mia tetoia parametro pros8etontas to `append = "hda=cyls,heads,secs"' sto /etc/lilo.conf (deite lilo.conf(5)). Diaforetika o pyrhnas 8a mantecei, pi8anon xrhsimopoiwntas times poy brhke apo to BIOS h ton disko.

Einai dynaton (apo ton pyrhna 2.1.79) na allajete th gewmetria ston pyrhna xrhsimopoiwntas to /proc. Gia paradeigma

# 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 Ypologizontas tis parametroys toy LILO

Merikes fores einai xrhsimo na orisete th gewmetria xrhsimopoiwntas to `hda=cyls,heads,secs' sth grammh entolwn toy pyrhna. Synh8ws panta xreiazetai secs=63, kai o logos poy to pro8etoyms einai gia na oristoun oi heads. (Logikes times shmera einai heads=16 kai heads=255.) Ti 8a prepei na orisoyme gia to cyls? Akribws ton ari8mo poy 8a dwsei th swsth synolikh xwrhtikothta gia C*H*S tomeis. Gia paradeigma, gia ena disko me 71346240 tomeis (36529274880 bytes) to C ypologizetai ws 71346240/(255*63)=4441 (gia paradeigma xrhsimopoiwntas ena programma san to bc), kai h parametros ekkinhshs einai hdc=4441,255,63. Pws jeroyme thn swsth xwrhtikothta; Gia paradeigma,

# 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
dinei duo tropoys na broume ton synoliko ari8mo tomewn 71346240. O pyrhnas mas dinei
# dmesg | grep hdc
...
hdc: Maxtor 93652U8, 34837MB w/2048kB Cache, CHS=70780/16/63
 hdc: [PTBL] [4441/255/63] hdc1 hdc2 hdc3! hdc4 < hdc5 > ...
poy mas leei gia (toylaxiston) 34837*2048=71346176 kai gia (toylaxiston) 70780*16*63=71346240 tomeis. Se ayth thn periptwsh, h deuterh timh symbainei na einai swsth, alla genika kai oi duo mporoun na stroggylopoih8oyn pros ta katw. Aytos einai enas kalos tropos na proseggisoyme to mege8os toy diskoy otan to hdparm den einai dia8esimo. Pote mhn dinetai polu megalh timh gia to cyls! Sthn periptwsh twn SCSI diskwn o akribhs ari8mos twn tomewn dinetai kata thn ekkinhsh:
SCSI device sda: hdwr sector= 512 bytes. Sectors= 17755792 [8669 MB] [8.7 GB]
(kai ta MB, GB einai stroggylopoihmena, oxi pros ta katw, kai `dyadika').


Next Previous Contents