Juniper SRX (Junos OS)作業系統升級System Upgrade-從Boot Loader
Juniper
SRX (Junos OS)作業系統升級System Upgrade-從Boot Loader
在開始安裝之前,有些資訊您必須先知道,請先閱讀下列的網路連結之後再繼續往下閱讀:
注意事項:
本升級方式會讓運行中的SRX設備的主要與備援系統的Junos OS的版本達成一致,並且會將系統內部儲存媒體重新分割,而這個動作會順便將系統內部儲存媒體上已經儲存的資料清空,會對已上線正在運行中的設備造成重大之影響,執行前請記得先備份重要的資料,千萬要小心,切記!
我們在什麼時候需要從Boot Loader來升級作業系統呢?
從Boot Loader來升級作業系統除了能達到上述的功能之外,它也可以拿來當作系統維修的工具,例如系統檔案損壞了導致無法正常進入系統時,--當JUNOS作業系統升級失敗導致無法正常進入系統時--,因為Juniper SRX設備是建立在FreeBSD之上,開機時FreeBSD執行Boot Loader程式來載入Junos OS作業系統,所以理論上只要是Boot Loader能正常運作而Junos OS作業系統在載入後卻無法正常進入系統的狀況,應該可以試著從Boot Loader來重裝Junos OS作業系統來解決問題。
準備動作:
要進行從Boot Loader升級JUNOS作業系統,必須先準備一個usb隨身碟,然後將usb隨身碟格式化成FAT、FAT16、FAT32等格式,並將JUNOS OS
image(例如JUNOS-SRXsme-12.1R7.9-domestic.tgz)檔案拷貝到usb隨身碟的根目錄之中,最好是不要有其他的檔案只有JUNOS OS image file,然後將usb隨身碟插入SRX設備的usb插槽中,再根據下列步驟進行作業。
以下為從console操作所顯示之詳細步驟:
root@srx100> request system reboot
Reboot the system ? [yes,no] (no) yes
Shutdown NOW!
[pid 1849]
root@srx100>
*** FINAL System shutdown message from root@SRX100 ***
System going down IMMEDIATELY
DWaiting (max 60 seconds) for system process `vnlru_mem' to
stop...done
Waiting (max 60 seconds) for system process `vnlru' to stop...done
Waiting (max 60 seconds) for system process `bufdaemon' to stop...done
Waiting (max 60 seconds) for system process `syncer' to stop...
Syncing disks,vnodes remaining...0 0 0 done
syncing disks... All buffers synced.
Uptime: 55m 27s
Rebooting...
cpu_reset: Stopping other CPUs
U-Boot 1.1.6 -JNPR-2.8 (Build time: Feb 10
2015 - 01:03:41)
Initializing memory this may take some time...
Measured DDR clock 266.62 MHz
SRX_100_LOWMEM board revision major:0,minor:0,serial #:
AT1311AF0637
OCTEON CN5020-SCP pass 1.1,Core clock: 500 MHz,DDR clock: 266 MHz (532 Mhz data rate)
DRAM: 512 MB
Starting Memory POST...
Checking datalines... OK
Checking address lines... OK
Checking 512K memory for U-Boot... OK.
Running U-Boot CRC Test... OK.
Flash: 4 MB
USB: scanning bus for
devices... 4 USB Device(s) found
scanning bus for storage
devices... 2 Storage Device(s) found
Clearing DRAM....... done
BIST check passed.
Boot Media: nand-flash usb
Net: pic init done (err =
0)octeth0
POST Passed
Press
SPACE to abort autoboot in 1 seconds ##這串訊息約開機10秒左右出現
ELF file is 32 bit
Loading .text @ 0x8f 0000a 0 (246560 bytes)
Loading .rodata @ 0x8f 03c 3c 0
(14144 bytes)
Loading .reginfo @ 0x8f 03fb00
(24 bytes)
Loading .rodata.str1.4 @ 0x8f 03fb18
(16516 bytes)
Loading set_Xcommand_set @ 0x8f 043b9c (96 bytes)
Loading .rodata.cst4 @ 0x8f 043bfc
(20 bytes)
Loading .data @ 0x8f 044000
(5760 bytes)
Loading .data.rel.ro @ 0x8f 045680
(120 bytes)
Loading .data.rel @ 0x8f 0456f 8 (136 bytes)
Clearing .bss @ 0x8f 045780
(11600 bytes)
## Starting application at 0x8f 0000a 0 ...
Consoles: U-Boot console
Found compatible API,ver. 2.8
FreeBSD/MIPS U-Boot bootstrap loader,Revision 2.8
(slt-builder@svl-ssd-build-vm06.Juniper.net,Tue Feb 10 00:32:30 PST 2015)
Memory: 512MB
[0]Booting from nand-flash
slice 1
Un-Protected 1 sectors
writing to flash...
Protected 1 sectors
Loading /boot/defaults/loader.conf ##這串訊息約開機30秒左右出現
kernel data=0xb01a 64+0x1340ac
* ##當您看到這串訊息時,記得先按幾下空白鍵來進入loader模式,此時會等待半分鐘左右
kernel data=0xb01a 64+0x1340ac * syms=[0x4+0x8b0b0+0x4+0xc9f 11] *
Hit
[Enter] to boot immediately,or space bar for command prompt. ##千萬不要看到這串訊息時再按鍵,會沒作用,一定要提前按才行!
Type '?' for a list of commands,'help' for more detailed help.
loader> ##在剛剛提示的地方按空白鍵後,就會自動進入loader模式之中
loader> ? ##查詢可用命令示範,loader模式我們常常會得用到
Available commands:
watchdog enable or disable kernel watchdog
bcachestat get disk block cache stats
boot boot a file or loaded kernel
autoboot boot automatically after a delay
help detailed help
? list commands
show show variable(s)
set set a variable
unset unset a variable
echo echo arguments
read read input from the terminal
more show contents of a file
nextboot set next boot device
lsdev list all devices
install install JUNOS
include read commands from a file
ls list files
load load a kernel or module
unload unload all modules
lsmod list loaded modules
export export variables to U-Boot
environment
save save U-Boot environment
heap show heap usage
reboot reboot the system
boot-conf load kernel and modules,then autoboot
read-conf read a configuration file
enable-module enable loading of a module
disable-module disable loading of a module
toggle-module toggle loading of a module
show-module show module load data
loader> boot –s ##若輸入此命令則會進入密碼恢復程式,其詳細步驟請參閱以下連結:
loader> install
##查詢install命令用法(從BootLoader升級系統的命令)
usage:
install <URL>
where: URL = (tftp|usb)://[host]/<package>
loader>
以下為從tftp安裝JUNOS示範:
loader> install
tftp://192.168.188.6/JUNOS-SRXsme-12.1R7.9-domestic.tgz
關於如何設定才能使用TFTP來安裝系統請參考以下連結:
以下為從usb隨身碟安裝JUNOS示範:
loader> install usb:///JUNOS-SRXsme-12.1R7.9-domestic.tgz ##命令格式下錯會顯示 invalid
URL
invalid URL
loader> install
file:///JUNOS-SRXsme-12.1R7.9-domestic.tgz ##開始安裝系統,中間不用理它,約半小時左右
Target device selected for installation: internal media
/kernel data=0xb01a 64+0x1340ac
syms=[0x4+0x8b0b0+0x4+0xc9f 11]
Kernel entry at 0x801000d8 ...
init regular console
Primary ICache: Sets 64 Size 128 Asso 4
Primary DCache: Sets 1 Size 128 Asso 64
Secondary DCache: Sets 128 Size 128 Asso 8
GDB: debug ports: uart
GDB: current port: uart
KDB: debugger backends: ddb gdb
KDB: current backend: ddb
Copyright (c) 1996-2013,Juniper Networks,Inc.
All rights reserved.
...
... ##中間過程省略
...
SRX100 (ttyu0)
login: root
Password:
--- JUNOS 12.1R7.9 built 2013-07-24 00:16:39 UTC ##登入時顯示版本資訊
root@srx100% cli
sroot@srx100> show system software
##查詢當前系統版本資訊
Information for JUNOS:
Comment:
JUNOS Software Release [12.1R7.9]
root@srx100> show system software backup
##查詢備援系統版本資訊,與當前系統一致
Backup JUNOS package information:
File name: /altroot/cf/packages/JUNOS-12.1R7.9-domestic
File size: 147277493
root@srx100>
查詢boot loader版本號碼
root@srx100> show chassis routing-engine bios
Routing Engine BIOS Version: 1.5