Ellhniko Linux Partition HOWTO

Kristan Koehntopp, kris@koehntopp.de Ekdosh 2.4, 3 Noembrioy 1997

Gia opoiadhpote sxolia, dior8wseis, klp sxetika me thn ellhnikh metafrash epikoinwnhste me ton Panagiwth Boydourh sth dieu8ynsh: panos@veria1.freeserve.co.uk To sygkekrimeno mini-HOWTO sas didaskei pws na sxediazete kai na xrhsimopoieite to xwro stoys diskoys sas gia ena susthma Linux. Mila gia to yliko, tis katatmhseis, periorismous sto mege8os kai thn topo8ethsh xwroy enallaghs(swap) sto disko, systhmata arxeiwn, tainies kai alla sxetika 8emata. O skopos toy einai na dwsei basikes gnwseis, opote milame perissotero gia arxes leitoyrgias para gia th xrhsh ergaleiwn.

Contents

1 Eisagwgh 1 1.1 Ti einai ayto; . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.2 Ti yparxei se ayto; kai sxetika HOWTO. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

2 Telos pantwn, ti einai mia katatmhsh; 2 2.1 Ta antigrafa einai shmantika . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 2.2 Ari8moi kai onomata syskeywn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

3 Ti katatmhseis xreiazomai; 5 3.1 Poses katatmhseis xreiazomai; . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 3.2 Poso megalos prepei na einai o xwros enallaghs; . . . . . . . . . . . . . . . . . . . . . . . . . . 5 3.3 Pou prepei na balw to xwro enallaghs; . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 3.4 Merika gegonota gia ta systhmata arxeiwn kai ton katakermatismo . . . . . . . . . . . . . . . 7 3.5 Diarkeia zwhs arxeiwn kai kukloi antigrafwn asfaleias ws krithria katatmhsewn . . . . . . . . 8

4 Ena paradeigma 8 4.1 Proteinomeno montelo gia filodojoys arxarioys . . . . . . . . . . . . . . . . . . . . . . . . . . 8

5 Pws to ekana sto mhxanhma moy 9

1 Eisagwgh

1.1 Ti einai ayto;

To eggrafo ayto einai ena Linux Mini-HOWTO. Ena Mini-HOWTO einai ena suntomo keimeno poy ejhgei otidhpote sxetiko me to Linux ws odhgos egkatastashs kai synthrhshs. Einai mini epeidh eite to keimeno h to 8ema einai polu mikro gia ena pragmatiko HOWTO h akoma ki ena biblio. To HOWTO den einai odhgos anaforas: gia ayto yparxoyn oi selides boh8eias (man pages).

1.2 Ti yparxei se ayto; kai sxetika HOWTO.

To sygkekrimeno mini-HOWTO sas didaskei pws na sxediazete kai na xrhsimopoieite to xwro stoys diskoys sas gia ena susthma Linux. Mila gia to yliko, tis katatmhseis, periorismous sto mege8os kai thn topo8ethsh eikonikhs mnhmhs sto disko, systhmata arxeiwn, kasetes kai alla sxetika 8emata. O skopos toy einai na dwsei basikes gnwseis, opote milame perissotero gia arxes leitoyrgias para gia th xrhsh ergaleiwn.

Idanika, ayto to eggrafo 8a prepei na diabastei prin thn prwth sas egkatastash, pragma duskolo gia toys perissoteroys. Oi prwtarhdes exoyn kai alla problhmata apo th beltistopoihsh toy diskoy. Etsi, pi8anon eiste kapoios poy molis teleiwse thn egkatastash toy Linux kai skeftetai tropoys na thn beltistopoihsei h pws na apofugei la8h gia thn epomenh. Pantws, na perimenete oti meta to telos aytou toy keimenoy 8a exete mia epi8ymia gia mia kainouria egkatastash. :-)

Ayto to mini-HOWTO periorizetai ston programmatismo kai sxediasmo toy xwroy sto disko. Den perigrafei th xrhsh twn fdisk, LILO, mke2fs h programmatwn gia antigrafa asfaleias. Yparxoyn alla HOWTO gia ayta ta problhmata. Parakalw, deite to Linux HOWTO Index gia plhrofories gia Linux HOWTO. Yparxoyn kai plhrofories sto index gia to pws na apokthsete ta HOWTO.

Gia na ma8ete pws na ypologizete ta mege8h kai tis apaithseis taxuthtas gia diafora tmhmata toy systhmatos arxeiwn, deite to ”Linux Multiple Disks Layout mini-HOWTO”, apo ton Gjoen Stein <gjoen@nyx.net>.

Gia plhrofories kai periorismous sxetika me diskoys me perissoteroys apo 1024 kulindroys, deite to ”Linux Large Disk mini-HOWTO”, toy Andries Brouwer <aeb@cwi.nl>.

Gia odhgies toy pws na periorisete th xrhsh diskoy ana xrhsth (quotas), deite to ”Linux Quota mini-HOWTO”, toy Albert M.C. Tam <bertie@scn.org>

