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/)
老薛主机怎么样?老薛主机这个商家有存在有一些年头。如果没有记错的话,早年老薛主机是做虚拟主机业务的,还算不错在异常激烈的市场中生存到现在,应该算是在众多商家中早期积累到一定的用户群的,主打小众个人网站业务所以能持续到现在。这不,站长看到商家有在进行夏季促销,比如我们很多网友可能有需要的香港vps主机季度及以上可以半价优惠,如果有在选择不同主机商的香港机房的可以看看老薛主机商家的香港vps。点击进入...
易探云服务器怎么样?易探云是国内一家云计算服务商家,致力香港云服务器、美国云服务器、国内外服务器租用及托管等互联网业务,目前主要地区为运作香港BGP、香港CN2、广东、北京、深圳等地区。目前,易探云推出的国内云服务器优惠活动,国内云服务器2核2G5M云服务器低至330元/年起;成都4核8G/200G硬盘/15M带宽,仅1888元/3年起!易探云便宜vps服务器配置推荐:易探云vps云主机,入门型云...
LOCVPS发来了针对元旦新年的促销活动,除了全场VPS主机8折优惠外,针对德国/荷兰KVM #1/美国KVM#2 VPS提供终身7折优惠码(限量50名,先到先得)。LOCVPS是一家成立于2012年的国人VPS服务商,提供中国香港、韩国、美国、日本、新加坡、德国、荷兰、俄罗斯等地区VPS服务器,基于KVM或XEN架构(推荐优先选择KVM),均选择直连或者优化线路,国内延迟低,适合建站或远程办公使...
unexpectederror为你推荐
国际域名常用的国际顶级域名有哪些?虚拟主机服务器虚拟主机和站点服务器什么区别免费云主机永久免费的云主机哎或者空间或者vps域名购买在网上购买域名 会受骗吗网站域名空间网站域名和空间100m虚拟主机万网和新网虚拟主机有100M的吗虚拟主机控制面板虚拟主机控制面板是什么?虚拟主机管理系统我也想和你学虚拟主机管理系统的操作山东虚拟主机400电话哪家代理商办理得比较好深圳虚拟主机需要一个虚拟主机???很急!!
安徽虚拟主机 四川虚拟主机 虚拟主机管理软件 .cn域名注册 vps安全设置 汉邦高科域名申请 主机优惠码 godaddy 一点优惠网 台湾谷歌地址 微信收钱 ntfs格式分区 四核服务器 阿里dns 乐视会员免费领取 nnt windowsserver2008r2 hosts文件 衡天主机 国内免备案cdn 更多