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/)
RackNerd 商家我们应该是比较熟悉的商家,速度一般,但是人家便宜且可选机房也是比较多的,较多集中在美国机房。包括前面的新年元旦促销的时候有提供年付10美元左右的方案,实际上RackNerd商家的营销策略也是如此,每逢节日都有活动,配置简单变化,价格基本差不多,所以我们网友看到没有必要囤货,有需要就选择。RackNerd 商家这次2022农历新年也是有几款年付套餐。低至RackNerd VPS...
Digital-VM商家的暑期活动促销,这个商家提供有多个数据中心独立服务器、VPS主机产品。最低配置月付80美元,支持带宽、流量和IP的自定义配置。Digital-VM,是2019年新成立的商家,主要从事日本东京、新加坡、美国洛杉矶、荷兰阿姆斯特丹、西班牙马德里、挪威奥斯陆、丹麦哥本哈根数据中心的KVM架构VPS产品销售,分为大硬盘型(1Gbps带宽端口、分配较大的硬盘)和大带宽型(10Gbps...
hostkvm在2021年3月新上线洛杉矶新VPS业务,强制三网接入中国联通优化线路,是当前中美之间性价比最高、最火热的线路之一,性价比高、速度非常好,接近联通AS9929和电信AS4809的效果,带宽充裕,晚高峰也不爆炸。 官方网站:https://hostkvm.com 全场优惠码:2021(全场通用八折,终身码,长期) 美国 US-Plan0【三网联通优化线路】 内存:1G CPU:...
unexpectederror为你推荐
国内虚拟主机国内知名的虚拟主机提供商有哪些?美国虚拟空间美国虚拟主机无限空间是什么意思?空间租用租用空间多少钱 1MB?vps试用请问有什么网站可以提供免费vps试用的?想用它来刷一下外国pt站美国vps租用VPS服务器租用哪里的好?重庆虚拟空间重庆合川宝龙城市广场有前途么虚拟主机是什么什么是虚拟主机虚拟主机评测网请问这几个哪个虚拟主机好100m虚拟主机万网和新网虚拟主机有100M的吗河南虚拟主机谁那有好的虚拟主机?
万网虚拟主机 域名备案中心 已备案域名出售 贝锐花生壳域名 免费cn域名 singlehop 建站代码 中国电信测速112 qingyun 卡巴斯基官方免费版 七夕促销 七夕快乐英文 工作站服务器 刀片式服务器 如何用qq邮箱发邮件 支付宝扫码领红包 空间登陆首页 带宽租赁 东莞服务器托管 游戏服务器出租 更多