Th stigmh ayth den yparxei kapoio geniko eggrafo gia antigrafa asfaleias, alla yparxoyn arketa eggrafa poy anaferontai se sygkekrimenes luseis. Deite to ”Linux ADSM Backup mini-HOWTO”, toy Thomas Koenig <Thomas.Koenig@ciw.uni-karlsruhe.de> gia odhgies sxetika me to pws na oloklhrwsete to Linux se ena IBM ADSM periballon. Deite to ”Linux Backup with MSDOS mini-HOWTO”, toy Christopher Neufeld <neufeld@physics.utoronto.ca> gia plhrofories sxetika me antigrafa asfaleias toy Linux mesw MS-DOS.

Gia odhgies pws na gracete kai na paradwsete ena HOWTO, deite to Linux HOWTO Index, toy Tim Bynum <linux-howto@sunsite.unc.edu>.

Epishs, koitazontas to /usr/src/linux/Documentation mporei na einai polu xrhsimo. Koitajte ta ide.txt kai scsi.txt gia plhrofories sxetika me tis idiothtes twn odhgwn diskwn kai rijte mia matia kai ston ypokatalogo filesystems/.

2 Telos pantwn, ti einai mia katatmhsh;

Otan efeyre8hkan oi sklhroi diskoi, oi xrhstes suntoma h8elan na egkatasthsoyn diafora leitoyrgika systhmata, akoma ki an eixan mono ena disko sto susthma toys. Etsi, xreiazotan enas mhxanismos poy na xwrizei ton ena fysiko disko se pollaples logikes monades. Ayto einai h katatmhsh: ena synexes tmhma toy diskoy poy symperiferetai san enas teleiws jexwristos diskos sta perissotera leitoyrgika systhmata.

Einai emfanes oti oi katatmhseis den prepei na yperkaluptoyn h mia thn allh: Sigoyra ena leitoyrgiko de 8a htan eyxaristhmeno an ena allo leitoyrgiko susthma egrafe panw se shmantika toy dedomena epeidh oi katatmhseis sygkaluptontai. Epishs, de 8a prepei na yparxoyn kena metaju twn katatmhsewn. An kai ta endiamesa kena den einai epiblabh, xaramizoyn ton polutimo xwro toy diskoy.

O diskos de xreiazetai na katatmh8ei teleiws. Mporei na apofasisete na afhsete ligo xwro sto telos toy diskoy poy na mh xrhsimopoieitai apo kanena leitoyrgiko susthma. Argotera, otan jeka8arisei poio leitoyrgiko xrhsimopoieite perissotero, mporeite na xrhsimopoihsete ton keno xwro gia to susthma ayto.

Oi katatmhseis de mporoun na metakinh8oun h na allajoyn mege8os xwris na katastrafei to susthma arxeiwn toys. Ayto shmainei pws h ek neoy diairesh toy diskoy se katatmhseis apaitei thn lhch antigrafwn asfaleias kai meta thn anadiairesh thn epanafora twn dedomenwn apo ta antigrafa ayta. Sthn pragmatikothta, einai polu syxno to na katastrefontai ta panta kata thn anadiairesh, opote 8a prepei na kanete antigrafa olwn twn dedomenwn se oloys toys diskoys prin akoymphsete programmata san to fdisk.

Parola ayta, merikes katatmhseis me sygkekrimena systhmata arxeiwn mporoun na diaire8oun xwris na xa8oun dedomena (an eiste tyxeroi). Gia paradeigma, yparxei ena programma onomati ”fips” poy diairei katatmhseis MS-DOS sta duo gia na kanei xwro gia mia egkatastash Linux xwris na xreiastei epanegkatastash toy MS-DOS. Omws pali de 8a to aggijete xwris na parete antigrafa, etsi den einai;

2.1 Ta antigrafa einai shmantika

Oi tainies einai oi filoi sas gia ta antigrafa. Einai grhgores, ajiopistes kai eukoles sth xrhsh, opote mporeite na kanete antigrafa asfaleias syxna kai kata protimhsh aytomata kai xwris mpelades.

Prosoxh: Milaw gia alh8ines tainies, oxi ekeines tis ftape ahdies poy elegxontai apo ton elegkth diskoy. Agoraste SCSI: to Linux exei eggenh yposthrijh SCSI. Den xreiazetai na fortwsete ASPI odhgous, de xanete polutimh HMA kai efoson o elegkths SCSI egkatasta8ei, apla pros8etete diskoys, kasetes kai CD-ROMs epanw toy. Oute alles I/O diey8unseis, paijimo me IRQ h syndyasmoi Master/Slave kai PIO.

Epishs: Oi kaloi SCSI elegktes sas dinoyn ychlh epidosh I/O xwris megalo fortio ston epejergasth. Akomh kai katw apo baria xrhsh toy diskoy 8a exete kalh apokrish. Ean sxediazete na xrhsimopoihsete ena susthma Linux san basiko USENET trofodoth h ean 8a asxolh8eite ws ISP mhn dianoh8eite na parete susthma xwris SCSI.

2.2 Ari8moi kai onomata syskeywn

