handyunexpectederror

unexpectederror  时间:2021-01-17  阅读:()
CopyrightIBMCorporation2005TrademarksBootloadershowdown:GettingtoknowLILOandGRUBPage1of11Bootloadershowdown:GettingtoknowLILOandGRUBContrastandcomparethesetwocontendersLaurenceBonneyAugust24,2005MostLinuxusers,fromthecasualdesktopusertotheLinuxsystemadministrator,haveusedautilityknownasabootloader.
Differentvariationsofthisutilityprovidevaryinglevelsofsupportandfunctionality.
Inmanycases,thedefaultbootloaderinstalledwithaLinuxdistributionisnotalwaysthebestforyourneeds;thesamecanbesaidforthedefaultsettingsofeachbootloader.
Inthisarticle,LaurenceBonneydiscussestheprosandconsoftwoofthemorepopularbootloaders--LILOandGRUB--andsuggestsanumberofconfigurationstogetthemostfromyourmachine.
WhatutilitydopracticallyallLinuxusersuse--regardlessoftheirjoborexpertiseAbootloader.
Inthisarticle,seehowabootloaderworks,meettwopopularloaders--LILO(LInuxLOader)andGNUGRUB(GRandUnifiedBootloader)--andreviewtheprosandconsofeach.
WhatisabootloaderMostsimply,abootloaderloadstheoperatingsystem.
Whenyourmachineloadsitsoperatingsystem,theBIOSreadsthefirst512bytesofyourbootablemedia(whichisknownasthemasterbootrecord,orMBR).
YoucanstorethebootrecordofonlyoneoperatingsysteminasingleMBR,soaproblembecomesapparentwhenyourequiremultipleoperatingsystems.
Hencetheneedformoreflexiblebootloaders.
Themasterbootrecorditselfholdstwothings--eithersomeoforallofthebootloaderprogramandthepartitiontable(whichholdsinformationregardinghowtherestofthemediaissplitupintopartitions).
WhentheBIOSloads,itlooksfordatastoredinthefirstsectoroftheharddrive,theMBR;usingthedatastoredintheMBR,theBIOSactivatesthebootloader.
DuetotheverysmallamountofdatatheBIOScanaccess,mostbootloadersloadintwostages.
Inthefirststageoftheboot,theBIOSloadsapartofthebootloaderknownastheinitialprogramloader,orIPL.
TheIPLinterrogatesthepartitiontableandsubsequentlyisabletoloaddatawhereveritmayexistonthevariousmedia.
Thisactionisusedinitiallytolocatethesecondstagebootloader,whichholdstheremainderoftheloader.
developerWorksibm.
com/developerWorks/Bootloadershowdown:GettingtoknowLILOandGRUBPage2of11Thesecondstagebootloaderistherealmeatofthebootloader;manyconsiderittheonlyrealpartofthebootloader.
Thiscontainsthemoredisk-intensivepartsoftheloader,suchasuserinterfacesandkernelloaders.
Theseuserinterfacescanrangefromasimplecommandlinetotheall-singing,all-dancingGUIs.
Bootloadersareusuallyconfiguredinoneoftwoways:eitherasaprimarybootloaderorasasecondarybootloader.
PrimarybootloadersarewherethefirststageofthebootloaderisinstalledontheMBR(perthepreviousdescription).
Secondarybootloadersarewherethefirststageofthebootloaderisinstalledontoabootablepartition.
AseparatebootloadermustthenbeinstalledintotheMBRandconfiguredtopasscontroltothesecondarybootloader.
ManynewerLinuxbootloaderscanbeespeciallyusefulsincetheygiveyouvaryingdegreesofinteraction,suchasadvancedGUIandencryptedpasswords,alongwiththeabilitytoloadfromaselectionofoperatingsystems.
Thusyoucanhavemanyoperatingsystemscoexistingonthesamemachinespanningmultiplephysicaldisks.
ThissetuphasbecomecommonbecauseithelpsmanyusersreconcilethetreasuresofvaluabledatafilesoriginallygeneratedbytheirWindowsmachineswiththeirshinynewLinuxinstalls.
Personally,Ithinkthissetupisgreat;IuseasingleboxforbothLinuxandWindows.
Overtime,bootloadershavebeenenhancedtoincludeagreaterrangeoffunctionalityfortheuser.
Suchfunctionalityandconfigurationvaryfromloadertoloader,althoughthebasicpurposeremainsthesame.
Nowlet'slookattwoofthemorepopularbootloaders:LILOandGRUB.
LILOLInuxLOader,orLILO,comesasstandardonalldistributionsofLinux.
Asoneoftheolder/oldestLinuxbootloaders,itscontinuedstrongLinuxcommunitysupporthasenabledittoevolveovertimeandstayviableasausablemodern-daybootloader.
SomenewfunctionalityincludesanenhanceduserinterfaceandexploitationofnewBIOSfunctionsthateliminatetheold1024-cylinderlimit.
AlthoughLILOcontinuestobedeveloped,thebasicprinciplesofhowLILOworksstillremainthesame.
MakingLILOyourbootloaderWhatyouwillneedtodotouseLILOasyourbootloaderdependsonwhetheryouareinstallingtheOSfreshorhavealreadyinstalledLinuxandareplanningonmovingtoLILO.
Ifyou'restartingfresh,youcanjumpstraighttotheConfiguringLILOsection.
IfyoualreadyhaveaLinuxdistributioninstalled,youusuallygetanoptiontoinstallandconfigureLILO(andcanbootyourmachineintoyournewLinuxinstall).
ForexistingLinuxusersmigratingtoLILO,firstyouhavetoacquirethelatestversionofLILO.
Beforedoinganythingelse,IadviseyoutomakesureyouhaveaLinuxbootdiskhandy--itmakeslifealoteasierifyouaccidentallymesssomethingupandwouldliketobeabletogetbackibm.
com/developerWorks/developerWorksBootloadershowdown:GettingtoknowLILOandGRUBPage3of11intoyouroriginalLinuxconfiguration!
OnceyouhaveLILOonyoursystem,makingittakeoveryourMBRisveryeasy.
Astherootuser,type:#/sbin/lilo-v-vThiswillusethecurrentLILOdefaultsandsplatanythingthatiscurrentlyintheMBR.
However,readaboutConfiguringLILOtomakesureyouareabletobootupasexpected.
AlsonotethatifyouwanttorunWindowsandLinuxonasinglemachine,youshouldinstallyourWindowsOSfirstandthentheLinuxOS,sothatthebootloaderyouchooseintheLinuxinstallwon'tbewrittenoverbytheWindowsbootloader.
UnliketheLinuxbootloaders,themajorityofWindowsbootloaderswillnotallowyoutoloadLinux.
Ifyou'vealreadyinstalledLinuxfirst,don'tfret;justcreateyourselfaLinuxbootdisksothatafteryouhaveinstalledWindows,youcangetbackintoyourLinuxinstallandoverwritetheMBR.
ConfiguringLILOLILOconfigurationisalldonethroughaconfigurationfilelocatedin/etc/lilo.
conf.
Listing1showsanexampleconfiguration,relatingtomyhomemachine,fordualbootingaLinuxandWindowsmachine.
Youcanvisualizehowthisconfigurationrelatestoanactualmachinebylookingatmybasicworkstationsetup:PrimaryHDD(physicaldisk1)withWindowsXPinstalled(initiallyalltherewasonthemachine).
InLinuxterms,thisHDDis/dev/hda(hd0,0inGRUBterms).
SecondaryHDD(physicaldisk2)withRedHatLinuxinstalled;therootpartitionisonthethirdpartitionofthisharddrive,/dev/hdb3(hd1,2inGRUBterms).
Listing1.
Examplelilo.
conffileboot=/dev/hdamap=/boot/mapinstall=/boot/boot.
bprompttimeout=100compactdefault=Linuximage=/boot/vmlinuz-2.
4.
18-14label=Linuxroot=/dev/hdb3read-onlypassword=linuxother=/dev/hdalabel=WindowsXPTheoptionsusedinListing1are:Theboot=linetellsLILOwheretoinstallthebootloader.
Inthepreviousexample,thiswillinstallittotheMBRoffirstharddisk.
YoucouldalternativelyinstallLILOin/dev/hdb3(theLinuxpartitionintheexample),whichwouldthenrequireyoutoinstallanotherbootloaderinto/dev/hdathatpointsittotheLILObootloader;thenyoujustletLILOactasasecondarybootloader.
Ingeneral,/dev/hdaisthemostcommonplaceforyourbootloadertoreside.
YoucanalsomakeaLILOfloppybootdiskbypointingthisparametertothefloppydrive,mostcommonly/dev/fd0.
developerWorksibm.
com/developerWorks/Bootloadershowdown:GettingtoknowLILOandGRUBPage4of11map=pointstothemapfileusedbyLILOinternallyduringbootup.
WhenyouinstallLILOusingthe/sbin/lilocommand,itautomaticallygeneratesthisfile,whichholdsthedescriptortable(amongotherthings).
Myadviceistoleavethisasitis!
install=isoneofthefilesusedinternallybyLILOduringthebootprocess.
Thisholdsboththeprimaryandsecondarypartsofthebootloader.
Asegmentofthisboot.
bfileiswrittentotheMBR(theprimarypartofthebootloader),whichthenpointstothemapandsubsequentlypointstothesecondarybootloader.
Again,leavethisasitis!
prompt=tellsLILOtousetheuserinterface(givingyouinthisexampletwoselections--LinuxandWindowsXP).
Inadditionusingtheprompt/userinterface,yougettheoptiontospecifyspecificparametersfortheLinuxkernelorothersifappropriate.
Ifyoudonotspecifythisoptionintheconfigurationfile,LILOwillbootintothedefaultOSwithnouserinteractionandnowaiting.
(It'sworthnoting,though,thatifyouholdtheSHIFTkeydownduringboot,youcangetthepromptupanyway,whichisquiteusefulifyoudon'twanttheaverageJoetobeexposedtothebootloader).
timeout=isthenumberoftenthsofasecondthatthebootpromptwillwaitbeforeautomaticallyloadingthedefaultOS,inthiscaseLinux.
Ifpromptisnotspecifiedinthelilo.
conf,thisparameterisignored.
Thecompactoptionmagicallymakesthebootprocessquickerbymergingadjacentdiskreadrequestsintoasinglerequest.
Itcanbeamixedblessing,though,asI'veseenanumberofpostsonforumsregardingissueswiththisoption.
Thisoptionespeciallyusefulifyouwishtobootfromafloppy.
Thedefault=optiontellsLILOwhichimagetobootfrombydefault,suchasafterthetimeoutperiod.
Thisrelatestoalabelofoneoftheimagesinthelilo.
conffile.
Ifyoudon'tspecifythisoptionintheconfigurationfile,itwillbootthefirstimagespecifiedinthefile.
ForeachversionofLinuxyouwanttomakeavailableforuserstobootinto,youshouldspecifyimage=andthefollowingthreeoptions.
Theimageoptionspecifiesthekernelversionyouwishtobootto.
label=identifiesthedifferentOSyouwanttobootfromattheuserinterfaceatruntime.
Inaddition,thislabelisusedforspecifyingthedefaultOStobootfrom.
(Note:Avoidspacesinthelabelname;otherwise,youwillgetanunexpectederrorwhenloadingthefile.
)Theroot=optiontellsLILOwheretheOSfilesystemactuallylives.
Inourexample,itis/dev/hdb3,whichisthethirdpartitionoftheseconddisk.
read-onlytellsLILOtoperformtheinitialboottothefilesystemreadonly.
OncetheOSisfullybooted,itismountedread-write.
Thepassword=optionallowsyoutosetapasswordforthespecificOSyouarebootinginto.
Intheexamplethispasswordisheldinthelilo.
conffileasreadabletext,soiseasilyaccessibleforalltoread.
Alternativelyifyousetpassword=""youcansetthepasswordwhenthebootloaderisinstalled.
Thesecanbesetoneachoftheoperatingsystemsyouwishtobootfromifrequired(inourexampleweonlysetapasswordontheLinuxboot).
other=actslikeacombinationoftheimageandrootoptions,butforoperatingsystemsotherthanLinux.
Inourexample,ittellsLILOwheretofindtheWindowsOS,whichresidesonthefirstdiskinthefirstpartition.
ThiswillusuallybethecaseifyouhaveinstalledWindowsfirst,thenLinux.
label=isthesameasallotherlabeloptions.
ibm.
com/developerWorks/developerWorksBootloadershowdown:GettingtoknowLILOandGRUBPage5of11Youcanusemanyotherparametersinthelilo.
conffile,buttheparametersinListing1shouldgetyouintoafairlyusablestateonyourmachine.
Forfurtherinformationontheseandotherlilo.
confparameters,refertothemanualpages(manlilo.
conf).
Sincelilo.
confisnotreadatboottime,theMBRneedstobe"refreshed"whenthisischanged.
Ifyoudonotdothisuponrebooting,noneofyourchangestolilo.
confwillbereflectedatstartup.
LikegettingLILOintotheMBRinthefirstplace,youneedtorun:$/sbin/lilo-v-vThe-v-vflagsgiveyouveryverboseoutput.
ThereareafairnumberofparametersyoucanspecifywhenrunningLILOlikewedid.
Seethemanualpagesforfurtherinformation(manlilo).
TheinitialbootprocessWhenLILOinitiallyloads,itbringsupinordereachoftheletters--L-I-L-O.
Ifalltheletterscomeup,thefirststagebootwassuccessful.
Anythinglessindicatesaproblem:L:Thefirststagebootloaderhasbeenloaded.
IfLILOstopshere,therewereproblemsloadingthesecondstagebootloader.
Thisisusuallyaccompaniedbyanerrorcode.
Thecommonproblemsatthisstagearemediaproblemsorincorrectdiskparametersspecifiedinyourlilo.
conffile.
LI:Thesecondstagebootloaderhasbeenloaded.
LILOhaltingatthispointindicatesthesecondstagebootloadercouldnotbeexecuted.
Again,thiscanbeduetoproblemssimilartojustL:loadingoriftheboot.
bfilehasbeencorrupted,moved,ordeleted.
LIL:Thesecondstagebootloaderhasnowbeenexecuted.
Atthispoint,mediaproblemcouldagainberesponsibleorthemapfile(asspecifiedinthelilo.
conffile)couldhavehadproblemsfindingthedescriptortables.
LIL:Loadedtothesamepointasabove.
Thisusuallymeansthesecondstagebootloaderloadedatanincorrectaddress,causedmostlikelybyboot.
bbeinginadifferentplacethanspecifiedinthelilo.
conffile.
LIL-:Loadedtothesamepointasabove.
Problemloadingthedescriptortable,mostlikelyduetoacorruptdescriptortable.
LILO:LILOhassuccessfullyloadedwithnoerrors.
AdditionalconfigurationatboottimeOnceLILOhassuccessfullyloaded,youwillseeaLILOprompt.
Stillusingtheexamplelilo.
conffileasbefore,atthispointyouhavetwochoices,whichmaynotbeimmediatelyobvioustoLILOnewbies.
First,youmayletLILOtimeout(after10seconds),whichwillboot/dev/hdb3,theLinuxpartition.
Second,youcanpresstheTABkey,whichwilllistaselectionofoperatingsystemstobootfrom.
Inourexamplelilo.
conf,wewouldget"Linux"and"WindowsXP"asouroptions.
TypingeitherofthesewillloadupthatOS.
SpecificallyloadingtheLinuxoptionwillthenpromptyoutoenterapassword,whichinthiscaseislinux.
IncorrectlyenteringthepasswordwilltakeyoubacktotheLILOprompt.
AfinalwordofadvicewhentryingoutLILOforthefirsttime:IfounditalotsafertoworkoutmyLILOconfigurationusingafloppybootdiskratherthanmyharddisk.
Todothis,youmustreplacedeveloperWorksibm.
com/developerWorks/Bootloadershowdown:GettingtoknowLILOandGRUBPage6of11theboot=/dev/hdawithboot=/dev/fd0inthelilo.
conffile.
Thatway,ifImessedupanyoftheconfigurationinmylilo.
conffile,IcouldtakeoutthebootdiskandbootintoLinuxasbefore.
OnceIwashappyeverythingbootedfineusingthefloppydisk,Ithenchangedmylilo.
confbacktouseboot=/dev/hdaandran/sbin/liloafinaltimetouploadmychanges.
GNUGRUBMorerecently,theGRandUnifiedBootloader(commonlyknownasGRUB)seemstohavesomewhattakenthebootloaderscrownfromLILO.
GNUGRUBisactivelydevelopedbytheFreeSoftwareFoundationandbasedontheoriginalGRUBprogram,originallycreatedbyErichStefanBoleyn.
MakeGRUByourbootloaderAswithLILO,thestepsyouwillneedtoperformtouseGRUBasyouractivebootloaderdependonwhetheryouareinstallingtheOSfreshorhavealreadyinstalledLinuxandareplanningonmovingtoGRUB.
Ifyou'restartingfresh,youcanjumpstraighttotheConfiguringGRUBsection.
IfyoualreadyhaveaLinuxdistributioninstalled,youusuallygetanoptiontoinstallandconfigureLILO(andcanbootyourmachineintoyournewLinuxinstall).
ForexistingLinuxuserswantingtomigratetoGRUB,getthelatestversionofGRUB(seeRelatedtopics).
Again,aswithLILO,beforedoinganythingelse,haveaLinuxbootdiskhandy.
Withtheinteractivemode(describedbelow),thisdiskshouldnotberequired,butit'snicetohavejustincaseyougetoutofyourdepth.
OnceyouhaveGRUBinstalledonyoursystem,makingittakeoveryourMBRiseasy.
Astherootuser,type:#/boot/grub/grubThiswillloadupaBASH-likecommandpromptwhereyounowusetheGRUBcommand:grub>install(hd1,2)/boot/grub/stage1(hd1)(hd1,2)/boot/grub/stage2p(hd1,2)/boot/grub/menu.
confThiscommandusestheGRUBinstallcommand,whichrequiresthelocationofthestageoneimageandthelocationoftheMBR(install(hd1,2)/boot/grub/stage1(hd1)).
Alsothelocationofthestagetwoimage((hd1,2)/boot/grub/stage2)isrequired.
Finally,anoptionalp(hd1,2)/boot/grub/menu.
conftellsGRUBthelocationoftheGUImenuconfigurationfile.
Inthepreviousexample,hd1ismyLinuxDiskandhd0ismyWindowsdisk.
ThiswillusethecurrentGRUBdefaultsandsplatanythingthatiscurrentlyintheMBR(readConfiguringGRUBtomakesureyouareabletobootupasexpected).
ConfiguringGRUBGRUBconfigurationisalldonethroughaconfigurationfilelocatedin/boot/grub/grub.
conf.
Listing2showsanexampleconfigurationthatrelatestomyhomesetup,adual-bootingLinuxandWindowsmachine:ibm.
com/developerWorks/developerWorksBootloadershowdown:GettingtoknowLILOandGRUBPage7of11Listing2.
Examplegrub.
conffiledefault=0timeout=10splashimage=(hd1,2)/grub/splash.
xpm.
gzpassword--md5$1$opeVt0$Y.
br.
18LyAasRsGdSKLYlp1titleRedHatLinuxpassword--md5$1$0peVt0$Y.
br.
18LyAasRsGdSKLYlp1root(hd1,2)kernel/vmlinuz-2.
4.
18-14roroot=LABEL=/initrd/initrd-2.
4.
18-14.
imgtitleWindowsXPpassword--md5$1$0peVt0$Y.
br.
18LyAasRsGdSKLYlp1rootnoverify(hd0,0)chainloader+1TheoptionsusedinListing2are:Thedefault=optionsignalstoGRUBwhichimagetobootfrombydefaultafterthetimeoutperiod.
Thisrelatestooneoftheimagesinthegrub.
conffile.
0isthefirstspecified,1isthesecondspecified,etc.
Ifyoudon'tspecifythisoptionintheconfigurationfile,itwillbootthefirstimagespecifiedinthefile.
timeout=isthenumberofsecondsthebootpromptwillwaitbeforeautomaticallyloadingthedefaultOS,inthiscase,RedHatLinux.
splashimage=isthelocationoftheimagetobeusedasthebackgroundfortheGRUBGUI.
ThepasswordoptionspecifiestheMD5-encryptedpasswordusedtogainaccesstoGRUB'sinteractivebootoptions.
NotethisdoesnotstopusersloadingyourdefinedOSchoices;thisneedstobesetonaper-titlebasis.
Togenerateanmd5password,runthetoolgrub-md5-crypt(asroot),whichcomeswithGRUB.
Itwillpromptyouforthepasswordyouwanttoencrypt.
ItthenwilloutputtheMD5-encryptedpassword.
Copythisintoyourgrub.
confafterpassword-md5butonthesameline.
Usuallythispasswordcanbesettotherootpassword,sinceitisonlyrootwhocanreadthegrub.
conffileanyway.
titleidentifiesthespecificOSthatwillbebootedfromattheuserinterfaceatruntime.
UnlikewithLILO,youcanincludespacesinthisname.
passwordissetinthesamewayasthepasswordabove.
Donotsetthispasswordtotherootpasswordifyouareplanningonsharingthismachinewithotherusers.
TherootoptiontellsGRUBwheretheOSfilesystemactuallylives.
Asyoucansee,GRUBreferencesthemediainadifferentwaythanLILO.
InourLILOexample,/dev/hdb3isthethirdpartitionoftheseconddisk.
Grubreferencesthisdiskas(hd1,2),againthethirdpartitionoftheseconddisk(disk0beingthefirstdisk,partition0beingthefirstpartition).
kernel:vmlinuz-X.
X.
XX-XXisthenameofthedefaultbootkernelimagewithinyourrootdirectory.
initrd:initrd-X.
X.
XX-XX.
imgisthenameofthedefaultinitrdfilewithinyourrootdirectory.
titleisthesameasallothertitleoptions.
password:Seeotherpasswordoptions.
TherootnoverifyoptiontellsGRUBtonottrytovarytherootoftheOS.
ThissavesloaderrorsifthefilesystemisnotasupportedbyGRUB.
chainloader+1tellsGRUBtouseachainloadertoloadthisOS,whichisrequiredforloadingWindows.
developerWorksibm.
com/developerWorks/Bootloadershowdown:GettingtoknowLILOandGRUBPage8of11Youcanusemanyotherparametersinthegrub.
conffile,buttheparametersinListing2shouldgetyouintoafairlyusablestateonyourmachine.
Forfurtherinformationontheseandothergrub.
confparameters,seethemanualpages(mangrub.
conf).
UnlikeLILO'sconfigurationfile,grub.
confisreadatboottime,andtheMBRdoesnotneedtoberefreshedwhenthisischanged.
TheinitialbootprocessWhenGRUBinitiallyloads,likeLILOitloadsitsfirststagefromtheMBR.
Oncethishasloaded,itthenentersanintermediatestagebetweenthecommonbootloaderstagesoneandtwo(orforargument'ssake,Stage1.
5).
Stage1.
5ispresenttoenableregularfilesystemaccesstotheGRUBconfigurationfilesin/boot/grubratherthanaccessingusingdiskblocks.
WethenenterstagetwoofthebootloaderwhereGRUBloadsthegrub.
conffile.
YoushouldnowseetheGRUBGUI.
ForanynativeWindowsuser,thisseemsamuchmorefriendlyexperiencethanthatofLILO.
Butdon'tthinkbyhavingaGUIthatGRUBisadumbed-downbootloader.
Thewealthofoptionsisastonishing.
(Seethetipsforadditionalconfigurationatboottime.
)Ifyourconfigurationislikemine,youshouldnowbelookingatascreengivingyoutwooptions:tobootintoRedHatLinuxortobootintoWindowsXP.
Bydefault,itwillloadLinux.
Theresultofselectingeitheroneoftheseisselfexplanatory.
Nowforthegoodstuff.
AdditionalconfigurationatboottimeAttheGRUBGUI,pressinganykeywillstopthetimeoutfromkickingin.
ThenbypressingthePkey,youcanenteryourGRUBpasswordandgainfullaccesstoGRUB'sinteractivebootingoptions.
Youshouldnowbeabletouseoneofthethreeoptionsbypressingtheoneofthefollowingkeys:Foreditcommandsbeforebooting,pressE.
ThisallowsyoutoeditthespecificoptionsforthecurrentlyhighlightedOS.
GRUBwillthenshowonlytheoptionsspecifictothebootingofthatOS,whichyoucantheneditasyouseefit.
ThisisespeciallyusefulifyouhavespecifiedthewrongHDDfortherootfilesystem.
Ifyouneedtoaccessthemachineinsingle-usermode(givingyourootaccesswithoutspecifyingapassword!
),selecttheLinuxOSattheGRUBmainscreen.
Thenasbefore,pressEandmovetothekernelline(inmyexample,thisiskernel/vmlinuz-2.
4.
18-14roroot=LABEL=/).
Youthenappendsingletotheendofthisline,andpressBtobootusingyourchangedgrub.
conf.
Anychangesyoumakeineditmodearenotsavedtothegrub.
conffile.
Tomodifykernelarguments,pressA.
IfyouareanexperiencedLinuxuser,youcantweakthekernelargumentstosuityourneeds.
TogettoaBASH-likecommand-lineinterface,pressC.
Thisminimalcommand-lineinterfaceallowsyoutofindGRUBconfigurationfilesonyoursystem,loadanalternateconfigurationfile,andeditlinesintheconfigurationfile,aswellasenterGRUBcommandsdirectly.
Youibm.
com/developerWorks/developerWorksBootloadershowdown:GettingtoknowLILOandGRUBPage9of11mightusethisifaconfigurationchange,suchasdeletingapartition,hasmadeyoursystemunbootable.
Youmightalsouseitifyouneedtobootasystemintosingle-usermodeorperhapsrunlevel3insteadofyournormalrunlevel.
Themanyusesfortheseoptionsarebeyondthescopeofthisarticle.
Asyoucansee,GRUBreallyopensupthepossibilitiesatboottime.
Thiscanbeamixedblessing,though,asGRUBalsopotentiallyallowsattackerstogainaccesstothesystembeforetheOShasloaded.
Themainareasopentomisuseare:Accesstosingle-usermode.
Anyoneloadingintosingle-usermodeisgivenrootaccess,leavingyourLinuxsystemwideopentoabuse.
Accesstootheroperatingsystems.
Anybootableoperatingsystemsyouhaveconfiguredthatdonotrequireapassword,suchasDOS,willbeopen.
AccesstotheGRUBeditor.
ThisallowsusersfullaccesstochangetheGRUBconfiguration.
SettingsecurityplaysanimportantpartinyourGRUBconfiguration;settingapasswordandusingMD5encryptionpaysdividendstoyouroverallsystemsecurity.
FutureofGRUBGRUBisnowbeingreplacedbyGRUB2.
TheoriginalGRUBisbeingrenamedtoGRUBLegacy;apartfromfixingbugs,itwillnolongerbeactivelydeveloped.
GRUB2willbeacompleterewriteoftheoriginalbootloader.
Todate,thefollowingfeaturesarethecoreofthechanges:ReplacementofStage1.
5withthecreationofacompactcoreimageSupportfordynamicloadingtothecoreimageTrendtowardsmakingtheoverallGRUBframeworkobjectorientedSupportforinternationalization,suchasnon-ASCIIcharactersetsSupportfordifferenthardwarearchitecturesanddifferentplatforms(otherthanLinux)RefertotheGRUBWebsite(seetheRelatedtopicssectionbelowforthelatestdevelopments.
GRUBvs.
LILOAsstatedatthestartofthisarticle,allbootloadersworkinasimilarwaytofulfillacommonpurpose.
ButLILOandGRUBdohaveanumberofdifferences:LILOhasnointeractivecommandinterface,whereasGRUBdoes.
LILOdoesnotsupportbootingfromanetwork,whereasGRUBdoes.
LILOstoresinformationregardingthelocationoftheoperatingsystemsitcantoloadphysicallyontheMBR.
IfyouchangeyourLILOconfigfile,youhavetorewritetheLILOstageonebootloadertotheMBR.
ComparedwithGRUB,thisisamuchmoreriskyoptionsinceamisconfiguredMBRcouldleavethesystemunbootable.
WithGRUB,iftheconfigurationfileisconfiguredincorrectly,itwillsimplydefaulttotheGRUBcommand-lineinterface.
ConclusionAswithallsoftware,thebestchoiceforoneuserisn'talwaysthebestforall.
Ofthetwobootloaderscoveredhere,mypersonalfavoriteisGNUGRUB.
Itisagoodall-aroundloader,developerWorksibm.
com/developerWorks/Bootloadershowdown:GettingtoknowLILOandGRUBPage10of11combiningaslickuserinterfacewithawealthoffunctionality.
AndyetmanypeoplewhohaveusedandlovedLILOstillfindittobethebootloaderofchoice.
Fortunately,ifyouarenewtotheworldofLinuxbootloading,youwon'tgofarwrongwitheither.
Regardingsecurity,anyonewithaccesstoabootdisk/CDcangetpastanyofthesecuritymeasuresmentionedinthisarticlebysimplybootingusingagrub.
conforlilo.
confthatdoesnothavesecurityset.
WithGRUBinparticular,beingabletobootintosingle-usermodecouldposeaserioussecurityhole.
AsimplewaytogetaroundthisproblemistodisablebootingfromCDandfloppyinyourmachine'sBIOSandmakesureyourBIOSissetwithapasswordsootherscannotchangethesesettings.
Havefun!
ibm.
com/developerWorks/developerWorksBootloadershowdown:GettingtoknowLILOandGRUBPage11of11RelatedtopicsThetutorial"BuildaLinuxtestnetwork"(developerWorks,May2003)showshowtocombineSambaandGRUBtobuildacompact,highlyadaptable,cross-platformtestnetwork,capableofbootingandnetworkingalargenumberofoperatingsystemsonasmallnumberofmachines.
GetthelatestversionoftheGRUBbootloader.
BuildyournextdevelopmentprojectonLinuxwithIBMtrialsoftware,availablefordownloaddirectlyfromdeveloperWorks.
CopyrightIBMCorporation2005(www.
ibm.
com/legal/copytrade.
shtml)Trademarks(www.
ibm.
com/developerworks/ibm/trademarks/)

ZJI(月付450元),香港华为云线路服务器、E3服务器起

ZJI发布了9月份促销信息,针对香港华为云线路物理服务器华为一型提供立减300元优惠码,优惠后香港华为一型月付仅450元起。ZJI是原来Wordpress圈知名主机商家:维翔主机,成立于2011年,2018年9月更名为ZJI,提供中国香港、台湾、日本、美国独立服务器(自营/数据中心直营)租用及VDS、虚拟主机空间、域名注册等业务,商家所选数据中心均为国内访问质量高的机房和线路,比如香港阿里云、华为...

IMIDC(rainbow cloud):香港/台湾/日本/莫斯科独立服务器特价,闪购大促销,最低30usd/月起

imidc怎么样?imidc彩虹网路,rainbow cloud知名服务器提供商。自营多地区数据中心,是 Apnic RIPE Afrinic Arin 认证服务商。拥有丰富的网路资源。 在2021年 6.18 开启了输血大促销,促销区域包括 香港 台湾 日本 莫斯科 等地促销机型为 E3係,参与促销地区有 香港 日本 台湾 莫斯科 等地, 限量50台,售罄为止,先到先得。所有服务器配置 CPU ...

gcorelabs:美国GPU服务器,8张RTX2080Ti,2*Silver-4214/256G内存/1T SSD/

gcorelabs提供美国阿什本数据中心的GPU服务器(显卡服务器),默认给8路RTX2080Ti,服务器网卡支持2*10Gbps(ANX),CPU为双路Silver-4214(24核48线程),256G内存,1Gbps独享带宽仅需150欧元、10bps带宽仅需600欧元,不限流量随便跑吧。 官方网站 :https://gcorelabs.com/hosting/dedicated/gpu/ ...

unexpectederror为你推荐
服务器租用游戏服务器租用多少钱一年?linux主机【windows主机换Linux主机该怎么弄啊?需要注意些什么呢?】免费云主机免费网络云主机怎么申请info域名注册INFO域名有没有注册价值?代理主机主机做成代理服务器,其他局域网内的电脑必须通过我的这个网络出去便宜的虚拟主机免费、便宜的虚拟主机哪里有?要好用的 ,速度快的海外域名外贸网站如何选择合适的海外域名?虚拟空间哪个好虚拟空间哪个好网站空间商网站备案为什么是空间商备案?求解国外网站空间国内空间 美国空间 香港空间相比较,哪个好?
vps优惠码cnyvps 域名备案网站 怎样申请域名 oneasiahost 香港机房 cve-2014-6271 主机屋免费空间 美国免费空间 卡巴斯基免费试用 怎么建立邮箱 空间首页登陆 空间购买 东莞主机托管 畅行云 lamp的音标 google搜索打不开 海外加速 赵荣博客 主机配置 什么是云主机 更多