InstallingandOperating4.2BSDontheVAX July21,1983 SamuelJ.Leffler WilliamN.Joy ComputerSystemsResearchGroup DepartmentofElectricalEngineeringandComputerScience UniversityofCalifornia,Berkeley Berkeley,California94720 (415)642-7780 ABSTRACT Thisdocumentcontainsinstructionsfortheinstallationandoperationof the4.2BSDreleaseoftheVAX*UNIX**system,asdistributedbyU.C.Berkeley. ItdiscussesproceduresforinstallingUNIXonanewVAX,andforupgradinganexistingVAXUNIXsystemtothenewrelease.Anexplanationofhowto howtolayoutfilesystemsonavailabledisks,howtosetupterminallinesand useraccounts,andhowtoperformsystem-specifictailoringisprovided.A descriptionofhowtoinstallandconfigurethenetworkingfacilitiesincludedwith 4.2BSDisincluded.Finally,thedocumentdetailssystemoperationprocedures— shutdownandstartup,hardwareerrorreportinganddiagnosis,filesystembackup procedures,resourcecontrol,performancemonitoring,andproceduresforrecompilingandreinstallingsystemsoftware. *DEC,VAX,IDC,UNIBUSandMASSBUSaretrademarksofDigitalEquipmentCorporation. **UNIXisaTrademarkofBellLaboratories. 9April1993 Installing/Operating4.2BSD-2- Introduction 1.INTRODUCTION Thisdocumentexplainshowtoinstallthe4.2BSDreleaseoftheBerkeleyversionofUNIX fortheVAXonyoursystem.Duetothenewfilesystemorganizationusedin4.2BSD,nomatter whatversionofUNIXyoumaycurrentlyberunningyouwillhavetoperformafullbootstrap fromthedistributiontape;thetechniquesforconverting‘‘old’’systemsarediscussedinachapter 3ofthisdocument. 0.1.Hardwaresupported ThisdistributioncanbebootedonaVAX11/780,VAX11/750,orVAX11/730cpuwith anyofthefollowingdisks: DECMASSBUS:RM03,RM05,RM80,RP06,RP07 EMULEXMASSBUS:AMPEX300M,330M,CDC300M,FUJITSU404M DECUNIBUS:RK07,RA80,RA81,RA60 EMULEXSC-21VUNIBUS*:AMPEX300M,330M,CDC300M,FUJITSU160M,404M DECIDC:R80,RL02 Thetapedrivessupportedbythisdistributionare: DECMASSBUS:TE16,TU45,TU77,TU78 DECUNIBUS:TS11,TU80 EMULEXTC-11UNIBUS:KENNEDY9300,CIPHER TU45UNIBUS*:SI9700 ThetapesanddisksmaybeonanyavailableUNIBUSorMASSBUSadapteratanyslot withtheprovisothatthetapedevicemustbeslavenumber0ontheformatterifitisaMASS-BUStapedrive. 0.2.Distributionformat Thebasicdistributioncontainsthefollowingitems: (2)1600bpi2400’magnetictapes, (1)TU58consolecassette,and (1)RX01consolefloppydisk. Installationonanymachinerequiresatapeunit.SincecertainstandardVAXpackagesdonot includeatapedrive,thismeansonemusteitherborrowonefromanotherVAXsystemorone mustbepurchasedseparately.Theconsolemediadistributedwiththesystemarenotsuitablefor useasthestandardconsolemedia;theirintendeduseisonlyforinstallation. ThedistributiondoesnotfitonseveralstandardVAXconfigurationswhichcontainonlysmalldisks.Ifyourhardwareconfigurationdoesnotprovideatleast75Megabytesof diskspaceyoucanstillinstallthedistribution,butyouwillprobablyhavetooperatewithout sourcefortheuserlevelcommandsand,possibly,thesourcefortheoperatingsystem.ThepreviousRK07-onlydistributionformatprovidedbyourgroupisnolongeravailable.Further,no attempthaseverbeenmadetoinstallthesystemonthestandardVAX-11/730hardwareconfigu-rationfromDECwhichcontainsonlydualRL02diskdrives(thoughthedistributiontapemaybe bootstrappedonanRL11controllerandthesystemprovidessupportforRL02diskdriveseither onanIDCoranRL11).Thelabelsonthetwodistributiontapesindicatetheamountofdisk *OtherUNIBUScontrollersanddrivesmaybeeasilyusablewiththesystem,butwilllikelyrequire minormodificationstothesystemtoallowbootstrapping.TheEMULEXdiskandSItapecontrollers,andthedrivesshownhereareknowntoworkasbootstrapdevices. 9April1993 Installing/Operating4.2BSD-3- Introduction spaceeachtapefileoccupies,theseshouldbeusedinselectingfilesystemlayoutsonsystemswith littlediskspace. Ifyouhavethefacilities,itisagoodideaimmediatelytocopythemagnetictapesinthe distributionkittoguardagainstdisaster.Thetapesare9-track1600BPIandcontainsome 512-byterecordsfollowedbymany10240-byterecords.Thereareinterspersedtapemarks;end-of-tapeissignaledbyadoubleend-of-file. Thebasicbootstrapmaterialispresentinthreeshortfilesatthebeginningofthebootstrap tape.Thefirstfileonthetapecontainspreliminarybootstrappingprograms.Thisisfollowedby abinaryimageofa400kilobyte‘‘miniroot’’filesystem.Followingtheminirootfileisafull dumpoftherootfilesystem(seedump(8)**).Additionalfilesonthefirstandsecondtapescontaintapearchiveimages(seetar(1)):thefourthfileonthefirsttapecontainssourceforthesystem(/sys);thefifthfileonthefirsttapecontainsmostofthefilesinthefilesystem/usr,except thesource(/usr/src)whichisinthefirstfileonthesecondtape.Thesecondfileonthesecond tapecontainssoftwarecontributedbytheusercommunity,refertotheaccompanyingdocumentationforadescriptionofitscontentsandanexplanationofhowitshouldbeinstalled. 0.3.VAXhardwareterminology ThissectiongivesashortdiscussionofVAXhardwareterminologytohelpyougetyour bearings. IfyouhaveMASSBUSdisksandtapesitisnecessarytoknowtheMASSBUStheyare attachedto,atleastforthepurposesofbootstrappingandsystemdescription.TheMASSBUSes canhaveupto8devicesattachedtothem.Adiskcountsasadevice.Atapeformattercounts asadevice,andseveraltapedrivesmaybeattachedtoaformatter.Ifyouhaveaseparate MASSBUSadapterforadiskandoneforatapethenitisconventionaltoputthediskasunit0 ontheMASSBUSwiththelowest‘‘TR’’number,andthetapeformatterasunit0onthenext MASSBUS.Ona11/780thiswouldcorrespondtohavingthediskon‘‘mba0’’at‘‘tr8’’andthe tapeon‘‘mba1’’at‘‘tr9’’.HeretheMASSBUSadapterwiththelowestTRnumberhasbeen called‘‘mba0’’andtheonewiththenextlowestnumberiscalled‘‘mba1’’. TofindouttheMASSBUSyourtapeanddiskareonyoucanexaminethecablingandthe unitnumbersoryoursitemaintenanceguide.Donotbefooledintothinkingthatthenumberon thefrontofthetapedriveisadevicenumber;itisaslavenumber,oneofseveralpossibletapes onthesingletapeformatter.Forbootstrappingtheslavenumbermustbe0.Theformatterunit numbermaybeanythingdistinctfromtheothernumbersonthesameMASSBUS,butyoumust knowwhatitis. TheMASSBUSdevicesareknownbyseveraldifferentnamesbyDECsoftwareandby UNIX.Atvarioustimesitisnecessarytoknowbothnames.Thereis,ofcourse,thenameofthe devicelike‘‘RM03’’or‘‘RM80’’;theseareeasytorememberbecausetheyareprintedonthefront ofthedevice.DECalsogivesdevicesnamesbythenamesofthedriverinthesystemusinga namingconventionthatreflectstheinterconnecttopologyofthemachine.Thefirstletterofsuch anameisa‘‘D’’foradisk,thesecondletterdependsonthetypeofthedrive,‘‘DR’’forRM03, RM05,andRM80’s,‘‘DB’’forRP06’s.Thenextletterisrelatedtotheinterconnect;DECcalls thefirstMASSBUSadapter‘‘A’’,thesecond‘‘B’’,etc.Thus‘‘DRA’’isaRMdriveonthefirst MASSBUSadapter.Finally,thenameendsinadigitcorrespondingtotheunitnumberforthe deviceontheMASSBUS,i.e.‘‘DRA0’’isadiskatthefirstdeviceslotonthefirstMASSBUS adapterandisaRMdisk. 0.4.UNIXdevicenaming UNIXhasasetofnamesfordevices,whicharedifferentfromtheDECnamesforthe devices,viz.: **ReferencesoftheformX(Y)meanthesubsectionnamedXinsectionYoftheUNIXprogrammer’s manual. 9April1993 Installing/Operating4.2BSD-4- Introduction RM/RPdiskshp TE/TUtapesht TU78tapemt Thenormalstandalonesystem,usedtobootstrapthefullUNIXsystem,usesdevicenames: xx(y,z) wherexxiseitherhp,ht,ormt.ThevalueyspecifiestheMASSBUStouseandalsothedevice. Itiscomputedas 8*mba+device Thusmba0device0wouldhaveayvalueof0whilemba1device0wouldhaveayvalueof8. Thezvalueisinterpreteddifferentlyfortapesanddisks:fordisksitisadiskpartition(inthe range0-7),andfortapesitisafilenumberonthetape. EachUNIXphysicaldiskisdividedinto8logicaldiskpartitions,eachofwhichmayoccupy anyconsecutivecylinderrangeonthephysicaldevice.Thecylindersoccupiedbythe8partitions foreachdrivetypearespecifiedinsection4oftheprogrammersmanualandinthediskdescriptionfile/etc/disktab(c.f.disktab(5)).*Eachpartitionmaybeusedforeitherarawdataarea suchasapagingareaortostoreaUNIXfilesystem.Itisconventionalforthefirstpartitionona disktobeusedtostorearootfilesystem,fromwhichUNIXmaybebootstrapped.Thesecond partitionistraditionallyusedasapagingarea,andtherestofthediskisdividedintospacesfor additional‘‘mountedfilesystems’’byuseofoneormoreadditionalpartitions. Thethirdlogicalpartitionofeachphysicaldiskalsohasaconventionalusage:itallows accesstotheentirephysicaldevice,includingthebadsectorforwardinginformationrecordedat theendofthedisk(onetrackplus126sectors).Itisoccasionallyusedtostoreasinglelargefile systemortoaccesstheentirepackwhenmakingacopyofitonanother.Caremustbetaken whenusingthispartitiontonotoverwritethelastfewtracksandtherebyclobberthebadsector information. Thediskpartitionshavenamesinthestandalonesystemoftheform‘‘hp(x,y)’’withvarying yasdescribedabove.Thuspartition1ofaRM05onmba0atdrive0wouldbe‘‘hp(0,1)’’.When notrunningstandalone,thispartitionwouldnormallybeavailableas‘‘/dev/hp0b’’.Heretheprefix‘‘/dev’’isthenameofthedirectorywhereall‘‘specialfiles’’normallylive,the‘‘hp’’servesan obviouspurpose,the‘‘0’’identifiesthisasapartitionofhpdrivenumber‘‘0’’andthe‘‘b’’identifiesthisasthefirstpartition(wherewenumberfrom0,the0’thpartitionbeing‘‘hp0a’’.) Inallsimplecases,adrivewithunitnumber0(initsunitplugonthefrontofthedrive) willbecalledunit0initsUNIXfilename.Thisisnot,however,strictlynecessary,sincethesystemhasalevelofindirectioninthisnaming.Thiscanbetakenadvantageoftomakethesystem lessdependentontheinterconnecttopology,andtomakereconfigurationafterhardwarefailure extremelyeasy.Wewillnotdiscussthatnow. Returningtothediscussionofthestandalonesystem,werecallthattapesalsotooktwo integerparameters.Inthenormalcasewherethetapeformatterisunit0onthesecondmba (mba1),thefilesonthetapehavenames‘‘ht(8,0)’’,‘‘ht(8,1)’’,etc.Here‘‘file’’meansatapefile containingasingledatastream.Thedistributiontapeshavedatastructuresinthetapefilesand thoughthetapescontainonly6tapefiles,theycontainseveralthousandUNIXfiles. FortheUNIBUS,therearealsoconventionalnames.TheimportantDECnamestoknow areDM??forRK07drivesandDU??fordrivesonaUDA50.Forexample,RK07drive0ona controlleronthefirstUNIBUSonthemachineis‘‘DMA0’’.UNIXcallssuchadevicea‘‘hk’’and thestandalonenameforthefirstpartitionofsuchadeviceis‘‘hk(0,0)’’.Ifthecontrollerwereon thesecondUNIBUSitsnamewouldbe‘‘hk(8,0)’’.Ifwewishedtoaccessthefirstpartitionofa *Itispossibletochangethepartitionsbychangingthecodeforthetableinthediskdriver;sinceitis oftendesirabletodothisitisclearthatthesetablesshouldbereadoffeachpack;theymaybeina futureversionofthesystem. 9April1993 Installing/Operating4.2BSD-5- Introduction RK07drive1onuba0wewoulduse‘‘hk(1,0)’’. TheUNIBUSdiskandtapenamesusedbyUNIXare: RKdiskshk TStapests UDAdisksra IDCdisksrb SMDdisksup TMtapestm TUtapesut HereSMDdisksaredisksonanRMemulatingcontrollerontheUNIBUS,andTMtapes aretapesonacontrollerthatemulatestheDECTM-11.TUtapesaretapesonacontrollerthat emulatestheDECTU45.IDCdisksaredisksonan11/730IntegralDiskController.TStapes aretapesonacontrollerthatemulatestheDECTS-11(e.g.aTU80).Thenamingconventions forpartitionsinUNIBUSdisksandfilesinUNIBUStapesarethesameasthoseforMASSBUS disksandtapes. 0.5.UNIXdevices:blockandraw UNIXmakesadistinctionbetween‘‘block’’and‘‘raw’’(character)devices.Eachdiskhasa blockdeviceinterfacewherethesystemmakesthedevicebyteaddressableandyoucanwritea singlebyteinthemiddleofthedisk.Thesystemwillreadoutthedatafromthedisksector, insertthebyteyougaveitandputthemodifieddataback.Thediskswiththenames ‘‘/dev/xx0a’’,etcareblockdevices.Therearealsorawdevicesavailable.Thesehavenameslike ‘‘/dev/rxx0a’’,the‘‘r’’herestandingfor‘‘raw’’.Inthebootstrapprocedureswewilloftensuggest usingtherawdevices,becausethesetendtoworkfasterinsomecases.Ingeneral,however,the blockdevicesareused.Theyarewherefilesystemsare‘‘mounted’’. Youshouldbeawarethatitissometimesimportanttousethecharacterdevice(forefficiency)ornot(becauseitwouldn’twork,e.g.towriteasinglebyteinthemiddleofasector). Don’tchangetheinstructionsbyusingthewrongtypeofdeviceindiscriminately. 9April1993 Installing/Operating4.2BSD-6- Bootstrapping 2.BOOTSTRAPPROCEDURE Thissectionexplainsthebootstrapprocedurethatcanbeusedtogetthekernelsupplied withthistaperunningonyourmachine.EvenifyouarecurrentlyrunningUNIXyouwillhaveto doafullbootstrap. IfyouarealreadyrunningUNIXyoushouldfirstsaveyourexistingfilesonmagnetictape. 4.2BSDusesatotallydifferentfilesystemorganizationthanpreviousversionsofthesystem;itis thusnecessarytorebuildthefilesystemformatbeforerestoringthedata.Theeasiestwaytosave thecurrentfilesontapeisbydoingafulldumpandthenrestoringunderthenewsystem.Refer tochapter3inunderstandinghowtoupgradeanexisting4BSDsystem. Bootingfromtape Thetapebootstrapprocedureusedtocreateaworkingsysteminvolvesthefollowingmajor steps: 1)Formatadiskpackwiththeformatprogram. 2)Copya‘‘miniroot’’filesystemfromthetapeontotheswapareaofthedisk. 3)BoottheUNIXsystemonthe‘‘miniroot’’. 4)Restorethefullrootfilesystemusingrestore(8). 5)Buildaconsolefloppyorcassetteforbootstrapping. 6)Rebootthecompletedrootfilesystem. 7)Buildandrestorethe/usrfilesystemfromtapewithtar(1). Certainofthesestepsaredependentonyourhardwareconfiguration.Formattingthedisk packusedfortherootfilesystemmayrequireusingtheDECstandardformattingprograms. Also,ifyouarebootstrappingthesystemonan11/750,noconsolecassetteiscreated. Thefollowingsectionsdescribetheabovestepsindetail.Inthesesectionsreferencestodisk drivesareoftheformxx(n,m)andreferencestofilesontapedrivesareoftheformyy(n,m)where xxandyyareoneofthenamesdescribedinsection1.4andnandmaretheunitandoffsetnumbersdescribedinsection1.4.Commandsyouareexpectedtotypeareshowninroman,while thatinformationprintedbythesystemisshownemboldened.Throughouttheinstallationsteps therebootswitchonan11/780or11/730shouldbesettooff;onan11/750setthepower-on actiontohalt.(Innormaloperationan11/780or11/730willhavetherebootswitchonandan 11/750willhavethepower-onactionsettoreboot/restart.) Ifyouencounterproblemsinfollowingtheinstructionsinthispartofthedocument,referto AppendixCforhelpintroubleshooting. 2.1.Step1:formattingthedisk Alldisksusedwith4.2BSDshouldbeformattedtoinsuretheproperhandlingofphysically corrupteddisksectors.IfyouhaveDECdiskdrives,youshouldusethestandardDECformatter toformatyourdisks.Ifnot,theformatprogramincludedinthedistribution,oravendorsuppliedformattingprogram,maybeusedtoformatdisks.Theformatprogramiscapableofformattinganyofthefollowingsupporteddistributiondevices: EMULEXMASSBUS:AMPEX300M,330M,CDC300M,FUJITSU404M EMULEXSC-21VUNIBUS:AMPEX300M,330M,CDC300M,FUJITSU160M,404M Ifyouhaverunapre-4.1BSDversionofUNIXonthepacksyouareplanningtousefor bootstrappingitislikelythatthebadsectorinformationonthepackshasbeendestroyed,sinceit wasaccessibleasnormaldatainthelastseveraltracksofthedisk.Youshouldthereforerunthe formatteragaintomakesuretheinformationisvalid. 9April1993 Installing/Operating4.2BSD-7- Bootstrapping Onan11/750,touseadiskpackasabootstrapdevice,sectors0through15,thedisksectorsinthefiles‘‘/vmunix’’(thesystemimage)and‘‘/boot’’(theprogramthatloadsthesystem image),andthefilesystemindicesthatleadtothesetwofilesmustnothaveanyerrors.Onan 11/780or11/730,the‘‘boot’’programisloadedfromtheconsolemediumandincludesdevice driversforthe‘‘hp’’and‘‘up’’diskswhichperformECCcorrectionandbadsectorforwarding; consequently,onthesemachinesthesystemmaybebootstrappedonthesedisksevenifthediskis noterrorfreeincriticallocations.Ingeneral,ifthefirst15884sectorsofyourdiskarecleanyou aresafe;ifnotyoucantakeyourchances. Toloadtheformatprogram,insertthedistributionTU58cassetteorRX01floppydiskin theappropriateconsoledevice(onthe11/730usecassette0)andperformthefollowingsteps. Ifyouhavean11/780givethecommands: >>>HALT >>>UNJAM >>>LOADFORMAT >>>START2 Ifyouhavean11/750givethecommands: >>>I >>>BDDA0 =format Ifyouhavean11/730givethecommands: >>>H >>>I >>>LDD0:FORMAT >>>S2 Theformatprogramshouldnowberunningandawaitingyourinput: Diskformat/checkutility Enabledebugging(1=bse,2=ecc,3=bse+ecc)? IfyoumadeamistakeloadingtheprogramofftheTU58cassettethe‘‘=’’promptshould reappearandyoucanretypetheprogramname.Ifsomethingelsehappened,youmayhaveabad distributioncassetteorfloppy,oryourhardwaremaybebroken;refertoAppendixCforhelpin troubleshooting.Ifyouareunabletoloadprogramsoffthedistributedmedium,consult AppendixBforanalternate(morepainful)approach. Formatwillcreatesectorheadersandverifytheintegrityofeachsectorformattedbyusing thediskcontroller’s‘‘writecheck’’command.Rememberformatrunsonlyontheupandhp drivesindicatedabove.Formatwillpromptfortheinformationrequiredasshownbelow.Ifyou makeamistakeinansweringquestions,‘‘#’’erasesthelastcharactertyped,and‘‘@’’erasesthe currentinputline. 9April1993 Installing/Operating4.2BSD-8- Bootstrapping Enabledebugging(0=none,1=bse,2=ecc,3=bse+ecc)? Devicetoformat?xx(0,0) ...(theoldbadsectortableisread;ignoreanyerrorsthatoccurhere)... Formattingdrivexx0onadaptor0:verify(yes/no)?yes Devicedata:#cylinders=842,#tracks=20,#sectors=48 Availabletestpatternsare: 1-(f00f)RH750worstcase 2-(ec6d)mediaworstcase 3-(a5a5)alternating1’sand0’s 4-(ffff)Severeburnin(takesseveralhours) Pattern(oneoftheabove,othertorestart)?2 Startformatting...makesurethedriveisonline ...(softecc’sandothererrorsarereportedastheyoccur)... ...(if4writecheckerrorswerefound,theprogramterminateslikethis)... Errors: Writecheck:4 Badsector:0 ECC:0 Skipsector:0 Totalof4harderrorsfound. Writingbadsectortableatblock524256 (524256istheblock#ofthefirstblockinthebadsectortable) Done Oncetherootdevicehasbeenformatted,formatwillpromptforanotherdisktoformat.Haltthe machinebytyping‘‘control-P’’and‘‘H’’(the‘‘H’’isnecessaryonlyonan11/780,butdoesnot hurtontheothermachines). Enabledebugging(1=bse,2=ecc,3=bse+ecc)?ˆ P >>>H Itmaybenecessarytoformatotherdrivesbeforeconstructingfilesystemsonthem;thiscan bedoneatalatertimewiththestepsjustperformed.Formatcanalsobeusedinanextended testmode(pattern4)thatusesnumeroustestpatternsin46passestodetectasmanydisksurface errorsaspossible;thistestrunsformanyhours,dependingontheCPUandcontroller.Onan 11/780,thiscanbespeededupsignificantlybysettingtheclockfast. 2.2.Step2:copyingthemini-rootfilesystem Thesecondstepistorunasimpleprogram,copy,whichcopiesaverysmallrootfilesystem intothesecondpartitionofthedisk.Thisfilesystemwillserveasthebaseforcreatingtheactual rootfilesystemtoberestored.Theversionoftheoperatingsystemmaintainedonthe‘‘miniroot’’filesystemunderstandsnottoswapontopofitself,therebyallowingdoubleuseofthedisk partition.Copyisloadedjustastheformatprogramwasloaded;forexample,onan11/780: (copyminirootfilesystem) >>>LOADCOPY >>>START2 From:yy(y,1) (unity,secondtapefile) To:xx(x,1) (minirootisondrivex;secondpartition) Copycompleted:205recordscopied From: whileforan11/750: 9April1993 Installing/Operating4.2BSD-9- Bootstrapping (copyminirootfilesystem) >>>BDDA0 =copy From:yy(y,1) (unity,secondtapefile) To:xx(x,1) (minirootisondrivex;secondpartition) Copycompleted:205recordscopied From: andforan11/730: (copyminirootfilesystem) >>>LDD0:COPY >>>S2 From:yy(y,1) (unity,secondtapefile) To:xx(x,1) (minirootisondrivex;secondpartition) Copycompleted:205recordscopied From: (Asabove,‘#’erasescharactersand‘@’eraseslines.) 2.3.Step3:bootingfromthemini-rootfilesystem Younowhavetheminimalsetoftoolsnecessarytocreatearootfilesystemandrestorethe filesystemcontentsfromtape.Toaccessthisfilesystemloadthebootstrapprogramandboot theversionofunixwhichhasbeenplacedinthe‘‘mini-root’’: (loadbootstrapprogram) >>>LOADBOOT >>>START2 Boot :xx(x,1)vmunix(bringinvmunixoffminiroot) or,onan11/750: (loadbootstrapprogram) >>>BDDA0 =boot Boot :xx(x,1)vmunix(bringinvmunixoffminiroot) or,onan11/730: (loadbootstrapprogram) >>>LDD0:BOOT >>>S2 Boot :xx(x,1)vmunix(bringinvmunixoffminiroot) (Asabove,‘#’erasescharactersand‘@’eraseslines.) Thestandalonebootprogramshouldthenreadthesystemfromtheminirootfilesystemyoujust created,andthesystemshouldboot: 9April1993 Installing/Operating4.2BSD-10- Bootstrapping 215564+64088+69764start0xf98 4.2BSDUNIX#1:SunFeb615:02:15PST1983 realmem=xxx availmem=yyy ...informationaboutavailabledevices... rootdevice? Thefirstthreenumbersareprintedoutbythebootstrapprogramsandarethesizesofdifferentpartsofthesystem(text,initializedanduninitializeddata).Thesystemalsoallocatesseveralsystemdatastructuresafteritstartsrunning.Thesizesofthesestructuresarebasedonthe amountofavailablememoryandthemaximumcountofactiveusersexpected,asdeclaredina systemconfigurationdescription.Thiswillbediscussedlater. UNIXitselfthenrunsforthefirsttimeandbeginsbyprintingoutabanneridentifyingthe releaseandversionofthesystemthatisinuseandthedateitwascompiled. Nextthememmessagesgivetheamountofreal(physical)memoryandthememoryavailabletouserprogramsinbytes.Forexample,ifyourmachinehasonly512Kbytesofmemory, thenxxxwillbe523264,1024byteslessthan512K.Thesystemreservesthelast1024bytesof memoryforuseinerrorlogginganddoesn’tcountitaspartofrealmemory. Themessagesthatcameoutnextshowwhatdeviceswerefoundonthecurrentprocessor. Thesemessagesaredescribedinautoconf(4).Thedistributedsystemmaynothavefoundallthe communicationsdevicesyouhave(dh’sanddz’s),orallthemassstorageperipheralsyouhaveif youhavemorethantwoofanything.Thiswillbecorrectedsoon,whenyoucreateadescription ofyourmachinetoconfigureUNIXfrom.Themessagesprintedatbootherecontainmuchofthe informationthatwillbeusedincreatingtheconfiguration.Inacorrectlyconfiguredsystemmost oftheinformationpresentintheconfigurationdescriptionisprintedoutatboottimeasthesystemverifiesthateachdeviceispresent. The‘‘rootdevice?’’promptwasprintedbythesystemandisnowaskingyouforthenameof therootfilesystemtouse.Thishappensbecausethedistributionsystemisagenericsystem.It canbebootstrappedonanyVAXcpuandwithitsrootdeviceandpagingareaonanyavailable diskdrive.Youshouldrespondtotherootdevicequestionwithxx0*.Thisresponsesuppliestwo piecesofinformation:first,xx0indicatesthediskitisrunningonisdrive0oftypexx,secondly the‘‘*’’indicatesthesystemisrunning‘‘atop’’thepagingarea.Thelatterismostimportant, otherwisethesystemwillattempttopageontopofitselfandchaoswillensue.Youwilllater buildasystemtailoredtoyourconfigurationthatwillnotaskthisquestionwhenitisbootstrapped. rootdevice?xx0* WARNING:preposteroustimeinfilesystem−−CHECKANDRESETTHEDATE! eraseˆ ?,killˆ U,intrˆ C # The‘‘erase...’’messageispartof/.profilethatwasexecutedbytherootshellwhenit started.Thismessageispresenttoremindyouthatthelinecharactererase,lineerase,andinterruptcharactersaresettobewhatisstandardonDECsystems;thisinsuresthingsareconsistent withtheDECconsoleinterfacecharacters. 2.4.Step4:restoringtherootfilesystem UNIXisnowrunning,andthe‘UNIXProgrammer’smanual’applies.The‘#’isthe promptfromtheshell,andletsyouknowthatyouarethesuper-user,whoseloginnameis‘‘root’’. Tocompleteinstallationofthebootstrapsystemtwostepsremain.First,therootfilesystem mustbecreated,andsecondabootfloppyorcassettemustbeconstructed. Tocreatetherootfilesystemtheshellscript‘‘xtr’’shouldberunasfollows: 9April1993 Installing/Operating4.2BSD-11- Bootstrapping #disk=xx0type=tttape=yyxtr wherexx0isthenameofthediskonwhichtherootfilesystemistoberestored(unit0),ttisthe typeofdriveonwhichtherootfilesystemistoberestored(seethetablebelow),andyyisthe nameofthetapedriveonwhichthedistributiontapeismounted. Iftherootfilesystemistoresideonadiskotherthanunit0(asshownintheinformation printedoutduringautoconfiguration),youwillhavetocreatethenecessaryspecialfilesin/dev andusetheappropriatevalue.Forexample,iftherootshouldbeplacedonhp1,youmustcreate /dev/rhp1aand/dev/hp1ausingmknod(8). DriveTypeDriveType DECRM03type=rm03DECRM05type=rm05 DECRM80type=rm80DECRP06type=rp06 DECRP07type=rp07DECRK07type=rk07 DECRA80type=ra80DECRA60type=ra60 DECRA81type=ra81DECR80type=rb80 CDC9766type=9766CDC9775type=9775 AMPEX300Mtype=9300AMPEX330Mtype=capricorn FUJITSU160Mtype=fuji160FUJITSU404Mtype=eagle Thiswillgeneratemanymessagesregardingtheconstructionofthefilesystemandtherestoration ofthetapecontents,butshouldeventuallyterminatewiththemessages: ... Rootfilesystemextracted Ifthisisa780,updatefloppy Ifthisisa730,updatethecassette # 2.5.Step5:creatingabootfloppyorcassette Ifthemachineisan11/780or11/730,abootfloppyorcassetteshouldbeconstructed accordingtotheinstructionsinchapter4.For11/750’s,bootstrappingisperformedbyusinga bootpromandspecialcodelocatedinsectors0-15oftherootfilesystem.Thenewfsprogram automaticallyinstallstheneededcode,soyoumaycontinueontothenextstep.Onan11/780 withinterleavedmemory,orotherconfigurationsthatrequirealterationofthestandardbootfiles, thisstepmaybeleftforlater. 2.6.Step6:rebootingthecompletedrootfilesystem Withtheaboveworkcompleted,allthatisleftistoreboot: 9April1993 Installing/Operating4.2BSD-12- Bootstrapping #sync (synchronizefilesystemstate) #ˆ P (haltmachine) >>>HALT (for11/780’sonly) >>>UNJAM (for11/780’sonly) >>>I (initializeprocessorstate) >>>BxxS (onan11/750,useB/2) ...(bootprogramiseventuallyloaded)... Boot :xx(x,0)vmunix (vmunixbroughtinoffroot) 215564+64088+69764start0xf98 4.2BSDUNIX#1:SunFeb615:02:15PST1983 realmem=xxx availmem=yyy ...informationaboutavailabledevices... rootonxx0 WARNING:preposteroustimeinfilesystem−−CHECKANDRESETTHEDATE! eraseˆ ?,killˆ U,intrˆ C # (seesection6.1ifthesystemdoesnotrebootproperly) Thesystemisnowrunningsingleuserontheinstalledrootfilesystem.Thenextsection tellshowtocompletetheinstallationofdistributedsoftwareonthe/usrfilesystem. 2.7.Step7:settingupthe/usrfilesystem Firstsetashellvariabletothenameofyourdisk,sothecommandswegivewillwork regardlessofthediskyouhave;dooneof #disk=hp(ifyouhaveanRP06,RM03,RM05,RM80,orotherMASSBUSdrive) #disk=hk(ifyouhaveRK07s) #disk=ra(ifyouhaveUDA50storagemoduledrives) #disk=up(ifyouhaveUNIBUSstoragemoduledrives) #disk=rb(ifyouhaveIDCstoragemoduledrives) Thenextthingtodoistoextracttherestofthedatafromthetape.Youmightwishto reviewthediskconfigurationinformationinsection4.4beforecontinuing;thepartitionsused belowarethosemostappropriateinsize.Findthediskyouhaveinthefollowingtableandexecutethecommandsintherighthandportionofthetable: 9April1993 Installing/Operating4.2BSD-13- Bootstrapping DECRM03#name=hp0g;type=rm03 DECRM05#name=hp0g;type=rm05 DECRM80#name=hp0g;type=rm80 DECRP06#name=hp0g;type=rp06 DECRP07#name=hp0h;type=rp07 DECRK07#name=hk0g;type=rk07 DECRA80#name=ra0h;type=ra80 DECRA60#name=ra0h;type=ra60 DECRA81#name=ra0h;type=ra81 DECR80#name=rb0h;type=rb80 UNIBUSCDC9766#name=up0g;type=9766 UNIBUSAMPEX300M#name=up0g;type=9300 UNIBUSAMPEX330M#name=up0g;type=capricorn UNIBUSFUJITSU160M#name=up0g;type=fuji160 UNIBUSFUJITSU404M#name=up0h;type=eagle MASSBUSCDC9766#name=hp0g;type=9766 MASSBUSAMPEX300M#name=hp0g;type=9300 MASSBUSAMPEX330M#name=hp0g;type=capricorn MASSBUSFUJITSU404M#name=hp0h;type=eagle Findthetapeyouhaveinthefollowingtableandexecutethecommandsintherighthandportion ofthetable: DECTE16/TU45/TU77#cd/dev;MAKEDEVht0;sync DECTU78#cd/dev;MAKEDEVmt0;sync DECTS11#cd/dev;MAKEDEVts0;sync EMULEXTC11#cd/dev;MAKEDEVtm0;sync SI9700#cd/dev;MAKEDEVut0;sync Thenexecutethefollowingcommands 9April1993 Installing/Operating4.2BSD-14- Bootstrapping #dateyymmddhhmm(setdate,seedate(1)) .... #passwdroot(setpasswordforsuper-user) Newpassword:(passwordwillnotecho) Retypenewpassword: #newfs${name}${type}(createemptyuserfilesystem) (thistakesafewminutes) #mount/dev/${name}/usr(mounttheusrfilesystem) #cd/usr (make/usrthecurrentdirectory) #mkdirsys(makedirectoryforsystemsource) #cdsys (make/usr/systhecurrentdirectory) #mtfsf #tarxpbf20/dev/rmt12(extractthesystemsource) (thistakesabout5-10minutes) #cd.. (backto/usr) #mtfsf #tarxpbf20/dev/rmt12(extractallofusrexceptusr/src) (thistakesabout15-20minutes) #cd/ (backtoroot) #chmod755//usr/usr/sys #rm−fsys #ln−s/usr/syssys(makeasymboliclinktothesystemsource) #umount/dev/${name}(unmount/usr) Thedataonthefourthandfifthtapefileshasnowbeenextractedandthefirstreelofthedistributionisnolongerneeded.Theremainderoftheinstallationprocedureusesthesecondreelof tapewhichshouldbemountedinplaceofthefirst. Youcanchecktheconsistencyofthe/usrfilesystembydoing #fsck/dev/r${name} Theoutputfromfsckshouldlooksomethinglike: **/dev/rxx0h **LastMountedon/usr **Phase1-CheckBlocksandSizes **Phase2-CheckPathnames **Phase3-CheckConnectivity **Phase4-CheckReferenceCounts **Phase5-CheckCylgroups 671files,3497used,137067free(75frags,34248blocks) Ifthereareinconsistenciesinthefilesystem,youmaybepromptedtoapplycorrective action;seethedocumentdescribingfsckforinformation. Tousethe/usrfilesystem,youshouldnowremountitbysaying #/etc/mount/dev/${name}/usr Youcannowextractthefirstfileonthesecondtape(thesourceforthecommands).Ifyouhave RK07’syoumustfirstputaformattedpackindrive1andsetupaUNIXfilesystemonitby doing: #newfshk1grk07 (thistakesafewminutes) #mount/dev/hk1g/usr/src #cd/usr/src Inanycaseyoucanthenextractthesourcecodeforthecommands(exceptonRK07’sthiswillfit 9April1993 Installing/Operating4.2BSD-15- Bootstrapping inthe/usrfilesystem): #mkdir/usr/src #chmod755/usr/src #cd/usr/src #tarxpb20 Ifyougetanerroratthispoint,youcanrepositionthetapewiththefollowingcommandandtry theabovecommandsagain. #mtrew 2.8.Additionalsoftware Therearethreeextratapefilesonthedistributiontapeswhichhavenotbeeninstalledto thispoint.TheyareafontlibraryforusewithVarianandVersatecprinters,theIngresdatabase system,andusercontributedsoftware.Allthreetapesfilesareintar(1)formatandcanbe installedbypositioningthetapeandreadinginthefilesaswasdonefor/usr/srcabove.Asdistributed,thefontsshouldbeplacedinadirectory/usr/lib/vfont,theIngressystemshouldbe placedin/usr/ingres,andtheusercontributedsoftwareshouldbeplacedin/usr/src/new.The exactcontentsoftheusercontributedsoftwareisgiveninaseparatedocument. 9April1993 Installing/Operating4.2BSD-16-Upgradinga4BSDsystem 3.UPGRADINGA4BSDSYSTEM Beginbyreadingtheotherpartsofthisdocumenttoseewhathaschangedsincethelast timeyoubootstrappedthesystem.Alsoreadthe‘‘Changesin4.2BSD’’document,andlookat thenewmanualsectionsprovidedtoyou.Ifyouhavelocalsystemmodificationstothekernelto install,lookatthedocument‘‘Kernelchangesin4.2BSD’’togetanideaofhowthesystem changeswillaffectyourlocalmods. Ifyouarerunningaversionofthesystemdistributedpriorto4.0BSD,youareprettymuch onyourown.Sitesrunning3BSDor32/Vmaybeabletomodifytherestorprogramtounderstandtheold512byteblockfilesystem,butthishasneverbeentried.Thissectionassumesyou arerunning4.1BSD. 3.1.Step1:whattosave Nomatterwhatversionofthesystemyoumayberunning,youwillhavetorebuildyour rootandusrfilesystems.Theeasistwaytodothisistosavetheimportantfilesonyourexisting system,performabootstrapasifyouwereinstalling4.2BSDonabrandnewmachine,thenmerge thesavedfilesintothenewsystem.Thefollowinglistenumeratesthestandardsetoffilesyou willwanttosaveandindicatesdirectoriesinwhichsitespecificfilesshouldbepresent.Thislist willlikelybeaugmentedwithnon-standardfilesyouhaveaddedtoyoursystem;besuretodoa tarofthedirectories/etc,/lib,and/usr/libtoguardagainstyourmissingsomethingthefirst timearound. /.profilerootshstartupscript /.loginrootcshstartupscript /.cshrcrootcshstartupscript /dev/MAKEfortheLOCALcaseformakingdevices /etc/fstabdiskconfigurationdata /etc/groupgroupdatabase /etc/passwduserdatabase /etc/rcforanylocaladditions /etc/ttysterminallineconfigurationdata /etc/ttytypeterminallinetoterminaltypemappingdata /etc/termcapforanylocalentrieswhichmayhavebeenadded /libforanylocallydevelopedlanguageprocessors /usr/dict/*forlocaladditionstowordsandpapers /usr/include/*forlocaladditions /usr/lib/aliasesmailforwardingdatabase /usr/lib/crontabcrondaemondatabase /usr/lib/font/*forlocallydevelopedfontlibraries /usr/lib/lint/*forlocallydevelopedlintlibraries /usr/lib/tabset/*forlocallydevelopedtabsettingfiles /usr/lib/term/*forlocallydevelopednroffdrivetables /usr/lib/tmac/*forlocallydevelopedtroff/nroffmacros /usr/lib/uucp/*forlocaluucpconfigurationfiles /usr/man/manlformanualpagesforlocallydevelopedprograms /usr/msgsforcurrentmsgs /usr/spool/*forcurrentmail,news,uucpfiles,etc. /usr/src/localforsourceforlocallydevelopedprograms As4.1BSDbinaryimageswillrununchangedunder4.2BSDyoushouldbecertaintosaveany programssuchascompilerswhichyouwillneedinbootstrappingto4.2BSD.* *4.2BSDcansupporta‘‘4.1BSDcompatibilitymode’’ofsystemoperationwherebysystemcallsfrom 9April1993 Installing/Operating4.2BSD-17-Upgradinga4BSDsystem Onceyouhavesavedtheappropriatefilesinaconvenientformat,thenextstepistodump yourfilesystemswithdump(8).Fortheutmostofsafetythisshouldbedonetomagtape.However,ifyouenjoygamblingwithyourlife(oryouhaveaVERYfriendlyusercommunity)andyou havesufficientdiskspace,youcantryconvertingyourfilesystemsin-placebyusingadiskparti-tion.Ifyouselectthelattertact,aversionofthe4.1BSDdumpprogramwhichrunsunder4.2is providedin/etc/dump.4.1;besuretoreadthroughthisentiredocumentbeforebeginningthe conversion.Bewarethatfilesystemscreatedunder4.2BSDwilluseabout5-10%morediskspace forfilesystemrelatedinformationthanunder4.1BSD.Thus,beforedumpingeachfilesystemit isagoodideatoremoveanyfileswhichmaybeeasilyregenerated.Sincemostallprogramswill likelyberecompiledunderthenewsystemyourbestbetistoremoveanyobjectfiles.Filesystemswithatleast10%freespaceonthemshouldrestoreintoanequivalentlysized4.2BSDfile systemwithoutproblem. Onceyouhavedumpedthefilesystemsyouwishtoconvertto4.2BSD,installthesystem fromthebootstraptapeasdescribedinchapter2,thenproceedtothenextsection. 3.2.Step2:merging Whenyoursystemisbootingreliablyandyouhavethe4.2BSDrootand/usrfilesystems fullyinstalledyouwillbereadytoproceedtothenextstepintheconversionprocess:merging youroldfilesintothenewsystem. Usingthetartape,ortapes,youcreatedinstep1extracttheappropriatefilesintoascratch directory,say/usr/convert: #mkdir/usr/convert #cd/usr/convert #tarx Certaindatafiles,suchasthosefromthe/etcdirectory,maysimplybecopiedintoplace. #cppasswdgroupfstabttysttytype/etc #cpcrontab/usr/lib Otherfiles,however,mustbemergedintothedistributedversionsbyhand.Inparticular,be carefulwith/etc/termcap. ThecommandskeptundertheLOCALentryin/dev/MAKEshouldbeplacedinthenew shellscript/dev/MAKEDEV.localsothatsaying‘‘MAKEDEVLOCAL’’willcreatetheappropriatelocaldevicesanddevicenames.Ifyouhaveanyhomegrowndevicedriverswhichusemajor devicenumbersreservedbythesystemyouwillhavetomodifythecommandsusedtocreatethe devicesoralterthesystemdeviceconfigurationtablesin/sys/vax/conf.c. Thespoolingdirectoriessavedontapemayberestoredintheireventualrestingplaceswithouttoomuchconcern.Besuretousethe‘p’optiontotarsothatfilesarerecreatedwiththe samefilemodes: #cd/usr #tarxpmsgsspool/mailspool/uucpspool/uucppublicspool/news Whateverelseisleftislikelytobesitespecificorrequirecarefulscrutinybeforeplacingin itseventualrestingplace.Refertothedocumentationandsourcecodebeforearbitrarilyoverwritingafile. 4.1BSDareeitheremulatedorsafelyignored.Thereareonlytwoexceptions;programswhichread directoriesorusetheoldjobslibrarywillnotoperateproperly.However,while4.1BSDbinarieswill executeunder4.2BSDitisSTRONGLYRECOMMENDEDthattheprogramsberecompiled underthenewsystem.Refertothedocument‘‘Changesin4.2BSD’’forelaborationonthispoint. 9April1993 Installing/Operating4.2BSD-18-Upgradinga4BSDsystem 3.3.Step3:convertingfilesystems Thedumpformatusedin4.0and4.1BSDisupwardcompatiblewiththatusedin4.2BSD. Thatis,the4.2BSDrestoreprogramunderstandshowtoreadolddumptapes,although4.2BSD dumptapesmaynotbeproperlyrestoredunder4.0BSDor4.1BSD.Toconvertafilesystem dumpedtomagtape,simplycreatetheappropriatefilesystemandrestorethedata.Notethat the4.2BSDrestoreprogramdoesitsworkonamountedfilesystemusingnormalsystemoperations(unliketheolderrestorwhichaccessedtherawfilesystemdeviceanddepositedinodesinthe appropriatelocationsondisk).Thismeansthatfilesystemdumpsmayberestoredevenifthe characteristicsofthefilesystemchanged.Torestoreadumptapefor,say,the/afilesystem somethinglikethefollowingwouldbeused: #mkdir/a #newfshp1geagle #mount/dev/hp1g/a #cd/a #restorer Iftarimageswerewritteninsteadofdoingadump,youshouldbesuretousethe‘p’optionwhen readingthefilesback.Nomatterhowyourestoreafilesystem,besureandcheckitsintegrity withfsckwhenthejobiscomplete. 3.4.Bootstrappinglanguageprocessors Toconvertacompilerfrom4.1BSDto4.2BSDyoushouldsimplyhavetorecompileand relinkthevariousparts.Iftheprocessoriswritteninitself,forinstanceaPASCALcompiler writteninPASCAL,theimportantstepinconvertingistosaveaworkingcopyofthe4.1BSD binarybeforeconvertingto4.2BSD.Then,oncethesystemhasbeenchangedover,the4.1BSD binaryshouldbeusedintherebuildingprocess.Inordertodothis,youshouldenablethe4.1 compatibilityoptionwhenyouconfigurethekernel(below). Ifnoworking4.1BSDbinaryexists,orthelanguageprocessorusessomenonstandardsystemcall,youwilllikelyhavetocompilethelanguageprocessorintoanintermediateform,suchas assemblylanguage,ona4.1BSDsystem,thenbringtheintermediateformto4.2BSDforassembly andloading. 9April1993 Installing/Operating4.2BSD-19- Systemsetup 4.SYSTEMSETUP ThissectiondescribesproceduresusedtosetupaVAXUNIXsystem.Proceduresdescribed hereareusedwhenasystemisfirstinstalledorwhenthesystemconfigurationchanges.Proceduresfornormalsystemoperationaredescribedinthenextsection. 4.1.MakingaUNIXbootfloppy Ifyouhavean11/780youwillwanttocreateaUNIXbootfloppybyaddingsomefilestoa copyofyourcurrentDECconsolefloppy,usingflcopy(8)andarff(8).Thisfloppywillmakestandalonesystemoperationssuchasbootstrappingmucheasier. Firstchangeintothedirectorywheretheconsolefloppyinformationisstored: #cd/sys/floppy thensetupthedefaultbootdevice.IfyouhaveanRK07asyourprimaryrootdo: #cpdefboo.hkdefboo.cmd IfyouhaveadriveonaUDA50(e.g.anRA81)asyourprimaryrootdo: #cpdefboo.radefboo.cmd IfyouhaveasecondvendorUNIBUSstoragemoduleasyourprimaryrootdo: #cpdefboo.updefboo.cmd Otherwise: #cpdefboo.hpdefboo.cmd Ifthelocalconfigurationrequiresanychangesinrestar.cmdordefboo.cmd(e.g.,forinterleaved memorycontrollers),theseshouldbemadenow.Thefollowingcommandwillthencopyyour DEClocalconsolefloppy,updatingthecopyappropriately. #makeupdate ChangeFloppy,Hitreturnwhendone. (waitsforyoutoputcleanfloppyinconsole) Areyousureyouwanttoclobberthefloppy?yes Morecopiesofthisfloppycanbemadeusingflcopy(8). 4.2.MakingaUNIXbootcassette Ifyouhavean11/730youwillwanttocreateaUNIXbootcassettebyaddingsomefilesto acopyofyourcurrentDECconsolecassette,usingflcopy(8)andarff(8).Thiscassettewillmake standalonesystemoperationssuchasbootstrappingmucheasier. Firstchangeintothedirectorywheretheconsolecassetteinformationisstored: #cd/sys/cassette thensetupthedefaultbootdevice.IfyouhaveanIDCstoragemoduleasyourprimaryrootdo: #cpdefboo.rbdefboo.cmd IfyouhaveanRK07asyourprimaryrootdo: #cpdefboo.hkdefboo.cmd IfyouhaveadriveonaUDA50asyourprimaryrootdo: #cpdefboo.radefboo.cmd Otherwise: 9April1993 Installing/Operating4.2BSD-20- Systemsetup #cpdefboo.updefboo.cmd TocompletetheprocedureplaceyourDEClocalconsolecassetteindrive0(thedriveatfrontof theCPU);thefollowingcommandwillthencopyit,updatingthecopyappropriately. #makeupdate ChangeFloppy,Hitreturnwhendone. (waitsforyoutoputcleancassetteinconsoledrive0) Areyousureyouwanttoclobberthefloppy?yes Morecopiesofthiscassettecanbestbemadeusingdd(1). 4.3.Kernelconfiguration Thissectionbrieflydescribesthelayoutofthekernelcodeandhowfilesfordevicesare made.Forafulldiscussionofconfiguringandbuildingsystemimages,consultthedocument ‘‘Building4.2BSDUNIXSystemswithConfig’’. 4.3.1.Kernelorganization Asdistributed,thekernelsourceisinaseparatetarimage.Thesourcemaybephysically locatedanywherewithinanyfilesystemsolongasasymboliclinktothelocationiscreatedfor thefile/sys(manyfilesin/usr/includearenormallysymboliclinksrelativeto/sys).Infurther discussionsofthesystemsourceallpathnameswillbegivenrelativeto/sys. Thedirectory/sys/syscontainsthemainlinemachineindependentoperatingsystemcode. Fileswithinthisdirectoryareconventionallynamedwiththefollowingprefixes. initsysteminitialization kernkernel(authentication,processmanagement,etc.) quotadiskquotas syssystemcallsandsimilar ttyterminalhandling ufsfilesystem uipcinterprocesscommunication vmvirtualmemory Theremainingdirectoriesareorganizedasfollows. /sys/hmachineindependentincludefiles /sys/confsiteconfigurationfilesandbasictemplates /sys/netnetworkindependent,butnetworkrelatedcode /sys/netinetDARPAInternetcode /sys/netimpIMPsupportcode /sys/netpupPUP-1supportcode /sys/vaxVAXspecificmainlinecode /sys/vaxifVAXnetworkinterfacecode /sys/vaxmbaVAXMASSBUSdevicedriversandrelatedcode /sys/vaxubaVAXUNIBUSdevicedriversandrelatedcode Manyofthesedirectoriesarereferencedthrough/usr/includewithsymboliclinks.For example,/usr/include/sysisasymboliclinkto/sys/h.Thesystemcode,asdistributed,istotally independentoftheincludefilesin/usr/include.Thisallowsthesystemtoberecompiledfrom scratchwithoutthe/usrfilesystemmounted. 9April1993 Installing/Operating4.2BSD-21- Systemsetup 4.3.2.Devicesanddevicedrivers DevicessupportedbyUNIXareimplementedinthekernelbydriverswhosesourceiskeptin /sys/vax,/sys/vaxuba,or/sys/vaxmba.Thesedriversareloadedintothesystemwhenincluded inacpuspecificconfigurationfilekeptintheconfdirectory.Devicesareaccessedthroughspecial filesinthefilesystem,madebythemknod(8)programandnormallykeptinthe/devdirectory. Forallthedevicessupportedbythedistributionsystem,thefilesin/devarecreatedbythe /dev/MAKEDEVshellscript. Determinethesetofdevicesthatyouhaveandcreateanew/devdirectorybyrunningthe MAKEDEVscript.Firstcreateanewdirectory/newdev,copyMAKEDEVintoit,editthefile MAKEDEV.localtoprovideanentryforlocalneeds,andrunittogeneratea/newdevdirectory. Forinstance,ifyourmachinehasasingledz-11,asingledh-11,asingledmf-32,anrm03disk,an EMULEXcontroller,anAMPEX-9300disk,andate16tapedriveyouwoulddo: #cd/ #mkdirnewdev #cpdev/MAKEDEVnewdev/MAKEDEV #cdnewdev #MAKEDEVdz0dh0dmf0hp0up0ht0stdLOCAL Notethe‘‘std’’argumentcausesstandarddevicessuchas/dev/console,themachineconsole, /dev/floppy,theconsolefloppydiskinterfaceforthe11/780,and/dev/tu0and/dev/tu1,theconsolecassetteinterfacesforthe11/750and11/730,tobecreated. Youcanthendo #cd/ #mvdevolddev;mvnewdevdev #sync toinstallthenewdevicedirectory. 4.3.3.Buildingnewsystemimages ThekernelconfigurationofeachUNIXsystemisdescribedbyasingleconfigurationfile, storedinthe/sys/confdirectory.Tolearnabouttheformatofthisfileandtheprocedureusedto buildsystemimages,startbyreading‘‘Building4.2BSDUNIXSystemswithConfig’’,lookatthe manualpagesinsection4oftheUNIXmanualforthedevicesyouhave,andlookattheconfigurationfilesinthe/sys/confdirectory. Theconfiguredsystemimage‘‘vmunix’’shouldbecopiedtotheroot,andthenbootedtotry itout.Itisbesttonameit/newvmunixsoasnottodestroytheworkingsystemuntilyou’resure itdoeswork: #cpvmunix/newvmunix #sync Itisalsoagoodideatokeeptheoldsystemaroundundersomeothername.Inparticular,we recommendthatyousavethegenericdistributionversionofthesystempermanentlyas/genvmunixforuseinemergencies. Tobootthenewversionofthesystemyoushouldfollowthebootstrapproceduresoutlined insection6.1.Asystematicschemefornumberingandsavingoldversionsofthesystemisbest. 4.4.Diskconfiguration Thissectiondescribeshowtolayoutfilesystemstomakeuseoftheavailablespaceandto balancediskloadforbettersystemperformance. 9April1993 Installing/Operating4.2BSD-22- Systemsetup 4.4.1.Initializing/etc/fstab Changeintothedirectory/etcandcopytheappropriatefilefrom: fstab.rm03 fstab.rm05 fstab.rm80 fstab.ra60 fstab.ra80 fstab.ra81 fstab.rb80 fstab.rp06 fstab.rp07 fstab.rk07 fstab.up160m(160Mbupdrives) fstab.up300m(300Mbupdrives) fstab.hp400m(400Mbhpdrives) fstab.up(otherupdrives) fstab.hp(otherhpdrives) tothefile/etc/fstab,i.e.: #cd/etc #cpfstab.xxxfstab Thiswillsetuptheinitialinformationabouttheusageofdiskpartitions,whichweseehow toupdatemorebelow. 4.4.2.Disknaminganddivisions Eachphysicaldiskdrivecanbedividedintoupto8partitions;UNIXtypicallyusesonly3 or4partitions.Forinstance,onanRM03orRP06,thefirstpartition,hp0a,isusedforarootfile system,abackupthereof,orasmallfilesystemlike,/tmp;thesecondpartition,hp0b,isusedfor pagingandswapping;andthethirdpartitionhp0gholdsauserfilesystem.OnanRM05,the firstthreepartitionsareusedasfortheRM03,andthefourthpartition,hp0h,isusedtoholdthe /usrfilesystem,includingsourcecode. Thediskpartitionsizesforadrivearebasedonasetoffourdefaultpartitiontables;c.f. diskpart(8).Theparticulartableusedisdependentonthesizeofthedrive.The‘‘a’’partitionis thesamesizeacrossalldrives,15884sectors.The‘‘b’’partition,usedforpagingandswapping,is sizedaccordingtothetotalspaceonthedisk.Fordriveslessthanabout400megabytesthepartitionis33440sectors,whileforlargerdrivesthepartitionsizeisdoubledto66880sectors.The ‘‘c’’partitionisalwaysusedtoaccesstheentirephysicaldisk,includingthespaceatthebackof thediskreservedforthebadsectorforwardingtable.Ifthediskislargerthanabout250 megabytes,an‘‘h’’partitioniscreatedwithsize291346sectors,andnomatterwhetherthe‘‘h’’ partitioniscreatedornot,theremainderofthedriveisallocatedtothe‘‘g’’partition.Sites whichwanttosplitupthe‘‘g’’partitionintoanumberofsmallerfilesystemsmayusethe‘‘d’’, ‘‘e’’,and‘‘f’’partitionswhichoverlapthe‘‘g’’partition.Thedefaultsizesforthesepartitionsare 15884,55936,andtheremainderofthedisk,respectively*. 4.4.3.Spaceavailable Thespaceavailableonadiskvariesperdevice.Theamountofspaceavailableonthecommondiskpartitionsislistedinthefollowingtable.Notshowninthetablearethepartitionsof eachdrivedevotedtotherootfilesystemandthepagingarea. *Theserulesare,unfortunatelynotevenlyappliedtoalldisks.DrivesonDECUDA50andIDCcontrollersdonotcompletelyfollowtheserules;inparticular,theswappartitiononanRA81isonly 33440sectors,andno‘‘d’’,‘‘e’’,or‘‘f’’partitionsareavailableonanRA60orRA80.Consultuda(4) formoreinformation. 9April1993 Installing/Operating4.2BSD-23- Systemsetup TypeNameSizeNameSize rk07hk?g13Mb rm03hp?g41Mb rp06hp?g145Mb rm05hp?g80Mbhp?h145Mb rm80hp?g96Mb ra60ra?g41Mbra?h139Mb ra80ra?g41Mbra?h56Mb ra81ra?g41Mbra?h380Mb rb80rb?g41Mbrb?h56Mb rp07hp?g315Mbhp?h145Mb up300up?g80Mbup?h145Mb hp400hp?g216Mbhp?h145Mb up160up?g106Mb Hereup300referstoeitheranAMPEXorCDC300MegabytediskonaUNIBUSdiskcontroller, up160referstoaFUJITSU160MegabytediskontheUNIBUS,andhp400referstoaFUJITSU Eagle400MegabytediskonaMASBUSdiskcontroller.Consultthemanualpagesforthespecific controllersforothersupporteddisksorotherpartitions. Eachdiskalsohasapagingarea,typicallyof16Megabytes,andarootfilesytemof8 Megabytes.Thedistributedsystembinariesoccupyabout22Megabyteswhilethemajorsources occupyanother25Megabytes.ThisoverflowsdualRK07anddualRL02systems,butfitseasily onmostotherhardwareconfigurations. Beawarethatthediskshavetheirsizesmeasuredindisksectors(512bytes),whilethe UNIXfilesystemblocksarevariablesized.Alluserprogramsreportdiskspaceinkilobytesand, whereneeded,disksizesarealwaysspecifiedintermsofsectors.The/etc/disktabfileusedin makingfilesystemsspecifiesdiskpartitionsizesinsectors;thedefaultsectorsizeof512bytesmay beoverriddenwiththe‘‘se’’attribute. 4.4.4.Layoutconsiderations Thereareseveralconsiderationsindecidinghowtoadjustthearrangementofthingsonyour disks:themostimportantismakingsurethereisadequatespaceforwhatisrequired;secondarily, throughputshouldbemaximized.Pagingspaceisanimportantparameter.Thesystem,asdistributed,sizestheconfiguredpagingareaseachtimethesystemisbooted.Further,multiplepagingareasofdifferentsizemaybeinterleaved.Drivessmallerthan400megabyteshaveswappartitionsof16megabyteswhiledriveslargerthan400megabyteshave32megabytes.Thesevalues maybechangedtogetmorepagingspacebychangingtheappropriatepartitiontableinthedisk driver. Manycommonsystemprograms(C,theeditor,theassembleretc.)createintermediatefiles inthe/tmpdirectory,sothefilesystemwherethisisstoredalsoshouldbemadelargeenoughto accommodatemosthigh-watermarks;ifyouhaveseveraldisks,itmakessensetomountthisina ‘‘root’’(i.e.firstpartition)filesystemonanotherdisk.Alltheprogramsthatcreatefilesin/tmp takecaretodeletethem,butarenotimmunetorareeventsandcanleavedregs.Thedirectory shouldbeexaminedeverysooftenandtheoldfilesdeleted. TheefficiencywithwhichUNIXisabletousetheCPUisoftenstronglyaffectedbytheconfigurationofdiskcontrollers.Forgeneraltime-sharingapplications,thebeststrategyistotryto splittherootfilesystem(/),systembinaries(/usr),thetemporaryfiles(/tmp),andtheuserfiles amongseveraldiskarms,andtointerleavethepagingactivityamongaseveralarms. Itiscriticalforgoodperformancetobalancediskload.Thereareatleastfivecomponents ofthediskloadthatyoucandividebetweentheavailabledisks: 9April1993 Installing/Operating4.2BSD-24- Systemsetup 1.Therootfilesystem. 2.The/tmpfilesystem. 3.The/usrfilesystem. 4.Theuserfiles. 5.Thepagingactivity. Thefollowingpossibilitiesareoneswehaveusedattimeswhenwehad2,3and4disks: disks what234 /122 tmp134 usr111 paging1+21+31+3+4 users22+32+3 archivexx4 Themostimportantthingstoconsideraretoevenoutthediskloadasmuchaspossible, andtodothisbydecouplingfilesystems(onseparatearms)betweenwhichheavycopyingoccurs. Notethatalongtermaveragebalancedloadisnotimportant...itismuchmoreimportanttohave instantaneouslybalancedloadwhenthesystemisbusy. Intelligentexperimentationwithafewfilesystemarrangementscanpayoffinmuch improvedperformance.Itisparticularlyeasytomovetheroot,the/tmpfilesystemandthepagingareas.Placetheuserfilesandthe/usrdirectoryasspaceneedsdictateandexperimentwith theother,moreeasilymovedfilesystems. 4.4.5.Filesystemparameters Eachfilesystemisparameterizedaccordingtoitsblocksize,fragmentsize,andthedisk geometrycharacteristicsofthemediumonwhichitresides.Inaccuratespecificationofthedisk characteristicsorhaphazardchoiceofthefilesystemparameterscanresultinsubstantialthroughputdegradationorsignificantwasteofdiskspace.Asdistributed,filesystemsareconfigured accordingtothefollowingtable. FilesystemBlocksizeFragmentsize /8Kbytes1Kbytes usr4Kbytes512bytes users4Kbytes1Kbytes Therootfilesystemblocksizeismadelargetooptimizebandwidthtotheassociateddisk; thisisparticularlyimportantsincethe/tmpdirectoryisnormallypartoftherootfile.Thelarge blocksizeisalsoimportantasmanyofthemostheavilyusedprogramsaredemandpagedoutof the/bindirectory.Thefragmentsizeof1Kbytesisa‘‘nominal’’valuetousewithafilesystem. Witha1Kbytefragmentsizediskspaceutilizationisapproximatelythesameaswiththeearlier versionsofthefilesystem. Theusrfilesystemusesa4Kbyteblocksizewith512bytefragmentsizeinanefforttoget highperformancewhileconservingtheamountofspacewastedbyalargefragmentsize.Space compactionhasbeendeemedimportantherebecausethesourcecodeforthesystemisnormally placedonthisfilesystem. Thefilesystemsforusershavea4Kbyteblocksizewith1Kbytefragmentsize.These parametershavebeenselectedbasedonobservationsoftheperformanceofouruserfilesystems. The4Kbyteblocksizeprovidesadequatebandwidthwhilethe1Kbytefragmentsizeprovides acceptablespacecompactionanddiskfragmentation. 9April1993 Installing/Operating4.2BSD-25- Systemsetup Otherparametersmaybechoseninconstructingfilesystems,butthefactorsinvolvedin choosingablocksizeandfragmentsizearemanyandinteractincomplexways.Largerblock sizesresultinbetterthroughputtolargefilesinthefilesystemaslargeri/orequestswillthenbe performedbythesystem.However,considerationmustbegiventotheaveragefilesizesfoundin thefilesystemandtheperformanceoftheinternalsystembuffercache.Thesystemcurrently providesspaceintheinodefor12directblockpointers,1singleindirectblockpointer,and1doubleindirectblockpointer.*Ifafileusesonlydirectblocks,accesstimetoitwillbeoptimizedby maximizingtheblocksize.Ifafilespillsoverintoanindirectblock,increasingtheblocksizeof thefilesystemmaydecreasetheamountofspaceusedbyeliminatingtheneedtoallocateanindirectblock.However,iftheblocksizeisincreasedandanindirectblockisstillrequired,thenmore diskspacewillbeusedbythefilebecauseindirectblocksareallocatedaccordingtotheblocksize ofthefilesystem. Inselectingafragmentsizeforafilesystem,atleasttwoconsiderationsshouldbegiven. Themajorperformancetradeoffsobservedarebetweenan8Kbyteblockfilesystemanda4 Kbyteblockfilesystem.Duetoimplementationconstraints,theblocksize/fragmentsizeratio cannotbegreaterthan8.Thismeansthatan8Kbytefilesystemwillalwayshaveafragment sizeofatleast1Kbytes.Ifafilesystemiscreatedwitha4Kbyteblocksizeanda1Kbytefragmentsize,thenupgradedtoan8Kbyteblocksizeand1Kbytefragmentsize,identicalspacecompactionwillbeobserved.However,ifafilesystemhasa4Kbyteblocksizeand512bytefragmentsize,convertingittoan8K/1Kfilesystemwillresultinsignificantlymorespacebeingused. Thisimpliesthat4Kbyteblockfilesystemswhichmightbeupgradedto8Kbyteblocksfor higherperformanceshouldusefragmentsizesofatleast1Kbytestominimizetheamountofwork requiredinconversion. Asecond,moreimportant,considerationwhenselectingthefragmentsizeforafilesystemis theleveloffragmentationonthedisk.Witha512bytefragmentsize,storagefragmentation occursmuchsooner,particularlywithabusyfilesystemrunningnearfullcapacity.Bycomparison,theleveloffragmentationina1Kbytefragmentfilesystemisanorderofmagnitudeless severe.Thismeansthatonfilesystemswheremanyfilesarecreatedanddeletedthe512byte fragmentsizeismorelikelytoresultinapparentspaceexhaustionduetofragmentation.Thatis, whenthefilesystemisnearlyfull,fileexpansionwhichrequireslocatingacontiguousareaofdisk spaceismorelikelytofailona512bytefilesystemthanona1Kbytefilesystem.Tominimize fragmentationproblemsofthissort,aparameterinthesuperblockspecifiesaminimumacceptablefreespacethreshhold.Whennormalusers(i.e.anyonebutthesuper-user)attempttoallo-catediskspaceandthefreespacethresholdisexceeded,theuserisreturnedanerrorasifthefile systemwereactuallyfull.Thisparameterisnominallysetto10%;itmaybechangedbysupplyingaparametertonewfs,orbypatchingthesuperblockofanexistingfilesystem. Ingeneral,unlessafilesystemistobeusedforaspecialpurposeapplication(forexample, storingimageprocessingdata),werecommendusingthedefaultvaluessupplied.Rememberthat thecurrentimplementationlimitstheblocksizetoatmost8Kbytesandtheratioofblocksize/ fragmentsizemustbeintherange1-8. Thediskgeometryinformationusedbythefilesystemaffectstheblocklayoutpolicies employed.Thefile/etc/disktab,assupplied,containsthedataformostalldrivessupportedby thesystem.Whenconstructingafilesystemyoushouldusethenewfs(8)programandspecify thetypeofdiskonwhichthefilesystemresides.Thisfilealsocontainsthedefaultfilesystem partitionsizes,anddefaultblockandfragmentsizes.Tooverrideanyofthedefaultvaluesyou canmodifythefileoruseoneoftheoptionstonewfs. 4.4.6.Implementingalayout Toputachosendisklayoutintoeffect,youshouldusethenewfs(8)commandtocreateeach newfilesystem.Eachfilesystemmustalsobeaddedtothefile/etc/fstabsothatitwillbe checkedandmountedwhenthesystemisbootstrapped. *Atripleindirectblockpointerisalsoreserved,butnotcurrentlysupported. 9April1993 Installing/Operating4.2BSD-26- Systemsetup Asanexample,considerasystemwithrm03’s.Onthefirstrm03,hp0,wewillputtheroot filesysteminhp0a,andthe/usrfilesysteminhp0g,whichhasenoughspacetoholditandthen some.The/tmpdirectorywillbepartoftherootfilesystem,asnofilesystemwillbemounted on/tmp.Ifwehadonlyonerm03,wewouldputuserfilesinthehp0gpartitionwiththesystem sourceandbinaries. Ifwehadasecondrm03,wewouldcreateafilesysteminhp1gandputuserfilesthere,callingthefilesystem/mnt.Wewouldalsointerleavethepagingbetweenthe2rm03’s.Todothis wewouldbuildasystemconfigurationthatspecified: configvmunixrootonhp0swaponhp0andhp1 togettheswapinterleaved,andaddthelines /dev/hp1b::sw:: /dev/hp1g:/mnt:rw:1:2 tothe/etc/fstabfile.Wewouldkeepabackupcopyoftherootfilesysteminthehp1adiskpartition. Tomakethe/mntfilesystemwewoulddo: #cd/dev #MAKEDEVhp1 #newfshp1grm03 (informationaboutfilesystemprintsout) #mkdir/mnt #mount/dev/hp1g/mnt 4.5.Configuringterminals IfUNIXistosupportsimultaneousaccessfrommorethanjusttheconsoleterminal,thefile /etc/ttys(ttys(5))hastobeedited. TerminalsconnectedviadzinterfacesareconventionallynamedttyDDwhereDDisadecimalnumber,the‘‘minordevice’’number.Thelinesondz0arenamed/dev/tty00,/dev/tty01,... /dev/tty07.LinesondhordmfinterfacesareconventionallynamedttyhX,whereXisahexadecimaldigit.Ifmorethanonedhordmfinterfaceispresentinaconfiguration,successiveterminalswouldbenamedttyiX,ttyjX,etc. Toaddanewterminal,besurethedeviceisconfiguredintothesystemandthatthespecial fileforthedevicehasbeenmadeby/dev/MAKEDEV.Then,setthefirstcharacteroftheappropriatelineof/etc/ttysto1(oraddanewline). Thesecondcharacterofeachlineinthe/etc/ttysfileliststhespeedandinitialparameter settingsfortheterminal.Thecommonlyusedchoicesare: 0300-1200-150-110 29600 31200-300 5300-1200 Herethefirstspeedisthespeedaterminalstartsat,and‘‘break’’switchesspeeds.Thusanewly addedterminal/dev/tty00couldbeaddedas 12tty00 ifitwaswiredtorunat9600baud.Thedefinitionofeach‘‘terminaltype’’islocatedinthefile /etc/gettytabandreadbythegettyprogram.Tomakecustomterminaltypes,consultgettytab(5) beforemodifyingthisfile. Dialupterminalsshouldbewiredsothatcarrierisassertedonlywhenthephonelineis dialedup.Fornon-dialupterminalsfromwhichmodemcontrolisnotavailable,youmusteither 9April1993 Installing/Operating4.2BSD-27- Systemsetup wirebackthesignalssothatthecarrierappearstoalwaysbepresent,orshowinthesystemconfigurationthatcarrieristobeassumedtobepresent.Seedh(4),dz(4),anddmf(4)fordetails. Youshouldalsoeditthefile/etc/ttytypeplacingthetypeofeachnewterminalthere(see ttytype(5)). Whenthesystemisrunningmulti-user,allterminalsthatarelistedin/etc/ttyshavinga1 asthefirstcharacteroftheirlineareenabled.If,duringnormaloperations,itisdesiredtodisableaterminalline,youcaneditthefile/etc/ttysandchangethefirstcharacterofthecorrespondinglinetobea0andthensendahangupsignaltotheinitprocess,bydoing #kill−11 Terminalscansimilarlybeenabledbychangingthefirstcharacterofalinefroma0toa1and sendingahangupsignaltoinit. Notethatseveralprograms,/usr/src/etc/init.cand/usr/src/etc/comsat.cinparticular,will havetoberecompilediftherearetobemorethan100terminals.Alsonotethatifaspecialfileis inaccessiblewheninittriestocreateaprocessforit,initwillprintamessageontheconsoleand trytoreopentheterminaleveryminute,reprintingthewarningmessageevery10minutes. Finallynotethatyoushouldchangethenamesofanydialupterminalstottyd?where?is in[0-9a-f],assomeprogramsusethispropertyofthenamestodetermineifaterminalisadialup. Shellcommandstodothisshouldbeputinthe/dev/MAKEDEV.localscript. Whileitispossibletousetrulyarbitrarystringsforterminalnames,theaccountingand noticeablytheps(1)commandmakegooduseoftheconventionthatttynames(bydefault,and alsoafterdialupsarenamedassuggestedabove)aredistinctinthelast2characters.Changethis andyoumaybesorrylater,astheheuristicps(1)usesbasedontheseconventionswillthenbreak downandpswillrunMUCHslower. 4.6.Addingusers Newuserscanbeaddedtothesystembyaddingalinetothepasswordfile/etc/passwd. Theprocedureforaddinganewuserisdescribedinadduser(8). Youshouldaddaccountsfortheinitialusercommunity,givingeachadirectoryandapassword,andputtinguserswhowillwishtosharesoftwareinthesamegroups. Anumberofguestaccountshavebeenprovidedonthedistributionsystem;theseaccounts areforpeopleatBerkeley,DECandatBellLaboratorieswhohavedonemajorworkonUNIXin thepast.Youcandeletetheseaccounts,orleavethemonthesystemifyouexpectthatthese peoplewouldhaveoccasiontologinasguestsonyoursystem. 4.7.Sitetailoring Allprogramswhichrequirethesite’sname,orsomesimilarcharacteristic,obtaintheinformationthroughsystemcallsorfromfileslocatedin/etc.Asidefrompartsofthesystemrelated tothenetwork,totailorthesystemtoyoursiteyoumustsimplyselectasitename,theneditthe file /etc/rc.local Thefirstlinein/etc/rc.local, /bin/hostnamemysitename definesthevaluereturnedbythegethostname(2)systemcall.Programssuchasgetty(8), mail(1),wall(1),uucp(1),andwho(1)usethissystemcallsothatthebinaryimagesaresiteindependent. 4.8.Settingupthelineprintersystem Thelineprintersystemconsistsofatleastthefollowingfilesandcommands: 9April1993 Installing/Operating4.2BSD-28- Systemsetup /usr/ucb/lpqspoolingqueueexaminationprogram /usr/ucb/lprmprogramtodeletejobsfromaqueue /usr/ucb/lprprogramtoenterajobinaprinterqueue /etc/printcapprinterconfigurationandcapabilitydatabase /usr/lib/lpdlineprinterdaemon,scansspoolingqueues /etc/lpclineprintercontrolprogram Thefile/etc/printcapisamasterdatabasedescribinglineprintersdirectlyattachedtoa machineand,also,printersaccessibleacrossanetwork.Themanualpageprintcap(5)describes theformatofthisdatabaseandalsoindicatesthedefaultvaluesforsuchthingsasthedirectory inwhichspoolingisperformed.Thelineprintersystemhandlesmultipleprinters,multiplespoolingqueues,localandremoteprinters,andalsoprintersattachedviaseriallineswhichrequireline initializationsuchasthebaudrate.RasteroutputdevicessuchasaVarianorVersatec,andlaser printerssuchasanImagen,arealsosupportedbythelineprintersystem. Remotespoolingviathenetworkishandledwithtwospoolingqueues,oneonthelocal machineandoneontheremotemachine.Whenaremoteprinterjobisinitiatedwithlpr,thejob isqueuedlocallyandadaemonprocesscreatedtooverseethetransferofthejobtotheremote machine.Ifthedestinationmachineisunreachable,thejobwillremainqueueduntilitispossible totransferthefilestothespoolingqueueontheremotemachine.Thelpqprogramshowsthe contentsofspoolqueuesonboththelocalandremotemachines. Toconfigureyourlineprinters,consulttheprintcapmanualpageandtheaccompanying document,‘‘4.2BSDLinePrinterSpoolerManual’’.Acalltothelpdprogramshouldbepresentin /etc/rc. 4.9.Settingupthemailsystem Themailsystemconsistsofthefollowingcommands: /bin/mailoldstandardmailprogram(from32/V) /usr/ucb/mailUCBmailprogram,describedinmail(1) /usr/lib/sendmailmailroutingprogram /usr/spool/mailmailspoolingdirectory /usr/spool/secretmailsecuremaildirectory /usr/bin/xsendsecuremailsender /usr/bin/xgetsecuremailreceiver /usr/lib/aliasesmailforwardinginformation /usr/ucb/newaliasescommandtorebuildbinaryforwardingdatabase /usr/ucb/biffmailnotificationenabler /etc/comsatmailnotificationdaemon /etc/syslogerrormessagelogger,usedbysendmail Mailisnormallysentandreceivedusingthemail(1)command,whichprovidesafront-endtoedit themessagessentandreceived,andpassesthemessagestosendmail(8)forrouting.Therouting algorithmusesknowledgeofthenetworknamesyntax,aliasingandforwardinginformation,and networktopology,asdefinedintheconfigurationfile/usr/lib/sendmail.cf,toprocesseachpieceof mail.Localmailisdeliveredbygivingittotheprogram/usr/bin/mailwhichaddsittothemailboxesinthedirectory/usr/spool/mail/username,usingalockingprotocoltoavoidproblemswith simultaneousupdates.Afterthemailisdelivered,thelocalmaildeliverydaemon/etc/comsatis notified,whichinturnnotifiesuserswhohaveissueda‘‘biffy’’commandthatmailhasarrived. Mailqueuedinthedirectory/usr/spool/mailisnormallyreadableonlybytherecipient.To sendmailwhichissecureagainstanypossibleperusal(exceptbyacode-breaker)youshoulduse thesecretmailfacility,whichencryptsthemailsothatnoonecanreadit. TosetupthemailfacilityyoushouldreadtheinstructionsinthefileREADMEinthe directory/usr/src/usr.lib/sendmailandthenadjustthenecessaryconfigurationfiles.Youshould 9April1993 Installing/Operating4.2BSD-29- Systemsetup alsosetupthefile/usr/lib/aliasesforyourinstallation,creatingmailgroupsasappropriate.Documentsdescribingsendmail’soperationandinstallationarealsoincludedinthedistribution. 4.9.1.Settingupauucpconnection Theversionofuucpincludedin4.2BSDisanenhancedversionofthatoriginallydistributed with32/V*.Theenhancementsinclude: •supportformanyautocallunitsotherthantheDECDN11, •breakupofthespoolingareaintomultiplesubdirectories, •additionofanL.cmdsfiletocontrolthesetofcommandswhichmaybeexecutedbyaremote site, •enhanced‘‘expect-send’’sequencecapabilitieswhenloggingintoaremotesite, •newcommandstobeusedinpollingsitesandobtainingsnapshotsofuucpactivity. Thissectiongivesabriefoverviewofuucpandpointsoutthemostimportantstepsinitsinstallation. ToconnecttwoUNIXmachineswithauucpnetworklinkusingmodems,onesitemusthave anautomaticcallunitandtheothermusthaveadialupport.Itisbetterifbothsiteshaveboth. Youshouldfirstreadthepaperinvolume2BoftheUnixProgrammersManual:‘‘Uucp ImplementationDescription’’.Itdescribesindetailthefileformatsandconventions,andwillgive youalittlecontext.Inaddition,thedocumentsetup.tblms,locatedinthedirectory /usr/src/usr.bin/uucp/UUAIDS,maybeofuseintailoringthesoftwaretoyourneeds. Theuucpsupportislocatedinthreemajordirectories:/usr/bin,/usr/lib/uucp,and /usr/spool/uucp.Usercommandsarekeptin/usr/bin,operationalcommandsin/usr/lib/uucp, and/usr/spool/uucpisusedasaspoolingarea.Thecommandsin/usr/binare: /usr/bin/uucpfile-copycommand /usr/bin/uuxremoteexecutioncommand /usr/bin/uusendbinaryfiletransferusingmail /usr/bin/uuencodebinaryfileencoder(foruusend) /usr/bin/uudecodebinaryfiledecoder(foruusend) /usr/bin/uulogscanssessionlogfiles /usr/bin/uusnapgivesasnap-shotofuucpactivity /usr/bin/uupollpollsremotesystemuntilananswerisreceived Theimportantfilesandcommandsin/usr/lib/uucpare: /usr/lib/uucp/L-deviceslistofdialersandhardwiredlines /usr/lib/uucp/L-dialcodesdialcodeabbreviations /usr/lib/uucp/L.cmdscommandsremotesitesmayexecute /usr/lib/uucp/L.syssystemstocommunicatewith,howtoconnect,andwhen /usr/lib/uucp/SEQFsequencenumberingcontrolfile /usr/lib/uucp/USERFILEremotesitepathnameaccessspecifications /usr/lib/uucp/uucleancleansupgarbagefilesinspoolarea /usr/lib/uucp/uucicouucpprotocoldaemon /usr/lib/uucp/uuxqtuucpremoteexecutionserver whilethespoolingareacontainsthefollowingimportantfilesanddirectories: *Theuucpincludedinthisdistributionistheresultofworkbymanypeople;wegratefullyacknowledgetheircontributions,butrefrainfrommentioningnamesintheinterestofkeepingthisdocument current. 9April1993 Installing/Operating4.2BSD-30- Systemsetup /usr/spool/uucp/C.directoryforcommand,‘‘C.’’files /usr/spool/uucp/D.directoryfordata,‘‘D.’’,files /usr/spool/uucp/X.directoryforcommandexecution,‘‘X.’’,files /usr/spool/uucp/D.machinedirectoryforlocal‘‘D.’’files /usr/spool/uucp/D.machineXdirectoryforlocal‘‘X.’’files /usr/spool/uucp/TM.directoryfortemporary,‘‘TM.’’,files /usr/spool/uucp/LOGFILElogfileofuucpactivity /usr/spool/uucp/SYSLOGlogfileofuucpfiletransfers Toinstalluucponyoursystem,startbyselectingasitename(lessthan8characters).A uucpaccountmustbecreatedinthepasswordfileandapasswordsetup.Then,createtheappropriatespoolingdirectorieswithmode755andownedbyuseruucp,groupdaemon. Ifyouhaveanauto-callunit,theL.sys,L-dialcodes,andL-devicesfilesshouldbecreated. TheL.sysfileshouldcontainthephonenumbersandloginsequencesrequiredtoestablishaconnectionwithauucpdaemononanothermachine.Forexample,ourL.sysfilelookssomethinglike: adironAnyACU1200out0123456789-ogin-EOT-oginuucp cbosgNeverSlave300 cbosgdNeverSlave300 chicoNeverSlave1200out2010123456 Thefirstfieldisthenameofasite,thesecondindicateswhenthemachinemaybecalled,the thirdfieldspecifieshowthehostisconnected(throughanACU,ahardwiredline,etc.),then comesthephonenumbertouseinconnectingthroughanauto-callunit,andfinallyalogin sequence.ThephonenumbermaycontaincommonabbreviationswhicharedefinedintheLdialcodesfile.ThedevicespecificationshouldrefertodevicesspecifiedintheL-devicesfile.Indi-catingonlyACUcausestheuucpdaemon,uucico,tosearchforanyavailableauto-callunitinL-devices.OurL-dialcodesfileisoftheform: ucb2 out9% whileourL-devicesfileis: ACUcul0unused1200ventel RefertotheREADMEfileintheuucpsourcedirectoryformoreinformationaboutinstallation. Asuucpoperatesitcreates(andremoves)manysmallfilesinthedirectoriesunderneath /usr/spool/uucp.Sometimesfilesareleftundeleted;thesearemosteasilypurgedwiththe uucleanprogram.Thelogfilescangrowwithoutboundunlesstrimmedback;uulogisusedto maintainthesefiles.ManyusefulaidsinmaintainingyouruucpinstallationareincludedinasubdirectoryUUAIDSbeneath/usr/src/usr.bin/uucp.Perusethisdirectoryandreadthe‘‘setup’’ instructionsalsolocatedthere. 9April1993 Installing/Operating4.2BSD-31- Networksetup 5.NETWORKSETUP 4.2BSDprovidessupportfortheDARPAstandardInternetprotocolsIP,ICMP,TCP,and UDP.Theseprotocolsmaybeusedontopofavarietyofhardwaredevicesrangingfromthe IMP’susedintheARPANETtolocalareanetworkcontrollersfortheEthernet.Networkservices aresplitbetweenthekernel(communicationprotocols)anduserprograms(userservicessuchas TELNETandFTP).Thissectiondescribeshowtoconfigureyoursystemtousethenetworking support. 5.1.Systemconfiguration ToconfigurethekerneltoincludetheInternetcommunicationprotocols,definetheINET optionandincludethepseudo-devices‘‘inet’’,‘‘pty’’,and‘‘loop’’inyourmachine’sconfiguration file.The‘‘pty’’pseudo-deviceforcesthepseudoterminaldevicedrivertobeconfiguredintothe system,seepty(4),whilethe‘‘loop’’pseudo-deviceforcesinclusionofthesoftwareloopbackinter-facedriver.Theloopdriverisusedinnetworktestingandalsobythemailsystem. Ifyouareplanningtousethenetworkfacilitiesona10Mb/sEthernet,thepseudo-device ‘‘ether’’shouldalsobeincludedintheconfiguration;thisforcesinclusionoftheAddressResolutionProtocolmoduleusedinmappingbetween48-bitEthernetand32-bitInternetaddresses. Also,ifyouhaveanimp,youwillneedtoincludethepseudo-device‘‘imp.’’ Beforeconfiguringtheappropriatenetworkinghardware,youshouldconsultthemanual pagesinsection4oftheprogrammer’smanual.Thefollowingtableliststhedevicesforwhich softwaresupportexists. DevicenameManufacturerandproduct accACCLH/DHinterfacetoIMP cssDECIMP-11AinterfacetoIMP dmcDECDMC-11(alsoworkswithDMR-11) ec3Com10Mb/sEthernet enXerox3Mb/sprototypeEthernet(notaproduct) hyNSCHyperchannel,w/DR-11BandPI-13interfaces ilInterlan10Mb/sEthernet pclDECPCL-11 unUngermann-Bassnetworkw/DR-11Winterface vvProteonringnetwork(V2LNI) Allnetworkinterfacedriversrequiresomeoralloftheirhostaddressbedefinedatboot time.Thisisaccomplishedwithifconfig(8C)commandsincludedinthe/etc/rc.localfile.Interfaceswhichareabletodynamicallydeducethehostpartofanaddress,butnotthenetworknumber,takethenetworknumberfromtheaddressspecifiedwithifconfig.Hostswhichuseamore complexaddressmappingscheme,suchastheAddressResolutionProtocol,arp(4),requirethe fulladdress.Themanualpageforeachnetworkinterfacedescribesthemethodusedtoestablisha host’saddress.Ifconfig(8)canalsobeusedtosetoptionsfortheinterfaceatboottime.These optionsincludedisablingtheuseoftheAddressResolutionProtocoland/ortheuseoftrailer encapsulation;thisisusefulifanetworkissharedwithhostsrunningsoftwarewhichisunableto performthesefunctions.Optionsaresetindependentlyforeachinterface,andapplytoallpacketssentusingthatinterface.AnalternativeapproachtoARPistodividetheaddressrange, usingARPonlyforthoseaddressesbelowthecutoffandusinganothermappingabovethisconstantaddress;seethesource(/sys/netinet/ifether.c)formoreinformation. Inordertousethepseudoterminalsjustconfigured,deviceentriesmustbecreatedinthe /devdirectory.Tocreate16pseudoterminals(plenty,unlessyouhaveaheavynetworkload)performthefollowingcommands. 9April1993 Installing/Operating4.2BSD-32- Networksetup #cd/dev #MAKEDEVpty0 Morepseudoterminalsmaybemadebyspecifyingpty1,pty2,etc.Thekernelnormallyincludes supportfor32pseudoterminalsunlesstheconfigurationfilespecifiesadifferentnumber.Each pseudoterminalactuallyconsistsoftwofilesin/dev:amasterandaslave.Themasterpseudo terminalfileisnamed/dev/pty?,whiletheslavesideis/dev/ttyp?.Pseudoterminalsarealso usedbythescript(1)program.Inadditiontocreatingthepseudoterminals,besuretoinstall theminthe/etc/ttysfile(witha‘0’inthefirstcolumnsonogettyisstarted),andinthe /etc/ttytypefile(withtype‘‘network’’). Whenconfiguringmultiplenetworkssomethoughtmustbegiventotheorderingofthe devicesintheconfigurationfile.Thefirstnetworkinterfaceconfiguredinthesystemisusedas thedefaultnetworkwhenthesystemisforcedtoassignalocaladdresstoasocket.Thismeans thatyourmostwidelyknownnetworkshouldalwaysbeplacedfirstintheconfigurationfile.For example,hostsattachedtoboththeARPANETandourlocalareanetworkhavedevicesconfiguredintheordershowbelow. deviceacc0atuba?csr0167600vectoraccrintaccxint deviceen0atuba?csr0161000vectorenxintenrintencollide 5.2.Networkdatabases Anumberofdatafilesareusedbythenetworklibraryroutinesandserverprograms.Most ofthesefilesarehostindependentandupdatedonlyrarely. FileManualreferenceUse /etc/hostshosts(5)hostnames /etc/networksnetworks(5)networknames /etc/servicesservices(5)listofknownservices /etc/protocolsprotocols(5)protocolnames /etc/hosts.equivrshd(8C)listof‘‘trusted’’hosts /etc/rc.localrc(8)commandscriptforstartingservers /etc/ftpusersftpd(8C)listof‘‘unwelcome’’ftpusers ThefilesdistributedaresetupforARPANETorotherInternethosts.Localnetworksandhosts shouldbeaddedtodescribethelocalconfiguration;theBerkeleyentriesmayserveasexamples (seealsothenextsection).Networknumberswillhavetobechosenforeachethernet.Forsites notconnectedtotheInternet,thesecanbechosenmoreorlessarbitrarily,otherwisethenormal channelsshouldbeusedforallocationofnetworknumbers. 5.2.1.Regenerating/etc/hostsand/etc/networks Thehostandnetworknamedatabasesarenormallyderivedfromafileretrievedfromthe InternetNetworkInformationCenteratSRI.Todothisyoushouldusetheprogram /etc/gettabletoretrievetheNIChostdatabase,andtheprogram/etc/htabletoconvertittothe formatusedbythelibraries. #cd/usr/src/ucb/netser/htable #/etc/gettablesri-nic Connectiontosri-nicopened. Hosttablereceived. Connectiontosri-nicclosed. #/etc/htablehosts.txt Warning,nolocalgatewaysfile. # Thehtableprogramgeneratestwofilesofinterestinthelocaldirectory:hostsandnetworks.Ifa 9April1993 Installing/Operating4.2BSD-33- Networksetup file‘‘localhosts’’ispresentintheworkingdirectoryitscontentsarefirstcopiedtotheoutputfile. Similarly,a‘‘localnetworks’’filemaybeprependedtotheoutputcreatedbyhtable.Itisusually wisetorundiff(1)onthenewhostandnetworkdatabasesbeforeinstallingthemin/etc. 5.2.2./etc/hosts.equiv Theremoteloginandshellserversuseanauthenticationschemebasedontrustedhosts. Thehosts.equivfilecontainsalistofhostswhichareconsideredtrustedand/or,underasingle administrativecontrol.Whenausercontactsaremoteloginorshellserverrequestingservice,the clientprocesspassestheuser’snameandtheofficialnameofthehostonwhichtheclientis located.Inthesimplecase,ifthehosts’snameislocatedinhosts.equivandtheuserhasan accountontheserver’smachine,thenserviceisrendered(i.e.theuserisallowedtologin,orthe commandisexecuted).Usersmayconstrainthis‘‘equivalence’’ofmachinesbyinstallinga.rhosts fileintheirlogindirectory.Therootloginishandledspecially,bypassingthehosts.equivfile,and usingonlythe/.rhostsfile. Thus,tocreateaclassofequivalentmachines,thehosts.equivfileshouldcontaintheofficial namesforthosemachines.Forexample,mostmachinesonourmajorlocalnetworkareconsideredtrusted,sothehosts.equivfileisoftheform: ucbarpa ucbcalder ucbdali ucbernie ucbkim ucbmatisse ucbmonet ucbvax ucbmiro ucbdegas 5.2.3./etc/rc.local Mostnetworkserversareautomaticallystartedupatboottimebythecommandfile/etc/rc (iftheyareinstalledintheirpresumedlocations).Theseincludethefollowing: /etc/rshdshellserver /etc/rexecdexecserver /etc/rlogindloginserver /etc/rwhodsystemstatusdaemon Tohaveothernetworkserversstartedupaswell,commandsofthefollowingsortshouldbeplaced inthesitedependentfile/etc/rc.local. if[-f/etc/telnetd];then /etc/telnetd&echo-n’telnetd’>/dev/console fi Thefollowingserversareincludedwiththesystemandshouldbeinstalledin/etc/rc.localasthe needarises. 9April1993 Installing/Operating4.2BSD-34- Networksetup /etc/telnetdTELNETserver /etc/ftpdFTPserver /etc/tftpdTFTPserver /etc/syslogerrorloggingserver /etc/sendmailSMTPserver /etc/courierdCourierremoteprocedurecallserver /etc/routedroutingtablemanagementdaemon Consultthemanualpagesandaccompanyingdocumentation(particularlyforsendmail)fordetails abouttheiroperation. 5.2.4./etc/ftpusers TheFTPserverincludedinthesystemprovidessupportforananonymousFTPaccount. Duetotheinherentsecurityproblemswithsuchafacilityyoushouldreadthissectioncarefullyif youconsiderprovidingsuchaservice. Ananonymousaccountisenabledbycreatingauserftp.Whenaclientusestheanonymous accountachroot(2)systemcallisperformedbytheservertorestricttheclientfrommovingoutsidethatpartofthefilesystemwheretheuserftphomedirectoryislocated.Becauseachroot callisused,certainprogramsandfilesmustbesuppliedtheserverprocessforittoexecuteproperly.Further,onemustbesurethatalldirectoriesandexecutableimagesareunwritable.The followingdirectorysetupisrecommended. #cd˜ ftp #chmod555.;chownftp.;chgrpftp. #mkdirbinetcpub #chownrootbinetc #chmod555binetc #chownftppub #chmod777pub #cdbin #cp/bin/sh/bin/ls. #chmod111shls #cd../etc #cp/etc/passwd/etc/group. #chmod444passwdgroup Whenlocaluserswishtoplacefilesintheanonymousarea,theymustbeplacedinasubdirectory. Inthesetuphere,thedirectory˜ ftp/pubisused. Asidefromtheproblemsofdirectorymodesandsuch,theftpservermayprovidealoophole forinterlopersifcertainuseraccountsareallowed.Thefile/etc/ftpusersischeckedoneachconnection.Iftherequestedusernameislocatedinthefile,therequestforserviceisdenied.This filenormallyhasthefollowingnamesonoursystems. uucp root Accountswithnonstandardshellsandnopasswords(e.g.,whoorfinger)shouldalsobelistedin thisfiletopreventtheiruseasanonymousaccountswithftp. 5.3.Routingandgateways/bridges Ifyourenvironmentallowsaccesstonetworksnotdirectlyattachedtoyourhostyouwill needtosetuproutinginformationtoallowpacketstobeproperlyrouted.Twoschemesaresupportedbythesystem.Thefirstschemeemploystheroutingtablemanagementdaemon /etc/routedtomaintainthesystemroutingtables.Theroutingdaemonusesavariantofthe XeroxRoutingInformationProtocoltomaintainuptodateroutingtablesinaclusteroflocal 9April1993 Installing/Operating4.2BSD-35- Networksetup areanetworks.Byusingthe/etc/gatewaysfilecreatedby/etc/htable,theroutingdaemoncan alsobeusedtoinitializestaticroutestodistantnetworks.Whentheroutingdaemonisstarted up(usuallyfrom/etc/rc.local)itreads/etc/gatewaysandinstallsthoseroutesdefinedthere,then broadcastsoneachlocalnetworktowhichthehostisattachedtofindotherinstancesoftheroutingdaemon.Ifanyresponsesarereceived,theroutingdaemonscooperateinmaintainingagloballyconsistentviewofroutinginthelocalenvironment.Thisviewcanbeextendedtoinclude remotesitesalsorunningtheroutingdaemonbysettingupsuitableentriesin/etc/gateways;consultrouted(8C)foramorethoroughdiscussion. Thesecondapproachistodefineawildcardroutetoasmartgatewayanddependonthe gatewaytoprovideICMProutingredirectinformationtodynamicallycreatearoutingdatabase. Thisisdonebyaddinganentryoftheform /etc/routeadd0smart-gateway1 to/etc/rc.local;seeroute(8C)formoreinformation.Thewildcardroute,indicatedbya0valued destination,willbeusedbythesystemasa‘‘lastresort’’inroutingpacketstotheirdestination. Assumingthegatewaytowhichpacketsaredirectedisabletogeneratetheproperroutingredirectmessages,thesystemwillthenaddroutingtableentriesbasedontheinformationsupplied. Thisapproachhascertainadvantagesovertheroutingdaemon,butisunsuitableinanenvironmentwheretheirareonlybridges(i.e.pseudogatewayswhich,forinstance,donotgenerateroutingredirectmessages).Further,ifthesmartgatewaygoesdownthereisnoalternative,savemanualalterationoftheroutingtableentry,tomaintainingservice. Thesystemalwayslistens,andprocesses,routingtableredirectinformation,soitispossible tocombineboththeabovefacilities.Forexample,theroutingtablemanagementprocessmight beusedtomaintainuptodateinformationaboutroutestogeographicallylocalnetworks,while employingthewildcardroutingtechniquesfor‘‘distant’’networks.Thenetstat(1)programmay beusedtodisplayroutingtablecontentsaswellasvariousroutingorientedstatistics.Forexample, #netstat−r willdisplaythecontentsoftheroutingtables,while #netstat−r−s willshowthenumberofroutingtableentriesdynamicallycreatedasaresultofroutingredirect messages,etc. 9April1993 Installing/Operating4.2BSD-36- SystemOperation 6.SYSTEMOPERATION ThissectiondescribesproceduresusedtooperateaVAXUNIXsystem.Procedures describedhereareusedperiodically,torebootthesystem,analyzeerrormessagesfromdevices,do diskbackups,monitorsystemperformance,recompilesystemsoftwareandcontrollocalchanges. 6.1.Bootstrapandshutdownprocedures Inanormalreboot,thesystemchecksthedisksandcomesupmulti-userwithoutinterven-tionattheconsole.Sucharebootcanbestopped(afteritprintsthedate)withaˆ C(interrupt). Thiswillleavethesysteminsingle-usermode,withonlytheconsoleterminalactive. Ifbootingfromtheconsolecommandlevelisneeded,thenthecommand >>>B willbootfromthedefaultdevice.Onan11/780(11/730)thedefaultdeviceisdeterminedbya ‘‘DEPOSIT’’commandstoredonthefloppy(cassette)inthefile‘‘DEFBOO.CMD’’;onan11/750 thedefaultdeviceisdeterminedbythesettingofaswitchonthefrontpanel. Youcanbootasystemupsingleuserona780or730bydoing >>>BXXS whereXXisoneofHP,HK,UP,RA,orRBfora730.Thecorrespondingcommandonan 11/750is >>>B/1 ForsecondvendorstoragemodulesontheUNIBUSorMASSBUSofan11/750youwill needtohaveabootprom.Mostvendorswillsellyousuchpromsfortheircontrollers;contact yourvendorifyoudon’thaveone. Otherpossibilitiesare: >>>BANY or,ona750 >>>B/3 Thesecommandsbootandaskforthenameofthesystemtobebooted.Theycanbeusedafter buildinganewtestsystemtogivethebootprogramthenameofthetestversionofthesystem. Tobringthesystemuptoamulti-userconfigurationfromthesingle-userstatusafter,e.g.,a ‘‘BHPS’’onan11/780,‘‘BRBS’’ona730,ora‘‘B/1’’onan11/750allyouhavetodoishitˆ D ontheconsole.Thesystemwillthenexecute/etc/rc,amulti-userrestartscript(and /etc/rc.local),andcomeupontheterminalslistedasactiveinthefile/etc/ttys.Seeinit(8)and ttys(5).Note,however,thatthisdoesnotcauseafilesystemchecktobeperformed.Unlessthe systemwastakendowncleanly,youshouldrun‘‘fsck−p’’orforcearebootwithreboot(8)tohave thediskschecked. Totakethesystemdowntoasingleuserstateyoucanuse #kill1 orusetheshutdown(8)command(whichismuchmorepolite,ifthereareotherusersloggedin.) whenyouareupmulti-user.Eithercommandwillkillallprocessesandgiveyouashellonthe console,asifyouhadjustbooted.Filesystemsremainmountedafterthesystemistakensingleuser.Ifyouwishtocomeupmulti-useragain,youshoulddothisby: 9April1993 Installing/Operating4.2BSD-37- SystemOperation #cd/ #/etc/umount-a #ˆ D Eachsystemshutdown,crash,processorhaltandrebootisrecordedinthefile /usr/adm/shutdownlogwiththecause. 6.2.Deviceerrorsanddiagnostics Whenerrorsoccuronperipheralsorinthesystem,thesystemprintsawarningdiagnostic ontheconsole.Thesemessagesarecollectedregularlyandwrittenintoasystemerrorlogfile /usr/adm/messages. Errormessagesprintedbythedevicesinthesystemaredescribedwiththedriversforthe devicesinsection4oftheprogrammer’smanual.Iferrorsoccurindicatinghardwareproblems, youshouldcontactyourhardwaresupportgrouporfieldservice.Itisagoodideatoexaminethe errorlogfileregularly(e.g.with‘‘tail−r/usr/adm/messages’’). 6.3.Filesystemchecks,backupsanddisasterrecovery Periodically(sayeveryweekorsointheabsenceofanyproblems)andalways(usuallyautomatically)afteracrash,allthefilesystemsshouldbecheckedforconsistencybyfsck(1).The proceduresofreboot(8)shouldbeusedtogetthesystemtoastatewhereafilesystemcheckcan beperformedmanuallyorautomatically. Dumpingofthefilesystemsshouldbedoneregularly,sinceoncethesystemisgoingitis easytobecomecomplacent.Completeandincrementaldumpsareeasilydonewithdump(8). Youshouldarrangetodoatowers-of-hanoidumpsequence;wetuneourssothatalmostallfiles aredumpedontwotapesandkeptforatleastaweekinmosteverycase.Wetakefulldumps everymonth(andkeeptheseindefinitely).Operatorscanexecute‘‘dumpw’’atloginthatwilltell themwhatneedstobedumped(basedonthe/etc/fstabinformation).Besuretocreateagroup operatorinthefile/etc/groupsothatdumpcannotifylogged-inoperatorswhenitneedshelp. Moreprecisely,wehavethreesetsofdumptapes:10dailytapes,5weeklysetsof2tapes, andfreshsetsofthreetapesmonthly.Wedodailydumpscircularlyonthedailytapeswith sequence‘32547698999...’.Eachweeklyisalevel1andthedailydumpsequencelevel restartsaftereachweeklydump.Fulldumpsarelevel0andthedailysequencerestartsaftereach fulldumpalso. Thusatypicaldumpsequencewouldbe: tapenamelevelnumberdateoprsize FULL0Nov24,1979jkf137K D13Nov28,1979jkf29K D22Nov29,1979rrh34K D35Nov30,1979rrh19K D44Dec1,1979rrh22K W11Dec2,1979etc40K D53Dec4,1979rrh15K D62Dec5,1979jkf25K D75Dec6,1979jkf15K D84Dec7,1979rrh19K W21Dec9,1979etc118K D93Dec11,1979rrh15K D102Dec12,1979rrh26K D15Dec15,1979rrh14K W31Dec17,1979etc71K D23Dec18,1979etc13K 9April1993 Installing/Operating4.2BSD-38- SystemOperation FULL0Dec22,1979etc135K Wedoweekly’softenenoughthatdaily’salwaysfitononetapeandnevergettothesequenceof 9’sinthedailylevelnumbers. Dumpingoffilesbynameisbestdonebytar(1)buttheamountofdatathatcanbemoved inthiswayislimitedtoasingletape.Finallyifthereareenoughdrivesentirediskscanbe copiedwithdd(1)usingtherawspecialfilesandanappropriateblockingfactor;thenumberof sectorspertrackisusuallyagoodvaluetouse,consult/etc/disktab. Itisdesirablethatfulldumpsoftherootfilesystembemaderegularly.Thisisespecially truewhenonlyonediskisavailable.Then,iftherootfilesystemisdamagedbyahardwareor softwarefailure,youcanrebuildaworkablediskdoingarestoreinthesamewaythattheinitial rootfilesystemwascreated. Exhaustionofuser-filespaceiscertaintooccurnowandthen;diskquotasmaybeimposed, orifyoupreferalessfacistapproach,tryusingtheprogramsdu(1),df(1),quot(8),combined withthreateningmessagesoftheday,andpersonalletters. 6.4.Movingfilesystemdata Ifyouhavetheequipment,thebestwaytomoveafilesystemistodumpittomagtape usingdump(8),usenewfs(8)tocreatethenewfilesystem,andrestorethetape,usingrestore(8). Ifforsomereasonyoudon’twanttousemagtape,dumpacceptsanargumenttellingwheretoput thedump;youmightuseanotherdisk.Therestoreprogramusesan‘‘in-place’’algorithmwhich allowsfilesystemdumpstoberestoredwithoutconcernfortheoriginalsizeofthefilesystem. Further,portionsofafilesystemmaybeselectivelyrestoredinamannersimilartothetape archiveprogram. Ifyouhavetomergeafilesystemintoanother,existingone,thebestbetistousetar(1).If youmustshrinkafilesystem,thebestbetistodumptheoriginalandrestoreitontothenewfile system.Ifyouareplayingwiththerootfilesystemandonlyhaveonedrive,theprocedureis morecomplicated.Whatyoudoisthefollowing: 1.GETASECONDPACK!!!! 2.Dumptherootfilesystemtotapeusingdump(8). 3.Bringthesystemdownandmountthenewpack. 4.Loadthedistributiontapeandinstallthenewrootfilesystemasyoudidwhenfirst installingthesystem. 5.Bootnormallyusingthenewlycreateddiskfilesystem. Notethatifyouchangethediskpartitiontablesoraddnewdiskdriverstheyshouldalsobe addedtothestandalonesystemin/sys/standandthedefaultdiskpartitiontablesin/etc/disktab shouldbemodified. 6.5.MonitoringSystemPerformance Thevmstatprogramprovidedwiththesystemisdesignedtobeanaidtomonitoringsystemwideactivity.Togetherwiththeps(1)command(asin‘‘psav’’),itcanbeusedtoinvestigate systemwidevirtualmemoryactivity.Byrunningvmstatwhenthesystemisactiveyoucanjudge thesystemactivityinseveraldimensions:jobdistribution,virtualmemoryload,pagingandswappingactivity,diskandcpuutilization.Ideally,thereshouldbefewblocked(b)jobs,thereshould belittlepagingorswappingactivity,thereshouldbeavailablebandwidthonthediskdevices (mostsinglearmspeakoutat30-35tpsinpractice),andtheusercpuutilization(us)shouldbe high(above60%). Ifthesystemisbusy,thenthecountofactivejobsmaybelarge,andseveralofthesejobs mayoftenbeblocked(b).Ifthevirtualmemoryisactive,thenthepagingdemonwillberunning (srwillbenon-zero).Itishealthyforthepagingdemontofreepageswhenthevirtualmemory getsactive;itistriggeredbytheamountoffreememorydroppingbelowathresholdandincreases 9April1993 Installing/Operating4.2BSD-39- SystemOperation itspaceasfreememorygoestozero. Ifyourunvmstatwhenthesystemisbusy(a‘‘vmstat1’’givesallthenumberscomputedby thesystem),youcanfindimbalancesbynotingabnormaljobdistributions.Ifmanyprocessesare blocked(b),thenthedisksubsystemisoverloadedorimbalanced.Ifyouhaveaseveralnon-dma devicesoropenteletypelinesthatare‘‘ringing’’,oruserprogramsthataredoinghigh-speednon-bufferedinput/output,thenthesystemtimemaygohigh(60-70%orhigher).Itisoftenpossible topindownthecauseofhighsystemtimebylookingtoseeifthereisexcessivecontextswitching (cs),interruptactivity(in)orsystemcallactivity(sy).Cumulativelyononeofourlarge machinesweaverageabout60contextswitchesandinterruptspersecondandabout90system callspersecond. Ifthesystemisheavilyloaded,orifyouhavelittlememoryforyourload(1Mislittlein mostanycase),thenthesystemmaybeforcedtoswap.Thisislikelytobeaccompaniedbya noticeablereductioninsystemperformanceandpregnantpauseswheninteractivejobssuchas editorsswapout.Ifyouexpecttobeinamemory-poorenvironmentforanextendedperiodyou mightconsideradministrativelylimitingsystemload. 6.6.Recompilingandreinstallingsystemsoftware Itiseasytoregeneratethesystem,anditisagoodideatotryrebuildingpiecesofthesystemtobuildconfidenceintheprocedures.Thesystemconsistsoftwomajorparts:thekernel itself(/sys)andtheuserprograms(/usr/srcandsubdirectories).Themajorpartofthisis /usr/src. ThethreemajorlibrariesaretheClibraryin/usr/src/lib/libcandtheFORTRANlibraries /usr/src/usr.lib/libI77and/usr/src/usr.lib/libF77.Ineachcasethelibraryisremadebychangingintothecorrespondingdirectoryanddoing #make andtheninstalledby #makeinstall Similartothesystem, #makeclean cleansup. Thesourceforallotherlibrariesiskeptinsubdirectoriesof/usr/src/usr.lib;eachhasa makefileandcanberecompiledbytheaboverecipe. Ifyoulookat/usr/src/Makefile,youwillseethatyoucanrecompiletheentiresystem sourcewithonecommand.Torecompileaspecificprogram,findoutwherethesourceresides withthewhereis(1)command,thenchangetothatdirectoryandremakeitwiththemakefilepresentinthedirectory.Forinstance,torecompile‘‘date’’,allonehastodois #whereisdate date:/usr/src/bin/date.c/bin/date/usr/man/man1/date.1 #cd/usr/src/bin #makedate thiswillcreateanunstrippedversionofthebinaryof‘‘date’’inthecurrentdirectory.Toinstall thebinaryimage,usetheinstallcommandasin #install−sdate/bin/date The−soptionwillinsuretheinstalledversionofdatehasitssymboltablestripped.Theinstall commandshouldbeusedinsteadofmvorcpasitunderstandshowtoinstallprogramsevenwhen theprogramiscurrentlyinuse. 9April1993 Installing/Operating4.2BSD-40- SystemOperation Ifyouwishtorecompileandinstallallprogramsinaparticulartargetareayoucanoverride thedefaulttargetbydoing: #make #makeDESTDIR=pathnameinstall Toregenerateallthesystemsourceyoucando #cd/usr/src #make IfyoumodifytheClibrary,saytochangeasystemcall,andwanttorebuildandinstall everythingfromscratchyouhavetobealittlecareful.Youmustinsurethelibrariesareinstalled beforetheremainderofthesource,otherwisetheloadedimageswillnotcontainthenewroutine fromthelibrary.Thefollowingstepsarerecommended. #cd/usr/src #cdlib;makeinstall #cd.. #makeusr.lib #cdusr.lib;makeinstall #cd.. #makebinetcusr.binucbgameslocal #foriinbinetcusr.binucbgameslocal;do(cd$i;makeinstall);done Thiswilltakeabout12hoursonareasonablyconfigured11/750. 6.7.Makinglocalmodifications Tokeeptrackofchangestosystemsourcewemigratechangedversionsofcommandsin /usr/src/bin,/usr/src/usr.bin,and/usr/src/ucbinthroughthedirectory/usr/src/newandoutof theoriginaldirectoryinto/usr/src/oldforatimebeforeremovingthem.Locallywrittencommandsthataren’tdistributedarekeptin/usr/src/localandtheirbinariesarekeptin/usr/local. Thisallows/usr/bin,/usr/ucb,and/bintocorrespondtothedistributiontape(andtothemanualsthatpeoplecanbuy).Peoplewishingtouse/usr/localcommandsaremadeawarethatthey aren’tinthebasemanual.Asmanualupdatesincorporatethesecommandstheyaremovedto /usr/ucb. Adirectory/usr/junktothrowgarbageinto,aswellasbinarydirectories/usr/oldand /usr/newareuseful.Themancommandsupportsmanualdirectoriessuchas/usr/man/manjfor junkand/usr/man/manlforlocaltomakethisorsomethingsimilarpractical. 6.8.Accounting UNIXoptionallyrecordstwokindsofaccountinginformation:connecttimeaccountingand processresourceaccounting.Theconnecttimeaccountinginformationisstoredinthefile /usr/adm/wtmp,whichissummarizedbytheprogramac(8).Theprocesstimeaccountinginformationisstoredinthefile/usr/adm/acct,andanalyzedandsummarizedbytheprogramsa(8). Ifyouneedtoimplementrechargeforcomputingtime,youcanimplementproceduresbased ontheinformationprovidedbythesecommands.Aconvenientwaytodothisistogivecommandstotheclockdaemon/etc/crontobeexecutedeverydayataspecifiedtime.Thisisdone byaddinglinesto/usr/adm/crontab;seecron(8)fordetails. 6.9.Resourcecontrol ResourcecontrolinthecurrentversionofUNIXisfairlyelaboratecomparedtomostUNIX systems.ThediscquotafacilitiesdevelopedattheUniversityofMelbournehavebeenincorporatedinthesystemandallowcontroloverthenumberoffilesandamountofdiscspaceeachuser mayuseoneachfilesystem.Inaddition,theresourcesconsumedbyanysingleprocesscanbe 9April1993 Installing/Operating4.2BSD-41- SystemOperation limitedbythemechanismsofsetrlimit(2).Asdistributed,thelattermechanismisvoluntary, thoughsitesmaychoosetomodifytheloginmechanismtoimposelimitsnotcoveredwithdisc quotas. Toutilizethediscquotafacilities,thesystemmustbeconfiguredwith‘‘optionsQUOTA’’. Filesystemsmaythenbeplacedunderthequotamechanismbycreatinganullfilequotasatthe rootofthefilesystem,runningquotacheck(8),andmodifying/etc/fstabtoindicatethefilesystem isread-writewithdiscquotas(a‘‘rq’’typefield).Thequotaon(8)programmaythenberunto enablequotas. Individualquotasareappliedbyusingthequotaeditoredquota(8).Usersmayviewtheir quotas(butnotthoseofotherusers)withthequota(1)program.Therepquota(8)programmay beusedtosummarizethequotasandcurrentspaceusageonaparticularfilesystemorfilesystems. Quotasareenforcedwithsoftandhardlimits.Whenauserfirstreachesasoftlimitona resource,amessageisgeneratedonhis/herterminal.Iftheuserfailstolowertheresourceusage belowthesoftlimitthenexttimetheylogintothesystemtheloginprogramwillgeneratea warningaboutexcessiveusage.Shouldthreeloginsessionsgobywiththesoftlimitbreachedthe systemthentreatsthesoftlimitasahardlimitanddisallowsanyallocationsuntilenoughspaceis reclaimedtobringtheuserbackbelowthesoftlimit.Hardlimitsareenforcedstrictlyresultingin errorswhenausertriestocreateorwriteafile.Eachtimeahardlimitisexceededthesystem willgenerateamessageontheuser’sterminal. Consulttheauxiliarydocument,‘‘DiscQuotasinaUNIXEnvironment’’andtheappropriate manualentriesformoreinformation. 6.10.Networktroubleshooting Ifyouhaveanythingmorethanatrivialnetworkconfiguration,fromtimetotimeyouare boundtorunintoproblems.Beforeblamingthesoftware,firstcheckyournetworkconnections. OnnetworkssuchastheEthernetaloosecabletapormisplacedpowercablecanresultin severelydeterioratedservice.Thenetstat(1)programmaybeofaidintrackingdownhardware malfunctions.Inparticular,lookatthe−iand−soptionsinthemanualpage. Shouldyoubelieveacommunicationprotocolproblemexists,consulttheprotocolspecificationsandattempttoisolatetheprobleminapackettrace.TheSODEBUGoptionmaybesuppliedbeforeestablishingaconnectiononasocket,inwhichcasethesystemwilltracealltraffic andinternalactions(suchastimersexpiring)inacirculartracebuffer.Thisbuffermaythenbe printedoutwiththetrpt(8C)program.Mostalltheserversdistributedwiththesystemaccepta −doptionforcingallsocketstobecreatedwithdebuggingturnedon.Consulttheappropriate manualpagesformoreinformation. 6.11.Fileswhichneedperiodicattention Weconcludethediscussionofsystemoperationsbylistingthefilesthatrequireperiodic attentionoraresystemspecific /etc/fstabhowdiskpartitionsareused /etc/disktabdiskpartitionsizes /etc/printcapprinterdatabase /etc/gettytabterminaltypedefinitions /etc/remotenamesandphonenumbersofremotemachinesfortip(1) /etc/groupgroupmemberships /etc/motdmessageoftheday /etc/passwdpasswordfile;eachaccounthasaline /etc/rc.locallocalsystemrestartscript;runsreboot;startsdaemons /etc/hostshostnamedatabase /etc/networksnetworknamedatabase 9April1993 Installing/Operating4.2BSD-42- SystemOperation /etc/servicesnetworkservicesdatabase /etc/hosts.equivhostsundersameadministrativecontrol /etc/securettyrestrictedlistofttyswhererootcanlogin /etc/ttysenables/disablesports /etc/ttytypeterminaltypesconnectedtoports /usr/lib/crontabcommandsthatarerunperiodically /usr/lib/aliasesmailforwardinganddistributiongroups /usr/adm/acctrawprocessaccountdata /usr/adm/messagessystemerrorlog /usr/adm/shutdownloglogofsystemreboots /usr/adm/wtmploginsessionaccounting 9April1993 Installing/Operating4.2BSD-43-AppendixA−bootstrapdetails APPENDIXA−−BOOTSTRAPDETAILS Thisappendixcontainspertinentfilesandnumbersregardingthebootstrappingprocedure for4.2BSD.Youshouldneverhavetolookatthisappendix.However,ifthereareproblemsin installingthedistributiononyourmachine,thematerialcontainedheremayproveuseful. Contentsofthedistributiontapes Thedistributionnormallyconsistsoftwo1600bpi2400’magnetictapes.Thefirsttapecontainsthefollowingfilesonit.Alltapefilesareblockedin10kilobytesrecords,exceptforthefirst fileonthefirsttapewhichhas512byterecords. TapefileRecords*Contents one1948bootstrapmonitorprogramsanda tp(1)filecontainingboot,format,andcopy two205‘‘miniroot’’filesystem three380dump(8)ofdistributionrootfilesystem four440tar(1)imageof/sys,includingGENERICsystem five2111tar(1)imageofbinariesandlibrariesin/usr six576tar(1)imageof/usr/lib/vfont Thesecondtapecontainsthefollowingfiles. Tapefile#RecordsContents one2100tar(1)imageof/usr/src two973tar(1)imageofusercontributedsoftware three420tar(1)imageof/usr/ingres Thedistributiontapeismadewiththeshellscriptslocatedinthedirectory/sys/dist.To constructadistributiontapeonemustfirstbuildaminirootfilesystemwiththebuildminishell script. #!/bin/sh #@(#)buildmini4.47/9/83 # miniroot=hp0g minitype=rm80 # date umount/dev/${miniroot} newfs-s4096${miniroot}${minitype} fsck/dev/r${miniroot} mount/dev/${miniroot}/mnt cd/mnt;sh/sys/dist/get cd/sys/dist;sync umount/dev/${miniroot} fsck/dev/${miniroot} date Thebuildminiscriptusesthegetscripttoconstructtheactualfilesystem. *Thenumberofrecordsineachtapefilemaynotbepreciselythatshowninthistable;thesevalues reflectthecontentsofthedistributiontapeatthetimethisdocumentwaswritten. 9April1993 Installing/Operating4.2BSD-44-AppendixA−bootstrapdetails #!/bin/sh #@(#)get4.137/19/83 # #Shellscripttobuildamini-rootfilesystem #inpreparationforbuildingadistributiontape. #Thefilesystemcreatedhereisimagecopiedonto #tape,thenimagecopiedontodiskasthe"first" #stepinacoldbootof4.2systems. # DISTROOT=/nbsd # if[‘pwd‘=’/’] then echoYoujust’(almost)’destroyedtheroot exit fi cp$DISTROOT/a/sys/GENERIC/vmunix. rm-rfbin;mkdirbin rm-rfetc;mkdiretc rm-rfa;mkdira rm-rftmp;mkdirtmp rm-rfusr;mkdirusrusr/mdec rm-rfsys;mkdirsyssys/floppysys/cassette cp$DISTROOT/etc/disktabetc cp$DISTROOT/etc/newfsetc;stripetc/newfs cp$DISTROOT/etc/mkfsetc;stripetc/mkfs cp$DISTROOT/etc/restoreetc;stripetc/restore cp$DISTROOT/etc/initetc;stripetc/init cp$DISTROOT/etc/mountetc;stripetc/mount cp$DISTROOT/etc/mknodetc;stripetc/mknod cp$DISTROOT/etc/fscketc;stripetc/fsck cp$DISTROOT/etc/umountetc;stripetc/umount cp$DISTROOT/etc/arffetc;stripetc/arff cp$DISTROOT/etc/flcopyetc;stripetc/flcopy cp$DISTROOT/bin/mtbin;stripbin/mt cp$DISTROOT/bin/lsbin;stripbin/ls cp$DISTROOT/bin/shbin;stripbin/sh cp$DISTROOT/bin/mvbin;stripbin/mv cp$DISTROOT/bin/syncbin;stripbin/sync cp$DISTROOT/bin/catbin;stripbin/cat cp$DISTROOT/bin/mkdirbin;stripbin/mkdir cp$DISTROOT/bin/sttybin;stripbin/stty;lnbin/sttybin/STTY cp$DISTROOT/bin/echobin;stripbin/echo cp$DISTROOT/bin/rmbin;stripbin/rm cp$DISTROOT/bin/cpbin;stripbin/cp cp$DISTROOT/bin/exprbin;stripbin/expr cp$DISTROOT/bin/awkbin;stripbin/awk cp$DISTROOT/bin/makebin;stripbin/make cp$DISTROOT/usr/mdec/*usr/mdec cp$DISTROOT/a/sys/floppy/[Ma-z0-9]*sys/floppy cp$DISTROOT/a/sys/cassette/[Ma-z0-9]*sys/cassette cp$DISTROOT/a/sys/stand/bootboot cp$DISTROOT/.profile.profile cat>etc/passwd<<EOF 9April1993 Installing/Operating4.2BSD-45-AppendixA−bootstrapdetails root::0:10::/:/bin/sh EOF cat>etc/group<<EOF wheel:*:0: staff:*:10: EOF cat>etc/fstab<<EOF /dev/hp0a:/a:xx:1:1 /dev/up0a:/a:xx:1:1 /dev/hk0a:/a:xx:1:1 /dev/ra0a:/a:xx:1:1 /dev/rb0a:/a:xx:1:1 EOF cat>xtr<<’EOF’ :${disk?’Usage:disk=xx0type=tttape=yyxtr’} :${type?’Usage:disk=xx0type=tttape=yyxtr’} :${tape?’Usage:disk=xx0type=tttape=yyxtr’} echo’Buildrootfilesystem’ newfs${disk}a${type} sync echo’Checkthefilesystem’ fsck/dev/r${disk}a mount/dev/${disk}a/a cd/a echo’Rewindtape’ mt-t/dev/${tape}0rew echo’Restorethedumpimageoftheroot’ restorersf3/dev/${tape}0 cd/ sync umount/dev/${disk}a sync fsck/dev/r${disk}a echo’Rootfilesystemextracted’ echo echo’Ifthisisa780,updatefloppy’ echo’Ifthisisa730,updatethecassette’ EOF chmod+xxtr rm-rfdev;mkdirdev cp$DISTROOT/sys/dist/MAKEDEVdev chmod+xdev/MAKEDEV cp/dev/nulldev/MAKEDEV.local cddev cd.. sync Theminirootfilesystemmusthaveenoughspacetoholdthefilesfoundonafloppyorcassette. Onceaminirootfilesystemisconstructed,themaketapescriptisusedtomakeadistributiontape. 9April1993 Installing/Operating4.2BSD-46-AppendixA−bootstrapdetails #!/bin/sh #@(#)maketape4.128/4/83 # miniroot=hp0g # trap"rm-f/tmp/tape.$$;exit"01231315 mtrew date umount/dev/hp2g/dev/hp2h umount/dev/hp2a mount-r/dev/hp2a/nbsd mount-r/dev/hp2g/nbsd/usr mount-r/dev/hp2h/nbsd/a cd/nbsd/tp tpcmf/tmp/tape.$$bootcopyformat cd/nbsd/sys/mdec echo"Build1stlevelbootblockfile" cattsboothtboottmbootmtbootutbootnobootnoboot/tmp/tape.$$|\ ddof=/dev/rmt12bs=512conv=sync cd/nbsd sync echo"Adddumpofmini-rootfilesystem" ddif=/dev/r${miniroot}of=/dev/rmt12bs=20bcount=205conv=sync echo"Addfulldumpofrealfilesystem" /etc/dump0uf/dev/rmt12/nbsd echo"Addtarimageofsystemsources" cd/nbsd/a/sys;tarcf/dev/rmt12. echo"Addtarimageof/usr" cd/nbsd/usr;tarcf/dev/rmt12admbindictdocgames\ guesthostsincludeliblocalmanmdecmsgsnew\ oldpreservepubspooltmpucb echo"Addvarianfonts" cd/usr/lib/vfont;tarcf/dev/rmt12. echo"Done,rewindingfirsttape" mtrew echo"Mountsecondtapeandhitreturnwhenready";readx echo"Addusersourcecode" cd/nbsd/usr/src;tarcf/dev/rmt12. echo"Addusercontributedsoftware" cd/usr/src/new;tarcf/dev/rmt12. echo"Addingressource" cd/nbsd/usr/ingres;tarcf/dev/rmt12. echo"Done,rewindingsecondtape" mtrew Summarizingthen,toconstructadistributiontapeyoucanusetheabovescriptsandthe followingcommands. 9April1993 Installing/Operating4.2BSD-47-AppendixA−bootstrapdetails #buildmini #maketape ... Done,rewindingfirsttape Mountsecondtapeandhitreturnwhenready (removethefirsttapeandplaceafreshoneonthedrive) ... Done,rewindingsecondtape Controlstatusregisteraddresses Thedistributionusesmanystandalonedevicedriverswhichpresumethelocationofa UNIBUSdevice’scontrolstatusregister(CSR).Thefollowingtablesummarizesthesevalues. DevicenameControllerCSRaddress(octal) raDECUDA500172150 rbDEC730IDC0175606 rkDECRK110177440 rlDECRL110174400 tmEMULEXTC-110172520 tsDECTS110172520 upEMULEXSC-21V0176700 utSI97000172440 AllMASSBUScontrollersarelocatedatstandardoffsetsfromthebaseaddressoftheMASSBUS adapterregisterbank. Genericsystemcontrolstatusregisteraddresses Thegenericversionoftheoperatingsystemsuppliedwiththedistributioncontainsthe UNIBUSdevicesindicatedbelow.ThesedeviceswillberecognizediftheappropriatecontrolstatusregistersrespondatanyoftheindicatedUNIBUSaddresses. DevicenameControllerCSRaddresses(octal) hkDECRK110177440 tmEMULEXTC-110172520 utSI97000172440 upEMULEXSC-21V0176700,0174400,0176300 raDECUDA-500172150,0172550,0177550 rbDEC730IDC0175606 rlDECRL110174400 dnDECDN110160020 dmDM11equivalent0170500 dhDH11equivalent0160040 dzDECDZ110160100,0160110,...0160170 tsDECTS110172520 dmfDECDMF320160340 lpDECLP110177514 Ifdevicesotherthantheabovearelocatedatanyoftheaddressesindicated,thesystemmaynot bootstrapproperly. 9April1993 Installing/Operating4.2BSD-48-AppendixB−loadingthetapemonitor APPENDIXB−−LOADINGTHETAPEMONITOR Thissectionindicateshowthebootstrapmonitorlocatedonthefirsttapeofthedistribution tapesetmaybeloaded.Thisshouldnotbenecessary,buthasbeenincludedasafallbackmeasureincaseitisnotpossibletoreadthedistributedconsolemedium.WARNING:thebootstrapssuppliedbelowmaynotwork,incertaininstancesonan11/730becausetheyuseabuffered datapathfortransferringdatafromtapetomemory;consultourgroupifyouareunabletoload themonitoronan11/730. Toloadthetapebootstrapmonitor,firstmountthemagnetictapeondrive0atloadpoint, makingsurethatthewriteringisnotinserted.Temporarilysettherebootswitchonan11/780 or11/730tooff;onan11/750setthepower-onactiontohalt.(Innormaloperationan11/780or 11/730willhavetherebootswitchon,andan11/750willhavethepower-onactionsetto boot/restart.) Ifyouhavean11/780givethecommands: >>>HALT >>>UNJAM Then,onanymachine,givetheinitcommand: >>>I andthenkeyinatlocation200andexecuteeithertheTS,HT,TM,orMTbootstrapthatfollows,asappropriate.Themachine’sprintoutsareshowninboldface,explanatorycommentsare within().(Youcanuse‘delete’todeleteacharacterand‘controlU’tokillthewholeline.) TSbootstrap >>>D/P2003AEFD0 >>>D+D05A0000 >>>D+3BEF >>>D+800CA00 >>>D+32EFC1 >>>D+CA010000 >>>D+EFC10804 >>>D+24 >>>D+15508F >>>D+ABB45B00 >>>D+2AB9502 >>>D+8FB0FB18 >>>D+956B024C >>>D+FB1802AB >>>D+25C8FB0 >>>D+6B (ThenexttwodepositssetuptheaddressesoftheUNIBUS) (adapteranditsmemory;the20006000hereistheaddressof) (the11/780uba0andthe2013E000theaddressofthe11/780umem0) >>>D+20006000(780uba0) (780uba1:20008000,750uba:F30000,730uba:F26000) >>>D+2013E000(780umem0) (780umem1:2017E000,750umem:FFE000,730umem:FFE000) >>>D+80000000 >>>D+254C004 >>>D+80000 9April1993 Installing/Operating4.2BSD-49-AppendixB−loadingthetapemonitor >>>D+264 >>>D+E >>>D+C001 >>>D+2000000 >>>S200 HTbootstrap >>>D/P2003EEFD0 >>>D+C55A0000 >>>D+3BEF >>>D+808F00 >>>D+C15B0000 >>>D+C05B5A5B >>>D+4008F >>>D+D05B00 >>>D+9D004AA >>>D+C08F326B >>>D+D424AB14 >>>D+8FD00CAA >>>D+80000000 >>>D+320800CA >>>D+AAFE008F >>>D+6B39D010 >>>D+0 (ThenexttwodepositssetuptheaddressesoftheMASSBUS) (adapterandthedrivenumberforthetapeformatter) (the20012000hereistheaddressofthe11/780mba1andthe0) (reflectsthattheformatterisdrive0onmba1) >>>D+20012000(780mba1)(780mba0:20010000,750mba0:F28000) >>>D+0(Formatterunitnumberinrange0-7) >>>S200 >>>S200 TMbootstrap >>>D/P2002AEFD0 >>>D+D0510000 >>>D+2000008F >>>D+800C180 >>>D+804C1D4 >>>D+1AEFD0 >>>D+C8520000 >>>D+F5508F >>>D+8FAE5200 >>>D+4A20200 >>>D+B006A2B4 >>>D+2A203 (Thefollowingtwonumbersareuba0andumem0;seeTSabove) (forsomehintsonothervaluesifyourTMisn’tonUBA0ona780) >>>D+20006000(780uba0) >>>D+2013E000(780umem0) >>>S200 >>>S200 9April1993 Installing/Operating4.2BSD-50-AppendixB−loadingthetapemonitor >>>S200 MTbootstrap >>>D/P20046EFD0 >>>D+C55A0000 >>>D+43EF >>>D+808F00 >>>D+C15B0000 >>>D+C05B5A5B >>>D+4008F >>>D+19A5B00 >>>D+49A04AA >>>D+AAD408AB >>>D+8FD00C >>>D+CA800000 >>>D+8F320800 >>>D+10AAFE00 >>>D+2008F3C >>>D+ABD014AB >>>D+FE15044 >>>D+399AF850 >>>D+6B (ThenexttwodepositssetuptheaddressesoftheMASSBUS) (adapterandthedrivenumberforthetapeformatter) (the20012000hereistheaddressofthe11/780mba1andthe0) (reflectsthattheformatterisdrive0onmba1) >>>D+20012000 >>>D+0 >>>S200 >>>S200 >>>S200 >>>S200 (notoggle-incodeexistsfortheUTdevice) Ifthetapedoesn’tmovethefirsttimeyoustartthebootstrapprogramwith‘‘S200’’you probablyhaveenteredtheprogramincorrectly(butalsocheckthatthetapeisonline).Startover andcheckyourtyping.FortheHT,MT,andTMbootstrapsyouwillnotbeabletoseethetape motionasyouadvancethroughthefirstfewblocksasthetapemotionisallwithinthevacuum columns. Next,depositinRAtheaddressofthetapeMBA/UBAandinRBtheaddressofthedevice registersorunitnumberfromoneof: >>>D/GA20006000(fortapeson780uba0) >>>D/GA20008000(fortapeson780uba1) >>>D/GA20012000(fortapeson780mba1) >>>D/GA20010000(fortapeson780mba0) >>>D/GAF30000(fortapeson750uba0) >>>D/GAF2A000(fortapeson750mba1) >>>D/GAF28000(fortapeson750mba0) >>>D/GAF26000(fortapeson730uba0) andforregisterB: 9April1993 Installing/Operating4.2BSD-51-AppendixB−loadingthetapemonitor >>>D/GB0(fortm03/tm78formattersatmba?drive0) >>>D/GB1(fortm03/tm78formattersatmba?drive1) >>>D/GB2013F550(fortm11/ts11/tu80tapeson780uba0) >>>D/GBFFF550(fortm11/ts11/tu80tapeson750or730uba0) Thenstartthebootstrapprogramwith >>>S0 Theconsoleshouldtype = Youarenowtalkingtothetapebootstrapmonitor.Atanypointinthefollowingprocedureyou canreturntothissection,reloadthetapebootstrap,andrestarttheprocedure.Theconsole monitorisidenticaltothatloadedfromaTU58consolecassette,followtheinstructionsinsection 2astheyapplytothisdevice.Theonlyexceptionisthatwhenusingprogramsloadedfromthe tapebootstrapmonitor,programswillalwaysreturntothemonitor(the‘‘=’’prompt).Thissaves yourhavingtotypeintheabovetoggle-incodeforeachprogramtobeloaded. 9April1993 Installing/Operating4.2BSD-52-AppendixC−installationtroubleshooting APPENDIXC−−INSTALLATIONTROUBLESHOOTING Thisappendixlistsandexplainscertainproblemswhichmightbeencounteredwhiletrying toinstallthe4.2BSDdistribution.Theinformationprovidedhereislimitedtotheearlystepsin theinstallationprocess;i.e.uptothepointwheretherootfilesystemisinstalled.Ifyouhavea probleminstallingthereleaseconsultthissectionforanindicationoftheproblembeforecontactingourgroup. Usingthedistributionconsolemedium. Thissectiondescribesproblemswhichmayoccurwhenusingtheprogramsprovidedonthedistributedconsolemedium:TU58cassetteorRX01floppydisk. programcannotbeloaded. Checktomakesurethecorrectfloppyorcassetteisbeingused.Ifusingafloppy,besureitisnot inupsidedown.Ifusingacassetteonan11/730,becertaindrive0isbeingused.Ifahardi/o erroroccurredwhilereadingafloppy,tryresetingtheconsoleLSI-11bypoweringitonandoff.If youcannotbootthecassette’sbootstrapmonitor,verifythestandardDECconsolecassettecan beread;ifitcannot,yourcassetteisbroken−notuncommon. programhaltswithoutwarning. Checktomakesureyouhavespecifiedthecorrectdisktoformat;consultsections1.3and1.4for adiscussionoftheVAXandUNIXdevicenamingconventions.On11/750’s,specifyinganonexistentMASSBUSdevicewillcausetheprogramtohaltasitreceivesaninterrupt(standalone programsoperatebypollingdevices). Ifusingafloppy,tryreadingthefloppyunderyourcurrentsystem.Ifthisworks,copythefloppy toanewoneandbeginagain.Ifusingacassetteonan11/730,dolikewise. formatprints‘‘Knowndevicesare...’’. Youhaverequestedformattoworkonadeviceforwhichithasnodriver,orwhichdoesnotexist; onlytheindicateddevicesaresupported. format,boot,orcopyprints‘‘unknowndrivetype’’. AMASSBUSdiskwasspecified,buttheassociatedMASSBUSdrivetyperegisterindicatesa driveofunknowntype.Thisprobablymeansyoutypedsomethingwrongoryourhardwareis incorrectlyconfigured. format,boot,orcopyprints‘‘unknowndevice’’. Thedevicespecifiedisprobablynotoneofthosesupportedbythedistribution;consultsection 1.1.Ifthedeviceislistedinsection1.1,thedrivemaybedual-ported,orforsomeotherreason thedriverwasunabletodecipheritscharacteristics.IfthisisaMASSBUSdrive,trypowering theMASSBUSadapterand/orcontrolleronandofftoclearthedrivetyperegister. copydoesnotcopy205records Ifatapereaderroroccurred,cleanyourtapedriveheads.Ifadiskwriteerroroccurred,thedisk formattingmayhavefailed.Ifthediskpackisremovable,tryanotherone.Ifyouarecurrently runningUNIX,youcanrebootyouroldsystemanduseddtocopythemini-rootfilesystemintoa diskpartition(assumingthedestinationisnotinusebytherunningsystem). bootprints‘‘notadirectory’’ Thebootprogramwasunabletofindtherequestedprogrambecauseitencounteredsomething otherthanadirectorywhilesearchingthefilesystem.Thisusuallyindicatesnofilesystemispresentonthediskpartitionsupplied,orthefilesystemhasbeencorrupted.Firstchecktomake sureyoutypedthecorrectlinetoboot.Ifthisisthecaseandyouarebootingoffthemini-root filesystem,themini-rootwasprobablynotcopiedcorrectlyoffthetape(perhapsitwasnot placedinthecorrectdiskpartition).Tryreinstallingthemini-rootfilesystemor,iftryingtoboot 9April1993 Installing/Operating4.2BSD-53-AppendixC−installationtroubleshooting thetruerootfilesystem,trybootingoffthemini-rootfilesystemandrunfsckontherestored rootfilesystemtoinsureitsintegrity.Finally,asalastresort,copythebootprogramfromthe mini-rootfilesystemtothenewlyinstalledrootfilesystem. bootprints‘‘badformat’’ Theprogramyourequestedboottoloaddidnothavea407,410,or413magicnumberinits header.Thisshouldneverhappenonadistributionsystem.Ifyouweretryingtobootoffthe rootfilesystem,rebootthesystemonthemini-rootfilesystemandlookattheprogramonthe rootfilesystem.Trycopyingthecopyofvmunixonthemini-roottotherootfilesystemalso. bootprints‘‘readshort’’ Thefileheaderfortheprogramindicatedasizelargerthantheactualsizeofthefilelocatedon disk.Thisisprobablytheresultoffilesystemcorruption(oradiski/oerror).Trybootingagain orcreatinganewcopyoftheprogramtobeloaded(seeabove). Bootingthegenericsystem Thissectioncontainscommonproblemsencounteredwhenbootingthegenericversionofthesystem. systempanicswith‘‘panic:iinit’’ Thisoccuredbecausethesystemwasunabletolocatetheprogram/etc/init.Therootfilesystem suppliedatthe‘‘rootdevice?’’promptwasprobablyincorrect.Rememberthatwhenrunningon themini-rootfilesystem,thisquestionmustbeansweredwithsomethingoftheform‘‘hp0*’’.If theanswerhadbeen‘‘hp0’’,thesystemwouldhaveusedthe‘‘a’’partitiononunit0ofthe‘‘hp’’ drive,wherepresumablynofilesystemexists. Alternatively,thefilesystemonwhichyouweretryingtoruniscorrupted,orsimplymissing /etc/init.Tryreinstallingtheappropriatefilesystemorinstallingaversionofinit. systemselectsincorrectrootdevice Thatis,youtrytobootthesystemsingleuserwith‘‘B/2’’or‘‘BxxS’’butdonotgettherootfile systemintheexpectedlocation.Thisismostlikelycausedbyyourhavingmanydisksavailable moresuitedtobearootfilesystemthantheoneyouwanted.Forexample,ifyouhavea‘‘up’’ diskandan‘‘hk’’diskandinstallthesystemonthe‘‘hk’’,thentryandbootthesystemtosingleusermode,theheuristicusedbythegenericsystemtoselecttherootfilesystemwillchoosethe ‘‘up’’disk.Thefollowinglistgives,indescendingorder,thosedisksthoughtmostsuitabletobea rootfilesystem:‘‘hp’’,‘‘up’’,‘‘ra’’,‘‘rb’’,‘‘rl’’,‘‘hk’’(thepositionof‘‘rl’’issubjecttoargument). Togettherootdeviceyouwantyoumustbootusing‘‘B/3’’or‘‘BANY’’,thensupplytheroot deviceattheprompt. systemcrashesduringautoconfiguration ThisisalmostalwayscausedbyanunsupportedUNIBUSdevicebeingpresentatalocation whereasupporteddevicewasexpected.Youmustdisablethedeviceinsomeway,eitherby pullingitoffthebus,orbymovingthelocationoftheconsolestatusregister(consultAppendixA foracompletelistofUNIBUScsr’susedinthegenericsystem). systemdoesnotfinddevice(s) TheUNIBUSdeviceisnotatastandardlocation.Consultthelistofcontrolstatusregister addressesinAppendixA,orwaittoconfigureasystemtoyourhardware. Alternatively,certaindevicesaredifficulttolocateduringautoconfiguration.Aclassicexampleis theTS11tapedrivewhichdoesnotautoconfigureproperlyifitisrewindingwhenthesystemis rebooted.Tapedrivesshouldconfigureproperlyiftheyareoff-line,orarenotperformingatape movement.Diskswhicharedual-portedshouldautoconfigureproperlyifthedriveisnotbeing simultaneouslyaccessedthroughthealternateport. 9April1993 Installing/Operating4.2BSD-54-AppendixC−installationtroubleshooting Buildingconsolecassettes Thissectionsdescribescommonproblemsencounteredwhileconstructingaconsolebootstrapcassette. systemcrashes Youaretryingtobuildacassetteforan11/750.Onan11/750thesystemisbootedbyusinga bootstrappromandsector0oftherootfilesystem.Refertosection2.1.5ortu(4)fortheappropriatereprimand. systemhangs YouareusinganMRSPpromonan11/750andthinkyoucanignoretheinstructionsinthisdocument.TheproblemhereisthatthegenericsystemonlysupportstheMRSPpromonan11/730. Usingitonan11/750requiresaspecialsystemconfiguration;consulttu(4)formoreinformation. 9April1993