O ari8mos twn katatmhsewn se basizomena se Intel systhmata htan periorismenos apo thn arxh: O arxikos pinakas katatmhsewn htan egkatesthmenos ws tmhma toy tomea ekkinhshs kai eixe xwro gia mono tesseris eggrafes. Aytes oi tesseris katatmhseis onomazontai prwtarxikes. Otan egine emfanes oti oi xrhstes xreiazontan perissoteres, oi logikes katatmhseis efeyre8hkan. O ari8mos toys den einai periorismenos: ka8e logikh katatmhsh periexei ena deikth sthn epomenh, opote einai dynaton na yparxei mia alysida apo apeires eggrafes.

Gia logoys symbatothtas, o xwros poy xrhsimopoieitai apo oles tis logikes katatmhseis prepei na katametrh8ei. Ean xrhsimopoieite logikes katatmhseis, mia eggrafh twn prwtarxikwn katatmhsewn shmeiwnetai ws ”ektetamenh katatmhsh” enw ta arxiko kai teliko shmeio ths shmeiwnei ton xwro poy xrhsimopoieitai apo tis logikes katatmhseis. Ayto yponoei oti o xwros poy dinetai stis logikes katatmhseis prepei na einai synexomenos. Mporei na yparxei mono mia ektetamenh katatmhsh: kanena fdisk programma de 8a dhmioyrghsei parapanw apo mia ektetamenh katatmhsh.

To Linux de mporei na xeiristei panw apo ena sygkekrimeno ari8mo katatmhsewn ana disko. Etsi, sto Linux exete 4 prwtarxikes katatmhseis (3 apo aytes xrhsimes, ean xrhsimopoieite logikes katatmhseis) kai to polu 15 katatmhseis synolika se ena disko SCSI (63 synolika se ena disko IDE).

Sto Linux, oi katatmhseis apeikonizontai ws arxeia syskeywn. To arxeio syskeyhs einai ena arxeio tupoy c (gia syskeyh xarakthrwn=character, poy de xrhsimopoioun endiamesh mnhmh-buffer chache) h tupoy b (gia syskeyh temaxiwn=block, poy perna mesa apo thn endiamesh mnhmh). Sto Linux, oloi oi diskoi apeikonizontai ws block syskeyes. Se anti8esh me alla Unix systhmata, to Linux den prosferei akatergastes ekdoseis xarakthrwn (raw character) twn diskwn kai twn antistoixwn katatmhsewn toys.

To mono shmantiko se ena arxeio syskeyhs einai o meizwn kai o mikros ari8mos syskeyhs, poy deixnontai anti toy mege8oys toy arxeioy:

     $ ls -l /dev/hda
     brw-rw----   1 root     disk       3,   0 Jul 18  1994 /dev/hda
                                        ^^
                                        |    minor device number
                                        major device number

Otan xrhsimopoieitai ena arxeio syskeyhs, o meizwn ari8mos epilegei poios odhgos syskeyhs 8a klh8ei gia na ektelestei h ergasia eisodoy/ejodoy. H klhsh ayth ginetai me ton mikro ari8mo ws parametro kai ejartatai apokleistika apo ton odhgo pws 8a metafrastei o mikros ari8mos. H tekmhriwsh toy odhgou synh8ws ejhgei pws o odhgos xrhsimopoiei toys mikrous ari8mous. Gia IDE diskoys h tekmhriwsh brisketai sto /usr/src/linux/Documentation/ide.txt. Gia SCSI diskoys, 8a perimenate na toys breite sto /usr/src/linux/Documentation/scsi.txt, alla den einai ekei. Prepei na koitajete ston kwdika toy odhgou gia na eiste sigoyroi (/usr/src/linux/driver/scsi/sd.c:184-196). Eytyxws yparxei kai h lista ari8mwn kai onomatwn odhgwn toy Peters Anvin sto /usr/src/linux/Documentation/devices.txt; koitajte tis anafores gia block syskeyes, meizwn 3, 22, 33, 34 gia IDE kai meizwn 8 gia SCSI diskoys. Oi meizwn kai mikroi ari8moi einai ena byte o ka8enas kai gia ayto o ari8mos katatmhsewn ana disko einai periorismenos.

Kata sumbash, ta arxeia syskeywn exoyn sygkekrimena onomata kai polla programmata exoyn gnwsh twn onomatwn aytwn kata th metaglwttish toys. Perimenoyn oi IDE diskoi na onomazontai /dev/hd* kai toys SCSI diskoys /dev/sd*. Oi diskoi ari8mountai ws a, b, c klp, opote to /dev/hda einai o prwtos IDE diskos kai o /dev/sda einai o prwtos sas SCSI diskos. Kai oi dyo syskeyes antiproswpeuoyn oloklhroys diskoys, jekinwntas apo to block ena. Grafontas stis syskeyes aytes me ta la8os ergaleia 8a katastrecei tis eggrafes ekkinhshs kai katatmhsewn, ka8istwntas ola ta dedomena ston disko mh prosbasima h kanontas to susthma sas adunato na jekinhsei. Na jerete ti kanete, kai jana, parte antigrafa prin kanete otidhpote.

