Next Previous Contents

11. NFS server se mia disketa

Ayth h enothta grafhke apo ton Ron Peters, rpeters@hevanet.com. Ejhgei pws na sthsoyme enan NFS server, otan bootaroyme apo disketa. Arxika h enothta sxediasthke me skopo na deijei pws mporoume na exoyme (mesw NFS) koinh xrhsh toy cd-rom enos alloy H/Y (poy den sthrizetai se Linux/UNIX), wste na egkatasthsoyme to Linux ston prwto H/Y, poy den dia8etei cd-rom.

11.1 Eisagwgh

Ayto to keimeno grafthke gia osoys synanthsoyn to idio problhma, poy eixa ki egw prosfata : Esthna enan Linux server s' enan H/Y poy den die8ete cd-rom, kai den mporousa na toy pros8esw ena, ektos isws ejwteriko SCSI, h kati paromoio. Twra, poy einai olo kai pio api8ano na egkatasthsete to Linux s' ena tetoio mhxanhma, ayto to keimeno mporei na mhn einai pleon toso polutimo. Wstoso, proswpika 8a to ektimousa, an to die8eta otan prospa8ousa na ftiajw ton H/Y moy.

Mia poy o H/Y moy den die8ete cd-rom, skefthka na brw enan NFS server gia ta Win95, kai na krathsw koinh xrhsh toy cd-rom gia oso xreiastei na ftiajw ton H/Y me to Linux, kai na ton balw sto diktyo. Apo ta duo proionta poy brhka (den anaferw onomata, alla to ena htane freeware kai to allo me periorismenh adeia xrhshs 14 hmerwn), to ena den doulece ka8oloy, kai to allo den mporese na xeiristei arketa kala ta sumfwna me to Linux onomata twn H/Y, wste na oloklhrwsei thn egkatastash.

Meta ap' ayta, prospa8hsa na jekinhsw ton H/Y moy twn Win95 me tis duo disketes boot/root, kai meta na balw mia boh8htikh disketa, wste na sthsw ton NFS server.

Ayto apodeixthke polu aplo, kai h olh diadikasia einai pi8anotata eykoloterh apo to na diabasete aythn thn eisagwgh, alla pisteuw oti 8a boh8hsei to na ta gracw ola mazi kapoy.

11.2 Prosdokies

Ayto to keimeno bghke apo th xrhsh twn disketwn boot/root mias apo tis twrines dianomes toy Slackware Linux apo thn InfoMagic. Xrhsimopoihsa thn ekdosh 2.0.34 toy pyrhna stis disketes boot/root, alla ta programmata toy NFS server par8hkan apo enan server ekdoshs 2.0.30 . Panta xrhsimopoiousa th me8odo egkatastashs toy Slackware, oxi epeidh einai eykoloterh, h kaluterh, h xeiroterh, alla apla epeidh ais8anomai aneta mazi ths, kai den exw brei ton xrono na dokimasw kapoia allh.

Den pisteuw na yparjoyn polla problhmata kata th xrhsh aytou toy keimenoy, se sxesh me thn ekdosh toy Linux. Pantws, 8a synistousa na xrhsimopoihsete kapoia sxetika sugxronh. Mia poy einai pi8ano oti 8a xrhsimopoih8ei gia egkatastash, einai ej isoy pi8ano na xrhsimopoih8ei ena sugxrono set boot/root disketwn.

Oloi oi syndyasmoi syzhtiontai.

11.3 Apaithseis

11.4 Sthsimo toy server

Ekkinhsh toy proswrinou NFS server

3ekiname me thn disketa ekkinhshs ton H/Y poy einai NFS server, kai bebaiwnomaste oti anagnwrizetai h karta diktuoy. Epishs, prepei n' anagnwristei kai to cd-rom. 8a xrhsimopoihsw to eth0 gia thn perigrafh ths kartas diktuoy.

Kanoyme mount sth disketa kai sto cd-rom

Afou jekinhsei o H/Y, den xreiazomaste tis disketes boot/root. To LS brisketai sth RAM.

Antika8istoume th disketa ekkinhshs me th boh8htikh disketa. Kanoyme mount sth disketa :

mount /dev/fd0 /floppy

Ayto proupo8etei oti h disketa einai tupoy ext2 filesystem. Fantazomai oti mporei kai na einai kai tupoy DOS, me ta aparaithta arxeia epanw ths, alla den to exw dokimasei ayto akomh. Pisteuw oti kati tetoio einai eykolotero apo to na asxoleisai me disk image. S' ayth thn periptwsh, 8a htan : mount -t msdos ...etc. Pi8anon na prepei na ta gracw ayta sthn enothta "pros energeia".

