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/)
关于半月湾HMBCloud商家之前也有几篇那文章介绍过这个商家的产品,对于他们家的其他产品我都没有多加留意,而是对他们家的DC5机房很多人还是比较喜欢的,这个比我们有些比较熟悉的某商家DC6 DC9机房限时,而且半月湾HMBCloud商家是相对便宜的。关于半月湾DC5机房的方案选择和介绍:1、半月湾三网洛杉矶DC5 CN2 GIA同款DC6 DC9 1G内存 1TB流量 月$4.992、亲测选择半...
如果我们较早关注NameCheap商家的朋友应该记得前几年商家黑色星期五和网络星期一的时候大促采用的闪购活动,每一个小时轮番变化一次促销活动而且限量的。那时候会导致拥挤官网打不开迟缓的问题。从去年开始,包括今年,NameCheap商家比较直接的告诉你黑色星期五和网络星期一为期6天的活动。没有给你限量的活动,只有限时六天,这个是到11月29日。如果我们有需要新注册、转入域名的可以参加,优惠力度还是比...
Friendhosting商家在前面的篇幅中也又陆续介绍到,是一家保加利亚主机商,主要提供销售VPS和独立服务器出租业务,数据中心分布在:荷兰、保加利亚、立陶宛、捷克、乌克兰和美国洛杉矶等。这不近期黑色星期五活动,商家也有推出了黑五优惠,VPS全场一次性45折,虚拟主机4折,全球多机房可选,老用户续费可获9折加送1个月使用时长,VDS折后最低仅€14.53/年,有需要的可以看看。Friendhos...
unexpectederror为你推荐
海外主机租用在哪里可以租用到外国的服务器?国外虚拟空间哪里买的100m海外虚拟空间便宜稳定?代理主机电脑店卖组装机,怎么赚钱。虚拟主机申请域名申请以及虚拟主机云服务器租用租用云服务器,要注意什么?免备案虚拟空间香港免备案虚拟主机空间怎么样网站空间价格普通的网站空间要多少钱一年合肥虚拟主机虚拟主机怎么弄!申请域名申请一个域名要多少钱?域名劫持发现域名被劫持怎么办
论坛虚拟主机 花生壳免费域名申请 liquidweb mach5 68.168.16.150 外国域名 空间服务商 炎黄盛世 帽子云 howfile 柚子舍官网 网站木马检测工具 nerds cdn加速原理 美国在线代理服务器 英国伦敦 ledlamp 中国联通宽带测试 免费主页空间 上海联通 更多