Oi prwtarxikes katatmhseis toy diskoy einai oi 1, 2, 3 kai 4. Etsi /dev/hda1 einai h prwth prwtarxikh katatmhsh ston prwto IDE disko kok. Logikes katatmhseis exoyn noumera 5 kai anw, opote /dev/sdb5 einai h prwth logikh katatmhsh ston deutero SCSI disko.

Ka8e eggrafh ston pinaka katatmhsewn exei mia arxikh kai telikh dieu8ynsh kai enan tupo. O tupos einai enas ari8mhtikos kwdikos (ena byte) poy ka8orizei th sygkekrimenh katatmhsh se ena sygkekrimeno leitoyrgiko susthma. Oi kwdikoi katatmhsewn den einai monadikoi, opote yparxei h pi8anothta dyo leitoyrgika na xrhsimopoioun ton idio kwdiko.

To Linux xrhsimopoiei ton kwdiko 0x82 gia katatmhseis enallaghs kai 0x83 gia ”eggenh” systhmata arxeiwn (ext2 dhladh). To kapote dhmofiles alla twra parwxhmeno Linux/Minix susthma xrhsimopoiouse ton kwdiko 0x81. To OS/2 xrhsimopoiei ton tupo 0x07 kai to idio kai to NTFS susthma twn Windows NT. To MS-DOS xrhsimopoiei arketous kwdikous gia tis diafores ekdoseis toy FAT systhmatos toy: 0x01, 0x04 kai 0x06 einai gnwsta. To DR-DOS xrhsimopoiouse to 0x81 gia tis prostateyomenes FAT katatmhseis toy, dhmioyrgwntas problhmata me to Linux/Minix ston kairo toy, alla shmera oute to Linux/Minix oute kai to DR-DOS xrhsimopoiountai pia. H ektetamenh katatmhsh poy xrhsimopoieitai apo tis logikes katatmhseis exei kwdiko 0x05.

Oi katatmhseis dhmioyrgountai kai katastrefontai me to fdisk. Ka8e leitoyrgiko poy sebetai ton eayto toy exei ena fdisk poy paradosiaka kaleitai fdisk (h FDISK.EXE) sta perissotera systhmata. Merika fdisk, kyriws toy DOS, einai kapws periorismena otan xeirizontai katatmhseis allwn leitoyrgikwn. Tetoioi periorismoi exoyn na kanoyn me thn adynamia xeirismou otidhpote me jenoy kwdiko, me ari8mo kylindroy megalutero toy 1024 kai thn adynamia na dhmioyrghsoyn h na katalaboyn katatmhseis poy den teleiwnoyn se orio kylindroy. Gia paradeigma, to fdisk toy MS-DOS de mporei na sbhsei katatmhseis NTFS, to fdisk toy OS/2 exei anafer8ei oti kryfa ”dior8wnei” katatmhseis poy dhmioyrgh8hkan me to fdisk toy Linux poy den teleiwnoyn se orio kylindroy, enw kai ta duo, toy DOS kai toy OS/2, exoyn problhmata me diskoys me perissoteroys apo 1024 kylindroys (deite to ”large-disk” mini-howto gia leptomereies gia tetoioys diskoys).

3 Ti katatmhseis xreiazomai;

3.1 Poses katatmhseis xreiazomai;

Wraia, poses katatmhseis xreiazeste dhladh; Loipon, merika leitoyrgika systhmata de 8eloyn na jekinoun apo logikes katatmhseis gia logoys poy jefeugoyn ths logikhs. Etsi, pi8ana na 8elete na krathsete tis prwtarxikes katatmhseis sas gia thn ekkinhsh twn MS-DOS, OS/2 kai Linux h otidhpote allo xrhsimopoieite. 8ymh8eite oti mia prwtarxikh katatmhsh xreiazetai gia na ginei ektetamenh, wste na dra san doxeio gia tis logikes katatmhseis toy diskoy sas.

H ekkinhsh leitoyrgikwn systhmatwn perilambanei to BIOS kai toys periorismous twn 1024 kylindrwn. Etsi, mallon 8a 8elete na balete oles tis katatmhseis ekkinhshs stoys prwtoys 1024 kylindroys toy diskoy sas, wste na apofugete ta problhmata. 3ana, diabaste to ”large-disk” mini-howto, gia perissoteres leptomereies.

Gia na egkatasthsete to Linux, 8a xreiasteite toylaxiston mia katatmhsh. Ean o pyrhnas fortwnetai apo aythn thn katatmhsh (gia paradeigma apo to LILO), h katatmhsh ayth prepei na diabazetai apo to BIOS. Ean xrhsimopoieite alla mesa gia na fortwsete ton pyrhna (apo disketa ekkinhshs h me to LOADLIN.EXE mesw toy MS-DOS) h katatmhsh mporei na einai opoydhpote. Se opoiadhpote periptwsh, h katatmhsh 8a einai tupoy 0x83 ”Linux native”.

