flashのIOSイメージが壊れているとき
悲しいことに、電源をいれてみたらIOSが起動しませんでした。
System Bootstrap, Version 12.3(8r)YH8, RELEASE SOFTWARE (fc2) Technical Support: http://www.cisco.com/techsupport Copyright (c) 2006 by cisco Systems, Inc. C1800 platform with 131072 Kbytes of main memory with parity disabledUpgrade ROMMON initialized
program load complete, entry point: 0x80012000, size: 0xc0c0Initializing ATA monitor library.......
program load complete, entry point: 0x80012000, size: 0xc0c0Initializing ATA monitor library.......
open(): Open Error = -47
loadprog: error - on file open
boot: cannot load "flash:"System Bootstrap, Version 12.3(8r)YH8, RELEASE SOFTWARE (fc2)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 2006 by cisco Systems, Inc.
C1800 platform with 131072 Kbytes of main memory with parity disabledUpgrade ROMMON initialized
program load complete, entry point: 0x80012000, size: 0xc0c0Initializing ATA monitor library.......
program load complete, entry point: 0x80012000, size: 0xc0c0Initializing ATA monitor library.......
open(): Open Error = -47
loadprog: error - on file open
boot: cannot load "flash:"System Bootstrap, Version 12.3(8r)YH8, RELEASE SOFTWARE (fc2)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 2006 by cisco Systems, Inc.
C1800 platform with 131072 Kbytes of main memory with parity disabledUpgrade ROMMON initialized
rommon 1 >
■ROMモニターからIOSを起動させてみる
rommon 23 > boot
program load complete, entry point: 0x80012000, size: 0xc0c0Initializing ATA monitor library.......
program load complete, entry point: 0x80012000, size: 0xc0c0Initializing ATA monitor library.......
open(): Open Error = -47
loadprog: error - on file open
boot: cannot load "flash:"
やっぱだめだ。。。
■ROMモニターからflashの中を見る
rommon 4 > dir flash:
program load complete, entry point: 0x80012000, size: 0xc0c0Initializing ATA monitor library.......
Directory of flash:2 16882452 -rw- c181x-advipservicesk9-mz.124-6.T.bin
4124 2202 -rw- sdmconfig-1811-1812.cfg
4125 4052480 -rw- sdm.tar
5115 812032 -rw- es.tar
5314 1007616 -rw- common.tar
5560 1038 -rw- home.shtml
5561 113152 -rw- home.tar
5589 511939 -rw- 128MB.sdf
一応、IOSのファイルはあるので、イメージが壊れちゃったのかもしれない。
運よく他の正常に起動する1812JのIOSイメージをtftpサーバーに保存しておいたので、それをflashに書き込むことにする。
■メモリを確認する
rommon 30 > meminfo
Main memory size: 128 MB.
Available main memory starts at 0x80012000, size 0x1ffb8 KB
IO (packet) memory size: 10 percent of main memory.
NVRAM size: 192 KB
IOSのイメージは17MBくらいだからだいじょうぶかな?
■環境変数(っていうのかな?)を確認する
rommon 31 > set
PS1=rommon ! >
RET_2_RTS=14:40:45 UTC Wed May 10 2006
WARM_REBOOT=FALSE
BSI=0
RET_2_RCALTS=
RANDOM_NUM=1663698727
?=0
■tftpを使えるように環境変数をセットする
rommon 42 > IP_ADDRESS=10.0.16.36
rommon 44 > IP_SUBNET_MASK=255.255.255.0
rommon 45 > DEFAULT_GATEWAY=10.0.16.254
rommon 46 > TFTP_SERVER=10.0.16.11
rommon 47 > TFTP_FILE=c181x-advipservicesk9-mz.124-6.T.bin
rommon 49 > TFTP_VERBOSE=2
■tftpdnldコマンドのHELP
rommon 37 > tftpdnld -hMissing or illegal ip address for variable IP_ADDRESS
Illegal IP address.usage: tftpdnld [-hr]
Use this command for disaster recovery only to recover an image via TFTP.
Monitor variables are used to set up parameters for the transfer.
(Syntax: "VARIABLE_NAME=value" and use "set" to show current variables.)
"ctrl-c" or "break" stops the transfer before flash erase begins.The following variables are REQUIRED to be set for tftpdnld:
IP_ADDRESS: The IP address for this unit
IP_SUBNET_MASK: The subnet mask for this unit
DEFAULT_GATEWAY: The default gateway for this unit
TFTP_SERVER: The IP address of the server to fetch from
TFTP_FILE: The filename to fetchThe following variables are OPTIONAL:
TFTP_VERBOSE: Print setting. 0=quiet, 1=progress(default), 2=verbose
TFTP_RETRY_COUNT: Retry count for ARP and TFTP (default=18)
TFTP_TIMEOUT: Overall timeout of operation in seconds (default=7200)
TFTP_CHECKSUM: Perform checksum test on image, 0=no, 1=yes (default=1)
FE_PORT: 0(default), 1
FE_SPEED_MODE: 0=10/hdx, 1=10/fdx, 2=100/hdx, 3=100/fdx,
4=Auto (default)Command line options:
-h: this help screen
-r: do not write flash, load to DRAM only and launch image
■TFTPでIOSイメージをflashに書き込んでみる
※EtherケーブルはFE0に挿す
rommon 50 > tftpdnldIP_ADDRESS: 10.0.16.36
IP_SUBNET_MASK: 255.255.255.0
DEFAULT_GATEWAY: 10.0.16.254
TFTP_SERVER: 10.0.16.11
TFTP_FILE: c181x-advipservicesk9-mz.124-6.T.bin
TFTP_MACADDR: 00:17:e0:b9:b0:6e
TFTP_VERBOSE: Verbose
TFTP_RETRY_COUNT: 18
TFTP_TIMEOUT: 7200
TFTP_CHECKSUM: Yes
FE_PORT: 0
FE_SPEED_MODE: Auto DetectInvoke this command for disaster recovery only.
WARNING: all existing data in all partitions on flash will be lost!
Do you wish to continue? y/n: [n]: yPerforming tftpdnld over Fast Enet.
Initializing interface.
ARPing for 10.0.16.11
ARP reply for 10.0.16.11 received. MAC address 00:03:ff:b9:b1:46
Receiving c181x-advipservicesk9-mz.124-6.T.bin from 10.0.16.11 !!!!!!!!!!!!!!!!!
(省略)
File reception completed.
Validating checksum.
Copying file c181x-advipservicesk9-mz.124-6.T.bin to flash.
program load complete, entry point: 0x80012000, size: 0xc0c0Initializing ATA monitor library.......
Format: Drive communication & 1st Sector Write OK...
Writing Monlib sectors.
................................................................................
......................
Monlib write completeFormat: All system sectors written. OK...
Format: Operation completed successfully.Format of flash: complete
program load complete, entry point: 0x80012000, size: 0xc0c0Initializing ATA monitor library.......
rommon 54 > dir flash:
program load complete, entry point: 0x80012000, size: 0xc0c0Initializing ATA monitor library.......
Directory of flash:2 16882452 -rw- c181x-advipservicesk9-mz.124-6.T.bin
■再びflushからIOSを起動してみる
rommon 55 > b
program load complete, entry point: 0x80012000, size: 0xc0c0Initializing ATA monitor library.......
program load complete, entry point: 0x80012000, size: 0xc0c0Initializing ATA monitor library.......
program load complete, entry point: 0x80012000, size: 0x101999c
Stack pointer : 0x08000000
monstack : 0x8000549C
monra : 0x00000000
edata : 0x800167D0
magic : 0xFEEDFACE
memsize : 0x08000000
uncomp_size : 0x03299C54
comp_size : 0x010151B6
STACK_BYTES : 0x00008000
COPY_CODE_BUF : 0x00000800
_end : 0x8003F044
comp_checksum : 0x10E5B470
comp_checksum : 0x10E5B470
uncomp_checksum : 0x253667B2
Self decompressing the image : #################################################
################################################################################
################################################################################
################################################################################
############################### [OK]
Source elf_hdr->e_shnum = 0x00000009
Setting up to copy ELF section 0x00000001
to image_info section 0x00000000
sh_name = 0x0000000B
sh_type = 0x00000001
sh_flags = 0x00000007
sh_addr = 0x80012000
sh_offset = 0x00000060
sh_size = 0x01F0ACEC
sh_link = 0x00000000
sh_info = 0x00000000
sh_addralign = 0x00000020
sh_entsize = 0x00000000
Setting up to copy ELF section 0x00000002
to image_info section 0x00000001
sh_name = 0x00000011
sh_type = 0x00000001
sh_flags = 0x00000002
sh_addr = 0x81F1CCEC
sh_offset = 0x01F0AD4C
sh_size = 0x01054F9C
sh_link = 0x00000000
sh_info = 0x00000000
sh_addralign = 0x00000008
sh_entsize = 0x00000000
Setting up to copy ELF section 0x00000004
to image_info section 0x00000002
sh_name = 0x00000021
sh_type = 0x00000001
sh_flags = 0x00000003
sh_addr = 0x82F71C88
sh_offset = 0x02F5FCE8
sh_size = 0x00339B98
sh_link = 0x00000000
sh_info = 0x00000000
sh_addralign = 0x00000008
sh_entsize = 0x00000000
Setting up to copy ELF section 0x00000005
to image_info section 0x00000003
sh_name = 0x00000027
sh_type = 0x00000001
sh_flags = 0x00000003
sh_addr = 0x832AB820
sh_offset = 0x03299880
sh_size = 0x00000230
sh_link = 0x00000000
sh_info = 0x00000000
sh_addralign = 0x00000004
sh_entsize = 0x00000000
cpu type : 0x00000013
uncomp_size : 0x03299C54
monstack : 0x8000549Cimage_info.entry_point = 0x80012000
image_info.section_count = 0x00000004
image_info.monstack = 0x8000549C
image_info.monra = 0x00000000
image_info.param0 = 0x00000002
image_info.param1 = 0x00000000
image_info.param2 = 0x00000000
image_info.param3 = 0x00000000
Section Index = 0x00000000
source = 0x8003F1A4
dest = 0x80012000
bytes = 0x01F0ACEC
Section Index = 0x00000001
source = 0x81F49E90
dest = 0x81F1CCEC
bytes = 0x01054F9C
Section Index = 0x00000002
source = 0x82F9EE2C
dest = 0x82F71C88
bytes = 0x00339B98
Section Index = 0x00000003
source = 0x832D89C4
dest = 0x832AB820
bytes = 0x00000230Restricted Rights Legend
Use, duplication, or disclosure by the Government is
subject to restrictions as set forth in subparagraph
(c) of the Commercial Computer Software - Restricted
Rights clause at FAR sec. 52.227-19 and subparagraph
(c) (1) (ii) of the Rights in Technical Data and Computer
Software clause at DFARS sec. 252.227-7013.cisco Systems, Inc.
170 West Tasman Drive
San Jose, California 95134-1706Cisco IOS Software, C181X Software (C181X-ADVIPSERVICESK9-M), Version 12.4(6)T,
RELEASE SOFTWARE (fc1)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2006 by Cisco Systems, Inc.
Compiled Wed 22-Feb-06 21:22 by ccai
Image text-base: 0x80012124, data-base: 0x81F1CCEC
This product contains cryptographic features and is subject to United
States and local country laws governing import, export, transfer and
use. Delivery of Cisco cryptographic products does not imply
third-party authority to import, export, distribute or use encryption.
Importers, exporters, distributors and users are responsible for
compliance with U.S. and local country laws. By using this product you
agree to comply with applicable laws and regulations. If you are unable
to comply with U.S. and local laws, return this product immediately.A summary of U.S. laws governing Cisco cryptographic products may be found at:
http://www.cisco.com/wwl/export/crypto/tool/stqrg.htmlIf you require further assistance please contact us by sending email to
export@cisco.com.Installed image archive
Cisco 1812-J (MPC8500) processor (revision 0x400) with 118784K/12288K bytes of m
emory.
Processor board ID FHK1019226G, with hardware revision 000010 FastEthernet interfaces
1 ISDN Basic Rate interface
31360K bytes of ATA CompactFlash (Read/Write)
--- System Configuration Dialog ---Would you like to enter the initial configuration dialog? [yes/no]: no
Press RETURN to get started!Router>
やったー!
■しかし、flashの中のファイルはIOSのイメージしかなくなってしまったので、他のも移し変える必要があると思う。
Router>enalbe
Router#show flash
-#- --length-- -----date/time------ path
1 16882452 May 29 1905 09:26:48 +00:00 c181x-advipservicesk9-mz.124-6.T.bin15048704 bytes available (16883712 bytes used)
Router#
■移し変えました。
Router#show flash
-#- --length-- -----date/time------ path
1 16882452 May 29 1905 09:26:48 +00:00 c181x-advipservicesk9-mz.124-6.T.bin
2 1007616 Jun 15 2006 12:06:16 +00:00 common.tar
3 511939 Jun 15 2006 12:06:42 +00:00 128MB.sdf
4 4052480 Jun 15 2006 12:07:10 +00:00 sdm.tar
5 2202 Jun 15 2006 12:09:38 +00:00 sdmconfig-1811-1812.cfg
6 812032 Jun 15 2006 12:09:58 +00:00 es.tar
7 1038 Jun 15 2006 12:10:18 +00:00 home.shtml
8 113152 Jun 15 2006 12:11:26 +00:00 home.tar8536064 bytes available (23396352 bytes used)
■コンフィグレーションレジスタが0xA102になっているので、0x2102に書き換えてリブートします
Router#conf t
Router(config)#config-register 0x2102
Router(config)#^Z
Router#
Router#reloadSystem configuration has been modified. Save? [yes/no]: yes
Building configuration...
[OK]
Proceed with reload? [confirm]*Jun 15 12:18:44.927: %SYS-5-RELOAD: Reload requested by console. Reload Reason:
Reload Command.