1交换机无法正常启动的解决办法EX交换机在突然掉电或非正常关机的情况下,设备重新启动后,可能会出现一直卡着启动进程或OS引导失败的场景,本文列出几种常见的模式及解决方法(注:本文档中提到的操作可能出现设备原有配置丢失情况出现,另外,对于通过命令关机时,强烈建议等到所有进程都halt时再对进行掉电操作)。通常,交换机无法正常启动时,通过console输出为:1.系统直接进入Loader模式,LoaderPrompt(loader);2.系统进入Debug模式,DebugPrompt(db);3.系统进入UBoot模式,UBootPrompt(=);4.系统能正常启动,但各系统进程无法正常加载;5.系统提示Can'tloadkernelerror;2系统直接进入Loader模式解决办法方法一TFTP方式恢复交换机1.准备好TFTP服务器,然后把Junos安装文件上传至TFTP的root目录层次下;2.用console连接交换机,并对设备进行加电;#Whenyouseetheloading/boot/defaults/loader.confdisplayhitENTER.Thenpress[Enter]tobootimmediately,orspacebarforcommandprompt.Hitthespacebartoenterthemanualloader.Theloaderpromptdisplays.(NOTE:Thereisa1seconddelayforhittingthespacebar)(TIPS:youcanhitspacebarafteryouseeLoading/boot/defaults/loader.confmessage)3.配置交换机的管理ip地址;loadersetipaddr=192.168.100.2loadersetnetmask=255.255.255.0loadersetserverip=192.168.100.14.从TFTP安装Junos;loaderinstallt==============================================Thispartofthebootlogisrelatedtothestepslistedabove==============================================Consoles:U-BootconsoleFoundcompatibleAPI,ver.7FreeBSD/PowerPCU-Bootbootstraploader,Revision2.1(marcelm@apg-bbuild01.juniper.net,WedFeb611:23:55PST2008)Memory:1024MBLoading/boot/defaults/loader.conf/kerneldata=0x9dc348+0x6df44syms=[0x4+0x87bb0+0x4+0x8e152]Hit[Enter]tobootimmediately,orspacebarforcommandprompt.-------HITSPACEBAR-------Type'?'foralistofcommands,'help'formoredetailedhelp.loaderloadersetipaddr=192.168.100.2loadersetnetmask=255.255.255.0loadersetserverip=192.168.100.1loaderinstallt:100,fullduplexPackage/jinstall-ex-9.1R2.7-domestic-signed.tgzissigned.../kerneldata=0x504104+0x32e60syms=[0x4+0x50a00+0x4+0x6366f]Kernelentryat0xa0000100...GDB:nodebugportspresentKDB:debuggerbackends:ddbKDB:currentbackend:ddbCopyright(c)1996-2008,JuniperNetworks,Inc.Allrightsreserved.Copyright(c)1992-2006TheFreeBSDProject....snip...==============================================或参考KB11752-InstallingEX-SeriessoftwarefromaTFTPserverfromLoaderpromptORRecoveringfromaFailedSoftwareUpgradeonanEXSeriesSwitch.方法二、USB方式恢复交换机步骤一、将需要安装的Junos软件copy至U盘根目录下;步骤二、用console连接交换机,并对设备进行加电;#Whenyouseetheloading/boot/defaults/loader.confdisplayhitENTER.Thenpress[Enter]tobootimmediately,orspacebarforcommandprompt.Hitthespacebartoenterthemanualloader.Theloaderpromptdisplays.(NOTE:Thereisa1seconddelayforhittingthespacebar)(TIPS:youcanhitspacebarafteryouseeLoading/boot/defaults/loader.confmessage)步骤三、输入installfile:///jinstall-ex-3200-10.0S1.1-domestic-signed.tgz注:交换机将从U盘进行安装;或参考KB10386-BootfromUSBandRecoveringfromaFailedSoftwareUpgradeonanEX-seriesSwitchORBootinganEXSeriesSwitchUsingaSoftwarePackageStoredonaUSBFlashDrive3系统进入Debug模式解决办法步骤一,在db模式下输入以下命令收集相关信息:dbx/sversiondballtracedbpsdbshowallvmsdbshowmsgbufdbshowregistersdbshowlockdbshowuma步骤二,完成以上步骤后,输入contdbcontDoyougettheCLIprompt?No-Continuewith步骤三.Yes-Jumpto步骤四.步骤三,重启交换机,从loader模式进行恢复;如果交换机无法进入loader模式,请开case进行处理或采用installformat方式解决;步骤四,在cli下用showsystemcore-dumps看是否存在core-dump文件,如果有的话,可先进入shell模式层下,然后进入/var/core-dumpsdirectory目录下,将文件上传至FTP服务器;或参考KB20635-Whilebootingup,switchstuckindbmode4系统进入UBoot模式解决办法按照以下三个步骤进行操作:1.在UBoot模式输入reset重启交换机;2.Break启动顺序进入loader模式#Whenyouseetheloading/boot/defaults/loader.confdisplayhitENTER.Thenpress[Enter]tobootimmediately,orspacebarforcommandprompt.Hitthespacebartoenterthemanualloader.Theloaderpromptdisplays.(NOTE:Thereisa1seconddelayforhittingthespacebar)(TIPS:youcanhitspacebarafteryouseeLoading/boot/defaults/loader.confmessage)3.然后按照方法一中的Loader模式进行处理;5系统能正常启动,但其它各系统进程无法加载的解决方法设备启动后存在以下报错root@GZ-EX4200-1showchassisalarmsno-forwardingerror:thealarm-controlsubsystemisnotrunningroot@GZ-EX4200-1showchassishardwaredetailno-forwardingerror:thechassis-controlsubsystemisnotrunning1.对于10.4R3以前的版本,可按照Loader模式的方法进行处理;2.对于10.4R3之后的版本,存在双分区双系统,而Junosloader默认是用disk99,如果这个分区的系统坏了之后,会一直卡着Loader模式;步骤一,设备加电后,输入以下命令;=setenvloaddevdisk99:enter=saveenventer=resetenter步骤二,在JunOSloader模式下选择从internalNANDflash启动Junosloadersetcurrdev=disk0:enterloaderbootenter步骤三,在shell模式删除以下文件;login(Loginasroot)#ls-al/boot/loader.conf.localenter#rm/boot/loader.conf.local步骤四,Revertthechangemadeinstepone:#nvramunsetenvloaddev步骤五,Reboot6Can'tloadkernelerror解决办法如果设备重启后,一直显示以下错误:can'tload'/kernel'can'tload'/kernel.old'可参照DB模式进行恢复;7Junos在备用分区启动(KB23180)开机提示:Warning:**********************************************************************************************WARNING:THISDEVICEHASBOOTEDFROMTHEBACKUPJUNOSIMAGE********ItispossiblethattheprimarycopyofJUNOSfailedtobootup****properly,andsothisdevicehasbootedfromthebackupcopy.********Pleasere-installJUNOStorecovertheprimarycopyincase****ithasbeencorrupted.*********************************************************************************************设备告警信息:user@switchshowchassisalarms1alarmscurrentlyactiveAlarmtimeClassDescription2011-02-1705:48:49PSTMinorHost0Bootfrombackuproot查看加载路径:rootshowsystemst