To susthma sas 8a xreiastei kai xwro enallaghs. Ektos ean xrhsimopoieite arxeia ws xwro enallaghs, 8a xreiasteite mia katatmhsh afierwmenh gia ayth th doyleia. Efoson h katatmhsh ayth xrhsimopoieitai apo ton pyrhna toy Linux kai o pyrhnas den exei tis adynamies toy BIOS, h katatmhsh ayth mporei na brisketai opoydhpote sto disko. Systhnw na xrhsimopoihsete mia logikh katatmhsh (/dev/?d?5 h megaluterh). Oi katatmhseis afierwmenes ws xwros enallaghs einai tupoy 0x82 ”Linux swap”.

Aytes einai oi elaxistes apaithseis. 8a htan xrhsimo na dhmioyrghsete perissoteres katatmhseis gia to Linux. Diabaste parakatw.

3.2 Poso megalos prepei na einai o xwros enallaghs;

Ean apofasisate na xrhsimopoihsete mia katatmhsh ws xwro enallaghs, poy genika einai Kalh Idea, akoloy8hste tis parakatw odhgies gia na ypologisete to mege8os ths:

• Sto Linux, h mnhmh RAM kai o xwros enallaghs xrhsimopoiountai ws to sunolo ths eikonikhs mnhmhs poy einai dia8esimh (kati poy den einai alh8eia gia ola ta Unix). Gia paradeigma an exete 8MB RAM kai 12MB xwro enallaghs, exete ena sunolo peripoy 20MB eikonikhs mnhmhs.

• Otan ka8orizete to mege8os toy xwroy enallaghs, 8a prepei na exete peripoy 16MB eikonikhs mnhmhs synolika. Etsi, gia 4MB RAM 8a xreiasteite toylaxiston 12MB ws xwro enallaghs, gia 8MB RAM 8a xreiasteite toylaxiston 8MB xwro enallaghs kok.

• Sto Linux, mia katatmhsh enallaghs de mporei na einai megaluterh apo 128MB. Dhladh, h katatmhsh mporei na einai megaluterh apo 128MB, alla o parapanw xwros de xrhsimopoieitai pote. Ean 8elete parapanw apo 128MB xwroy enallaghs, 8a xreiasteite pollaples katatmhseis.

• Otan dhmioyrgeite ton xwro enallaghs, 8ymh8eite oti polus xwros mporei na einai kai axrhstos. Ka8e diergasia exei ena ”sunolo ergasias”. Ayto to sunolo selidwn sth mnhmh 8a xrhsimopoih8ei apo ton epejergasth sto suntomo mellon. To Linux prospa8ei na problecei thn prosbash sth mnhmh (ypo8etontas oti oi teleytaia xrhsimopoihmenes selides 8a xrhsimopoih8oun jana suntoma) kai krata aytes tis selides sth RAM an einai dynaton. Ean to programma exei kalh ”topikothta anaforas” h ypo8esh ayth 8a einai swsth kai o algori8mos problechs 8a doylecei. To na krath8ei to sunolo ergasias sth mnhmh doyleuei mono ean yparxei arketh mnhmh RAM. Ean exete polles diergasies na trexoyn se ena mhxanhma, o pyrhnas anagkazetai na bazei selides ston disko poy 8a tis xrhsimopoihsei suntoma (anagkazontas thn ejodo mias selidas apo allo sunolo ergasias kai thn eisagwgh ths selidas poy zhteitai). Ayto synh8ws katalhgei se baria enallagh selidwn kai katakoryfh ptwsh ths apodoshs. Ena mhxanhma se ayth thn katastash legetai oti kanei ”thrashing”. Se ena tetoio mhxanhma oi diergasies trexoyn sthn oysia apo ton disko anti ths RAM. Etsi h apodosh peftei peripoy oso h sxesh metaju ths taxuthtas prosbashs mnhmhs kai ths taxuthtas prosbashs toy diskoy. Enas palios kanonas apo tis meres toy PDP kai toy Vax leei oti to sunolo ergasias enos programmatos einai to 25% toy eikonikou toy mege8oys. Gia ayto einai mallon askopo na exete xwro enallaghs megalutero apo treis fores to mege8os ths RAM. Prosejte omws oti aytos einai enas aplos kanonas. Einai eukolo na dhmioyrgh8oun senaria opoy programmata exoyn ejairetika megala h mikra sunola ergasias. Gia paradeigma ena programma ejomoiwshs exei megala sunola dedomenwn poy prosballontai tyxaia kai xwris kamia topikothta, etsi to sunolo ergasias einai polu megalo. Apo thn allh, to xv me arketa anoixta JPEG arxeia 8a exei ena polu megalo sunolo dedomenwn. Omws oi metasxhmatismoi 8a ginontai se ena mono arxeio, opote h perissoterh mnhmh poy katalambanetai apo to xv den prosballetai pote. To idio isxuei kai me enan epejergasth keimenoy me polla anoixta eggrafa, alla mono ena na dior8wnetai. Etsi, ta programmata ayta - an exoyn sxediastei swsta - exoyn polu megalh topikothta kai megala tmhmata toys mporoun na krath8oun sto xwro enallaghs xwris megalh ptwsh taxuthtas. 8a perimene kaneis oti to 25% apo thn epoxh ths grammhs entolwn de 8a einai swsto stis meres twn grafikwn periballontwn kai pollaplwn eggrafwn, alla den jerw gia nees meletes poy epibebaiwnoyn ayta ta noumera.