Kanoyme mount sto cd-rom :

mount -t iso9660 /dev/hdc /cdrom

Ta devices disketas kai cd-rom einai ayta poy xrhsimopoihsa ki egw. Mporei na diaferoyn, analoga thn efarmogh. Ta mount points /floppy kai /cdrom yparxoyn hdh sto image ths root disketas, ara mporoume na ta xrhsimopoihsoyme. An den yparxoyn, ftiajte ta, h xrhsimopoieiste opoia mount points sas aresoyn.

Sthnoyme th diktuwsh ston proswrino server

S' ayto to shmeio, sthnoyme ton proswrino NFS server, gia na milhsei sto diktyo. 8a dwsoyme elaxistes entoles. Yparxoyn, omws, kamposa pragmata, poy prepei na gnwrizete, prin dwsete tis entoles aytes (oi times mpainoyn apla ws paradeigmata) :

IPADDR:172.16.5.100 #Ayth einai h dieu8ynsh diktuoy toy proswrinou server.

NETMASK:255.255.255.0 #Ayth einai h maska diktuoy.

BROADCAST:172.16.5.255 #O teleytaios ari8mos (255) einai shmantikos gia thn IPADDR.

ETHNETWORK:172.16.5.0 #Akomh mia fora, enas ari8mos elaxista diaforetikos apo thn IPADDR.

GATEWAY:172.16.5.251 #Xreiazetai monon an dia8etete gateway. Ta perissotera spitika diktya den dia8etoyn.

Oi entoles gia na synde8oume me to diktyo. Bazoyme tis times, opws tis blepoyme parapanw :

ifconfig eth0 inet IPADDR arp netmask NETMASK broadcast BROADCAST

route add -net ETHNETWORK netmask NETMASK eth0

Xrhsimopoieiste thn epomenh entolh, mono an dia8etete gateway kai prepei na perasete apo mesa ths :

route add default gw GATEWAY netmask 0.0.0.0 eth0

An ola pane kala, twra briskeste sto diktyo, kai 8a prepei na mporeite na kanete ping s' alloys H/Y.

Ry8mizoyme thn koinh xrhsh toy NFS

Ka8orizoyme to directory poy 8eloyme na exoyme koino mesw toy NFS. (Sthn periptwsh toy paradeigmatos moy, xrhsimopoihsa to /cdrom/slakware.) Bazoyme ayto to directory sto arxeio /etc/exports :

echo "/cdrom/slakware" > /etc/exports

11.5 Trexoyme ton NFS server

Pame sto /floppy/usr/sbin kai trexoyme :

Ton ./rpc.portmap

Ton ./rpc.mountd

Ton ./rpc.nfsd

Entajei, jekiname thn egkatastash

Twra, logika prepei na exoyme koinh xrhsh toy directory "/cdrom/slakware", poy gracame sto arxeio /etc/exports. Afou ginei ayto, mporoume na ekkinhsoyme ton H/Y, opoy 8a kanoyme thn egkatastash, me tis disketes boot/root (proswpika, xrhsimopoihsa tis idies, me tis opoies jekinhsa kai ton NFS server), kai n' arxisoyme thn egkatastash.

Otan 8a eisaste etoimoi na dialejete thn phgh twn arxeiwn egkatastashs, dialejte ton NFS server. 8a erwth8eite gia thn dieu8ynsh ip toy server. Dwste th dieu8ynsh poy balate ws IPADDR toy server. Epishs, 8a erwth8eite kai gia to directory to opoio 8a ginei mount. Ayto einai to directory poy gracate sto arxeio /etc/exports toy NFS server.

Meta ap' ayta, o H/Y 8a kanei mount ton NFS server. Dwste prosoxh gia tyxon mhnumata la8oys. Mexris edw, logika einai ola swsta, kai mporeite na synexisete thn egkatastash.

11.6 Epilysh problhmatwn

Tipote edw akomh

Den exw akomh yliko gia epilysh problhmatwn. Isws, oso oi anagnwstes xrhsimopoioun th diadikasia poy perigrafetai, na bre8oun perissotera boh8hmata kai ypodeijeis.

11.7 Pros energeia

Disketa DOS

Dokimaste mia disketa DOS gia boh8htikh disketa.

Entoles rpc

Dokimaste n' allajete seira sthn ektelesh twn entolwn rpc.* , kai ean xreiazetai na trejoyn merikes, h oles toys.


Next Previous Contents