Next Previous Contents

14. Lunontas problhmata

Polloi nomizoyn oti exoyn problhma, enw sthn pragmatikothta den yparxei kanena. H pisteuoyn oti ta problhmata poy exoyn ofeilontai sth gewmetria toy diskoy, enw ayto den exei na kanei tipota me to problhma toys. Ta parapanw mporei na akougontai periploka alla h gewmetria einai kati sxetika aplo: afhste thn opws einai kai ola 8a einai mia xara· h to polu na dwsete thn parametro `linear' sto LILO an den proxwraei meta to `LI' otan jekina. Prosejte ta mynhmata toy pyrhna kai 8ymh8eite: oso perissotero peirazete thn gewmetria (orizontas kefales kai kylindroys sto LILO, to fdisk kai ton pyrhna) toso pi8anotero einai na mh doylecei. Xontrika ola einai entajei apo mona toys.

Kai 8ymh8eite: poy8ena sto Linux de xrhsimopoieite h gewmetria, opote kanena problhma de mporei na dhmioyrgh8ei apo aythn. H gewmetria xrhsimopoieite mono apo to LILO kai to fdisk. Etsi, an to LILO den jekina ton pyrhna, mporei na einai problhma gewmetrias. An diaforetika leitoyrgika den katalabainoyn ton pinaka katatmhsewn, mporei na einai problhma gewmetrias. Tipota perissotero. Sygkekrimena, an to mount de doyleuei mhn anhsyxeite gia th gewmetria· to problhma einai allou.

14.1 Problhma: to Linux xrhsimopoiei la8os gewmetria gia ton disko moy.

Einai pi8ano enas diskos na labei la8os gewmetria. O pyrhnas rwta to BIOS gia ta hd0 kai hd1 (toys diskoys 80H kai 81H sumfwna me to BIOS) kai ypo8etei oti einai gia ta hda kai hdb. Alla an ekkineite apo SCSI, oi prwtoi dyo diskoi mporei na einai SCSI kai o pemptos diskos, poy einai prwtos IDE hda diskos, pairnei th gewmetria toy sda. Ayto lunetai eukola me thn parametro ekkinhshs `hda=C,H,S' me tis katallhles times C, H kai S, eite kata thn ekkinhsh h sto /etc/lilo.conf.

14.2 Problhma: Idioi diskoi exoyn diaforetikh gewmetria

`Exw dyo omoioys diskoys 10GB IBM. To fdisk dinei diaforetiko mege8os ston ka8ena. Deite:

# 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      End   Blocks   Id  System
/dev/hdd1           1    19650  9903568+  83  Linux native
Pws kai;'

Ti symbainei edw; Prwta apo ola, oi diskoi einai pragmati 10GB: to hdb exei mege8os 255*63*1232*512 = 10133544960, kai to hdd 16*63*19650*512 = 10141286400, etsi tipota de symbainei kai o pyrhnas toys blepei kai toys duo san 10.1 GB. Giati h diafora sto mege8os; Ayto symbainei epeidh o pyrhnas pairnei tis plhrofories gia toys prwtoys dyo IDE diskoys apo to BIOS, kai to BIOS exei balei ston hdb 255 kefales (kai 16*19650/255=1232 cylinders). H stroggylopoihsh kostizei sxedon 8MB.

An 8elete mporeite na allajete ton hdd me ton idio tropo kai na dwsete ston pyrhna kata thn ekkinhsh `hdd=1232,255,63'.

14.3 Problhma: to fdisk blepei perissotero xwro apo to df

To fdisk 8a sas pei posa temaxia (blocks) yparxoyn ston disko. An dhmioyrghsete susthma arxeiwn, p.x. me to mke2fs, tote to susthma krata ligo xwro gia logoys diaxeirishs· peripoy 4% toy synolikou xwroy, perissotero an 8elete polla inodes. Gia paradeigma:

# 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           Inodes   IUsed   IFree  %IUsed Mounted on
/dev/hda9            4096000      11 4095989     0%  /mnt
#
Exoyme mia katatmhsh 4095976 blocks, kanoyme ena ext2 susthma, to prosartoume kai telika exoyme mono 3574475 blocks· 521501 blocks (12%) xa8hkan sta inodes kai th diaxeirish. Shmeiwste oti h diafora metaju twn 3574475 kai twn 3369664 blocks einai ta 13 poy xrhsimopoiountai kai ta 204798 poy krath8hkan gia ton yperxrhsth. To teleytaio noumero mporei na allajei me to tune2fs. To `-i 1024' einai logiko na xrhsimopoih8ei mono gia katatmhseis newn h taxydromeioy, opoy yparxoyn polla kai mikra arxeia. To synh8ismeno 8a htan:
# mke2fs /dev/hda9
# mount /dev/hda9 /somewhere
# df /somewhere
Filesystem         1024-blocks  Used Available Capacity Mounted on
/dev/hda9            3958475      13  3753664      0%   /mnt
# df -i /somewhere
Filesystem           Inodes   IUsed   IFree  %IUsed Mounted on
/dev/hda9            1024000      11 1023989     0%  /mnt
#
Twra mono 137501 blocks (3.3%) xrhsimopoiountai gia inodes, wste exoyme 384 MB perissotera apo prin. (Profanws ka8e inode xrhsimopoiei 128 bytes). Apo thn allh, mporoume na exoyme to polu 1024000 arxeia (parapanw apo arketa), anti twn 4096000 (yperbolika polla) poy eixame prin.


Next Previous Contents