Etsi gia ena susthma me 16MB RAM, xwros enallaghs de xreiazetai gia mia elaxisth diamorfwsh kai panw apo 48MB einai mallon axrhsta. To akribes poso mnhmhs ejartatai apo to migma twn efarmogwn sto mhxanhma (ti perimenate;).

3.3 Pou prepei na balw to xwro enallaghs;

• Ta mhxanika einai arga, ta hlektronika einai grhgora.

Oi monternoi diskoi exoyn polles kefales. H metabash metaju kefalwn sto idio aylaki einai grhgorh, afou einai ka8ara hlektronikh. H metabash metaju aylakiwn einai argh, afou apaitei th metakinhsh fysikwn antikeimenwn. Etsi an exete ena disko me polles kefales kai enan me ligoteres me idies tis alles parametroys toys, o diskos me tis perissoteres kefales 8a einai grhgoroteros. Parola ayta, to na xwrisete to xwro enallaghs kai na ton moirasete stoys dyo diskoys 8a einai akoma grhgorotero.

• Oi palioteroi diskoi exoyn ton idio ari8mo tomewn se ola ta aylakia. Me aytous toys diskoys 8a einai pio grhgoro na balete to xwro enallaghs sth mesh toy diskoy, ypo8etontas oti h kefalh toy diskoy 8a kinh8ei apo mia tyxaia perioxh pros to xwro enallaghs.

• Oi neoteroi diskoi xrhsimopoioun ZBR (zone bit recording). Exoyn perissoteroys tomeis sta ejwterika aylakia. Me sta8ero ry8mo peristrofhs, ayto dinei shmantika ayjhmenh apodosh sta ejwterika aylakia se sxesh me ta eswterika. Balte to xwro enallaghs sta ejwterika aylakia.

• Fysika h kefalh toy diskoy de 8a kineitai tyxaia. Ean exete to xwro enallaghs sth mesoy toy diskoy, metaju mias polyasxolhs katatmhshs home kai mias sxedon axrhsimopoihths katatmhshs arxeioy, 8a htan kalutera na to balete sth mesh ths katatmhshs home, gia akoma mikroteres kinhseis ths kefalhs. Fysika 8a htan kalutera an eixate to xwro enallaghs se enan allo axrhsimopoihto disko.

Perilhch: Balte to xwro enallaghs se ena grhgoro disko me polles kefales poy den kanei alles doyleies. Ean exete pollous diskoys: moiraste to kai skorpiste to se oloys toys diskoys h akomh kai se diaforetikous elegktes.

Akomh kalutera: Agoraste perissoterh RAM.

3.4 Merika gegonota gia ta systhmata arxeiwn kai ton katakermatismo

O xwros sto disko diaxeirizetai apo to leitoyrgiko susthma se monades kai tmhmata enothtwn (blocks). Sto ext2, ta tmhmata kai oi enothtes prepei na exoyn to idio mege8os, opote mporoume na periorisoyme th syzhthsh mas stis enothtes.

Ta arxeia erxontai se opoiodhpote mege8os. De teleiwnoyn sta oria twn enothtwn. Etsi, gia ka8e arxeio, ena tmhma ths teleytaias enothtas xaramizetai. Ypo8etontas oti ta mege8h twn arxeiwn einai tyxaia, xaramizetai peripoy mish enothta gia ka8e arxeio poy yparxei sto disko sas. O Tanenbaum to onomazei ayto ”eswteriko katakermatismo” sto biblio toy ”Leitoyrgika systhmata”.

Mporeite na mantecete ton ari8mo twn arxeiwn ston disko sas apo ton ari8mo twn xrhsimopoihmenwn kombwn (inodes) toy diskoy sas.

     # df -i
     Filesystem           Inodes   IUsed   IFree  %IUsed Mounted on
     /dev/hda3              64256   12234   52022    19%  /
     /dev/hda5              96000   43058   52942    45%  /var

Yparxoyn peripoy 12000 arxeia sto / kai peripoy 44000 arxeia sto /var. Me mege8os kommatiou 1KB, peripoy 6+22 = 28MB xanontai sta telika kommatia twn arxeiwn. An eixa epilejei mege8os kommatiou 4KB, 8a eixa xasei 4 fores perissotero xwro.

H metafora dedomenwn, omws, einai grhgoroterh gia synexhs enothtes dedomenwn. Gia ayto, to ext2 prospa8ei na proana8esei to xwro se 8 synexhs enothtes gia epekteinomena arxeia. An o xwros de xrhsimopoih8ei eley8erwnetai, opote de xaramizetai ka8oloy xwros.

H asynexhs ana8esh kommatiwn se ena arxeio einai kakh gia thn apodosh, efoson ta arxeia diabazontai me ena synexh tropo. Ayto anagkazei to leitoyrgiko na moirasei thn prosbash sto disko kai thn kefalh na kinh8ei. Ayto onomazetai ”ejwterikos katakermatismos” h apla ”katakermatismos” kai einai ena syxno problhma se systhmata arxeiwn DOS.

