|
查看当前存储介质(假设实际不知道)的方法
r2#cd ? flash: Directory name
flh: Directory name
lex: Directory name
null: Directory name
nvram: Directory name
system: Directory name
<cr>
r2#dir all Directory of nvram:/
30 -rw- 465 <no date> startup-config
31 ---- 24 <no date> private-config
32762 bytes total (32223 bytes free)
Directory of system:/
2 dr-x 0 <no date> memory
1 -rw- 481 <no date> running-config
11 dr-x 0 <no date> vfiles
16777212 bytes total (787600 bytes free)
设备名字称谓(要带冒号)
nvram: (NVRAM)bootflash: 通常称做flash memory的,是内部internal flash,也称做bootflash:或flash:slot0: slot1:
first PCMCIA slot second PCMCIA slot
注意要带冒号:
r2#cd nvram
%Error statting flash:/nvram (No such file or directory)
r2-2501#cd nvram:
低版本IOS造成的flash卡问题
dir slot0: 系统告诉slot0:不存在,format slot0:也告诉不存在.
后来怀疑这个卡不叫slot0:,而是叫别的名字.叫什么呢?
后来用show diagnose,show tech都能查到 原来这个卡在当前IOS版本下叫disk0:
delete ,undelete
Router# delete [device:]filename
Router# undelete index [filesystem:] Restores a deleted file on a Flash memory device.
Router# delete slot0:myconfig
Router# undelete 1 slot0:
squeeze真正的删除,永远删除
Router# squeeze filesystem:
Router# squeeze slot1:
All deleted files will be removed. Continue? [confirm]
Squeeze operation may take a while. Continue? [confirm]
Erasing squeeze log
Squeeze of slot1: complete
format
Router# format slot0:
Running config file on this device, proceed? [confirm]y
All sectors will be erased, proceed? [confirm]y
Enter volume> verifty /md5
先取值,再比较,一般用于COPY IOS IMAGE前后文件一致性的检查
Router# verify /md5 slot0: Verify filename []? c7200-js-mz
...................................Done!
verify /md5 (disk1:c7200-js-mz) = 0f369ed9e98756f179d4f29d6e7755d3
rouer也可以学UNIX的fscy -y
fsck filesystem: [/automatic]
rommon状态下,manually boot from Flash memory
rommon > boot 从rom启动
Boots the default system software from ROM
rommon> boot flash F3: 1858656+45204+166896 at 0x1000
Booting gs7-k from flash memory RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
从flash的第一个文件启动
注意不是flash卡,是internal flash memory
ROMMON > boot flash [filename] ROMMON > boot flash partition-number:[filename]
ROMMON > boot flash flash:[ partition-number:] [filename]
ROMMON > boot [flash-fs:][partition-number:][filename] (Cisco 1600 series and Cisco 3600 series)
boot slot0:3:imagename
ROMMON > boot device:[filename] (Cisco 7000 family)
启动引导——boot system
boot system flash从bootflash:第一个文件引导boot system c7200-js-mz 172.16.101.101从网络引导boot system tftp从网络引导 (config)# boot system rom (config)# config-register 0x0
从rom启动
网络引导——routerB通过TFTP从routerA引导
routerAtftp-server flash: c5300-js-mz.121-5.T.bin 9 定义回应client发来的get/read request的image 文件名
!
access-list 9 permit 172.16.101.0 0.0.0.255
限定tftp client所在的网络
routerBboot system c5300-js-mz.121-5.T.bin 172.16.111.111 定义从routerA的TFTP引导
tftp client 的附加配置
r4 (config)#ip tftp ? boot-interface Force interface to use for TFTP booting
网络引导的接口
source-interface Specify interface for source address in TFTP connections
copy to ftp
第一种方法:
Router# copy run ftp://netadmin1:mypass@172.16.101.101/Rtr2-confg 用户名 密码 地址 文件名
Write file rtr2-confg on host 172.16.101.101?[confirm]
Building configuration...[OK]
Connected to 172.16.101.101
第二种方法:Rtr2(config)# ip ftp username netadmin2 Rtr2(config)# ip ftp password mypass
Rtr2# copy start ftp:
Remote host[]? 172.16.101.101
Name of configuration file to write [rtr2-confg]?
Write file rtr2-confg on host 172.16.101.101?[confirm]
![OK]
ip ftp ...指令设FTP缺省参数,为所有调用ftp的指令服务
ip ftp username zorro ip ftp password sword
ip ftp passive
ip ftp source-interface loopback 0
老的boot system总no不掉,有时必须执行此语句
Router(config)#no boot config c:auto_config_slot#
否则boot system语句总上no 不掉
show boot的BOOT变量其实还是跟着boot system指令走的,只不过变化得慢一些
改完boot system后,要过一会儿,再show boot,才能看到BOOT变量变化
来源:(http://blog.sina.com.cn/s/blog_6151984a0100f2xl.html) - IOS File System_macg_新浪博客 |
|
|