To ext2 exei arketes strathgikes gia na apofugei ton ejwteriko katakermatismo. Kanonika, o katakermatismos den apotelei megalo problhma gia to ext2, akomh kai se katatmhseis bareas xrhshs opws to xwro newn toy USENET. An kai yparxei ena ergaleio apokatakermatismou gia to ext2, kaneis de to xrhsimopoiei kai de symbadizei me thn trexoysa ekdosh toy ext2. Xrhsimopoihste to, alla me dikh sas ey8unh.

To MS-DOS einai gnwsto gia thn pa8ologikh toy diaxeirish xwroy. Se syndyasmo me thn apu8menh buffer cache, oi epiptwseis toy katakermatismou arxeiwn sthn apodosh ginontai grhgora antilhptes. Oi xrhstes toy DOS einai synh8ismenoi ston apokatakermatismo toy diskoy ka8e liges ebdomades kai merikoi exoyn anaptujei eylabikes synh8eies kai pisteuw gia ton apokatakermatismo. Kamia apo aytes tis synh8eies de 8a prepei na metafer8ei sto Linux kai to ext2. Ta eggenh systhmata arxeiwn toy Linux de xreiazontai apokatakermatismo katw apo kanonikes syn8hkes, akomh kai se periptwseis me toylaxiston 5% eleu8ero xwro sto disko.

To MS-DOS xanei kai megales posothtes xwroy logw toy eswterikou katakermatismou. Gia katatmhseis anw twn 256KB, oi enothtes toy DOS ginontai toso megales poy einai praktika mh xrhsimopoihsimes (ayto exei dior8w8ei en merh me to FAT32).

To ext2 de sas anagkazei na xrhsimopoihsete megales enothtes gia megala systhmata arxeiwn, ektos gia polu megala systhmata arxeiwn sthn perioxh toy 0.5TB (dhladh terabytes me 1TB = 1024GB) kai anw, opoy oi mikres enothtes ginontai mh apodotikes. Etsi, se anti8esh me to DOS, den yparxei logos na xwrizete to disko se polles katatmhseis gia na krathsete to mege8os twn enothtwn mikro. Xrhsimopoihste to 1KB opoy einai dynaton. Isws na 8elete na xrhsimopoihsete ta 2KB gia merikes katatmhseis, alla na perimenete merika aprosdokhta problhmata.

3.5 Diarkeia zwhs arxeiwn kai kukloi antigrafwn asfaleias ws krithria katatmhsewn

Me to ext2, h katatmhseis prepei na ginoyn me bash toys periorismous gia antigrafa asfaleias kai gia thn apofygh ejwterikou katakermatismou logw ths diarkeias zwhs twn arxeiwn.

Ta arxeia exoyn diaforetikes diarkeies zwhs. Afou dhmioyrgh8ei ena arxeio, 8a parameinei sto susthma gia kapoio xroniko diasthma kai meta 8a afaire8ei. H diarkeia zwhs twn arxeiwn diaferei polu mesa sto susthma kai ejartatai, en merei, apo to xwro paramonhs toy arxeioy. Gia paradeigma, arxeia sta /bin, /sbin, /usr/bin, /usr/bin kai paromoioys katalogoys einai pi8anon na exoyn megalh diarkeia zwhs: arketous mhnes kai parapanw. Arxeia sto /home einai pi8ano na exoyn mia mesh diarkeia zwhs: peripoy arketes ebdomades. Arxeia sto /var einai synh8ws braxubia: sxedon kanena arxeio sto /var/spool/news de 8a parameinei gia perissoteres apo merikes meres, enw arxeia sto /var/spool/lpd exoyn diarkeia zwhs merika lepta h ligotero.

Gia antigrafa asfaleias einai xrhsimo to poso toy ka8hmerinou antigrafoy na einai mikrotero apo th xwrhtikothta toy enos mesoy. Ena ka8hmerino antigrafo mporei na einai eite oloklhro eite prosayjhtiko.

Mporeite na apofasisete na krathsete tis katatmhseis sas mikres gia na xwrane se ena meso (gia ka8hmerina plhrh antigrafa). Se opoiadhpote periptwsh ka8e katatmhsh 8a prepei na einai arketa mikrh wste ta ka8hmerina dedomena (ola ta allagmena arxeia) na xwrane se ena meso (epilejte prosayjhtiko antigrafo kai na perimenete na allazete meso gia to ebdomadiaio/mhniaio plhres antigrafo - den ginetai plhrhs aytomatopoihmenh ergasia).

H strathgikh antigrafwn ejartatai apo ayth thn apofash.

Otan sxediazete na agorasete diskoys, 8ymh8eite na krathsete arketa xrhmata gia ta antigrafa! Dedomena xwris antigrafa einai axrhsta! H anaparagwgh dedomenwn kostizei polu perissotero apo to antigrafo gia sxedon opoiondhpote!

Gia megaluterh apodosh einai xrhsimo na kratate arxeia me diaforetiko xrono zwhs se diaforetikes katatmhseis. Me ayto ton tropo ta braxubia arxeia sthn katatmhsh syzhthsewn 8a katakermatistoun polu. Ayto, omws, de 8a exei kamia epiptwsh sthn apodosh twn / h /home katatmhsewn.

4 Ena paradeigma

4.1 Proteinomeno montelo gia filodojoys arxarioys

Ena syxno montelo dhmioyrgei tis /, /home kai /var katatmhseis opws proanafer8hke. Einai arketa aplo sthn egkatastash kai synthrhsh kai diaforopoiei arketa tis katatmhseis wste na apofeyx8oun problhmata apo th diarkeia zwhs twn arxeiwn. Boleuei kai gia antigrafa: sxedon kanenas den krata antigrafo toy USENET kai mono merika arxeia toy /var ajizoyn na krath8oun (/var/spool/mail gia paradeigma). Apo thn allh, to / spania allazei kai mporei na antigrafei kata boulhsh (gia paradeigma meta apo allages sth diamorfwsh) kai einai arketa mikro gia na xwresei se ena monterno meso (peripoy 250 me 500MB, analoga me to poses efarmoges exoyn egkatasta8ei). To /home perilambanei polutima dedomena xrhstwn, opote 8a prepei na dhmioyrgeitai antigrafo ka8hmerina. Merikes egkatastaseis exoyn polu megala /home kai prepei na kanoyn prosayjhtika antigrafa.

Merika systhmata bazoyn to /tpm se jexwristh katatmhsh, enw alla dhmioyrgoun ena symboliko desmo sto /var/tmp gia na exoyn to idio apotelesma (shmeiwste oti ayto mporei na ephreasei to single user mode, opoy to /var de 8a einai dia8esimo mexri na dhmioyrgh8ei ena h na to anarthsete xeirokinhta sto /var) h to bazoyn se RAM disk (opws kanei to Solaris gia paradeigma). Ayto krata to /tmp ejw apo to /, mia kalh idea.

To montelo ayto einai boliko kai gia anaba8miseis h epanegkatastaseis: krathste ta arxeia diamorfwshs (h oloklhro to /etc) se kapoio /home katalogo, petajte to /, epanegkatasthsete kai janafortwste thn palia diamorfwsh apo to /home.

5 Pws to ekana sto mhxanhma moy

Eixa sto rafi enan palio ISA 386/40, poy egkateleica prin dyo xronia epeidh eixe texnologika jeperastei. Sxediaza na to kanw ena mikro ejyphreth xwris X-Windows gia to oikiako topiko moy diktyo.

Na pws to ekana: phra ton 386 kai toy ebala 16MB RAM. Pros8esa ena fthno EIDE disko, to mikrotero poy mporousa na brw (800MB), kai mia karta ethernet. Ebala kai mia palia karta grafikwn Hercules epeidh eixa akoma mia o8onh. Egkatesthsa to Linux kai etsi egine enas NFS, SMB, HTTP, LPD/LPR, NNTP server ka8ws kai diakomisths taxydromeioy kai ejyphrethths POP3. Me mia pros8eth ISDN karta to mhxanhma egine kai o TCP/IP router kai firewall.

O perissoteros xwros toy diskoy phge stoys katalogoys /var, /var/spool/mail, /var/spool/news kai /var/htppd/html. Ebala to /var se jexwristh, megalh katatmhsh. De 8a yparxoyn sxedon ka8oloy xrhstes sto mhxanhma, opote den ekana home katatmhsh alla thn prosarthsa sto /home apo kapoio allo sta8mo ergasias mesw NFS.

Linux xwris X-Windows syn arketa topika egkatesthmena ergaleia 8a einai mia xara me 250MB sto /. To mhxanhma exei 16MB RAM, alla 8a trexei pollous servers. 16MB xwroy enallaghs 8a einai aparaithta, 32MB 8a einai aneta. Xwro exoyme, opote to mhxanhma 8a parei 32MB. Gia synais8hmatikous logoys mia katatmhsh MS-DOS peripoy 20MB kratietai. Apofasisa na eisagw to /home apo allo mhxanhma, opote ta ypoloipa 500+MB 8a katalhjoyn ws /var. 8a einai parapanw apo arketa gia oikiakh trofodosia USENET.

Exoyme

     Device    Mount point                       Size
     /dev/hda1  /dos_c                           25 MB
     /dev/hda2  - (swap space)                   32 MB
     /dev/hda3  /                               250 MB
     /dev/hda4  - (extended partition)          500 MB
     /dev/hda5  /var                            500 MB
     homeserver:/home /home                     1.6 GB

Kanw ta antigrafa asfaleias toy mhxanhmatos mesw toy diktuoy xrhsimopoiwntas tainies sto homeserver. Efoson ola se ayto to mhxanhma exoyn egkatasta8ei apo CD-ROM ta mona poy prepei na swsw einai ta arxeia diamorfwshs apo to /etc, ta parametropoihmena moy, topika egkatesthmena *.tgz arxeia apo to

/root/Source/Installed kai ta /var/spool/mail kai /var/httpd/html. Ta antigrafw se ena katalogo

/home/backmeup ston homeserver ka8e nuxta, opoy to programmatismeno antigrafo gia ton homeserver ta grafei.