You are on page 1of 19

文件系统基础

HUAWEI TECHNOLOGIES CO., LTD.


前言

华为网络设备的配置文件和 VRP 系统文件都保存在物理存储介质中 ,所以


文件系统是 VRP 正常运行的基础。只有掌握了对文件系统的基本操作 ,网
络工程师才能对设备的配置文件和 VRP 系统文件进行高效的管理。

Copyright © 2013 Huawei Technologies Co., Ltd. All rights reserved. Page 2
学习目标

学完本课程后,您应该能:
 掌握文件系统的基本操作

Copyright © 2013 Huawei Technologies Co., Ltd. All rights reserved. Page 3
基本查询命令

功能 命令
查看当前目录 pwd
显示当前目录下的文件信息 dir
查看文本文件的具体内容 more

<Huawei>dir
<Huawei>dir
Directory
Directory of
of flash:/
flash:/
Idx
Idx Attr
Attr Size(Byte)
Size(Byte) Date
Date Time
Time FileName
FileName
00 drw-
drw- -
- Apr
Apr 10
10 2013
2013 09:30:35
09:30:35 src
src
11 -rw-
-rw- 28
28 Apr 10
Apr 10 2013
2013 09:31:38
09:31:38 private-data.txt
private-data.txt
22 -rw-
-rw- 120
120 Apr
Apr 10
10 2013
2013 09:32:38
09:32:38 wzbk1.cfg
wzbk1.cfg
……
……
32,004
32,004 KB
KB total
total (31,995
(31,995 KB
KB free)
free)

Copyright © 2013 Huawei Technologies Co., Ltd. All rights reserved. Page 4
目录操作

功能 命令
修改用户当前界面的工作目录 cd
创建新的目录 mkdir
删除目录 rmdir

<Huawei>mkdir
<Huawei>mkdir test
test
Info:
Info: Create
Create directory
directory flash:/test......Done.
flash:/test......Done.
<Huawei>dir
<Huawei>dir
Directory
Directory ofof flash:
flash:
Idx
Idx Attr
Attr Size(Byte)
Size(Byte) Date
Date Time
Time FileName
FileName
00 drw-
drw- -
- Apr 10 2013 09:30:35
Apr 10 2013 09:30:35 src
src
11 -rw-
-rw- 28
28 Apr
Apr 10
10 2013
2013 09:31:38
09:31:38 private-data.txt
private-data.txt
22 -rw-
-rw- 120
120 Apr 10 2013 09:32:38
Apr 10 2013 09:32:38 wzbk1.cfg
wzbk1.cfg
33 drw-
drw- -
- Apr
Apr 10
10 2013
2013 09:53:11
09:53:11 test
test
……
……
32,004
32,004 KBKB total
total (31,995
(31,995 KB
KB free)
free)

Copyright © 2013 Huawei Technologies Co., Ltd. All rights reserved. Page 5
文件操作

功能 命令
复制文件 copy
移动文件 move
重命名文件 rename

<Huawei>rename
<Huawei>rename test.txt
test.txt huawei.txt
huawei.txt
Rename
Rename flash:/test.txt to flash:/huawei.txt
flash:/test.txt to flash:/huawei.txt ?[Y/N]:y
?[Y/N]:y
Info:
Info: Rename
Rename file
file flash:/test.txt
flash:/test.txt to to flash:/huawei.txt
flash:/huawei.txt ......Done.
......Done.
<Huawei>dir
<Huawei>dir
Directory
Directory ofof flash:/
flash:/
Idx
Idx Attr
Attr Size(Byte)
Size(Byte) Date
Date Time
Time FileName
FileName
00 drw-
drw- -
- Apr 10 2013 09:30:35
Apr 10 2013 09:30:35 src
src
11 -rw-
-rw- 28
28 Apr
Apr 10
10 2013
2013 09:31:38
09:31:38 private-data.txt
private-data.txt
22 -rw-
-rw- 120
120 Apr 10 2013 09:32:38
Apr 10 2013 09:32:38 wzbk1.cfg
wzbk1.cfg
33 -rw-
-rw- 12
12 Apr 10 2013 09:53:11
Apr 10 2013 09:53:11 huawei.txt
huawei.txt
……
……
32,004
32,004 KBKB total
total (31,995
(31,995 KB
KB free)
free)

Copyright © 2013 Huawei Technologies Co., Ltd. All rights reserved. Page 6
文件操作

功能 命令
删除 / 永久删除文件 delete /unreserved
恢复删除的文件 undelete
彻底删除回收站中的文件 reset recycle-bin

<Huawei>delete
<Huawei>delete /unreserved
/unreserved flash:/huawei.txt
flash:/huawei.txt
<Huawei>dir
<Huawei>dir
Directory
Directory of
of flash:/
flash:/
Idx
Idx Attr
Attr Size(Byte)
Size(Byte) Date
Date Time
Time FileName
FileName
00 drw-
drw- -- Apr
Apr 10
10 2013
2013 09:30:35
09:30:35 src
src
11 -rw-
-rw- 28
28 Apr 10 2013 09:31:38
Apr 10 2013 09:31:38 private-data.txt
private-data.txt
22 -rw-
-rw- 120
120 Apr
Apr 10
10 2013
2013 09:32:38
09:32:38 wzbk1.cfg
wzbk1.cfg
……
……
32,004
32,004 KB
KB total
total (30,995
(30,995 KBKB free)
free)

Copyright © 2013 Huawei Technologies Co., Ltd. All rights reserved. Page 7
配置文件管理

Current- Saved-
保存
Configuration File Configuration File

加载
RAM Flash/SD 卡

 设备启动时,会加载保存的配置文件到 RAM ,并作为当前配置文件。


Copyright © 2013 Huawei Technologies Co., Ltd. All rights reserved. Page 8
配置文件查询

功能 命令

显示当前配置文件 display current-configuration

显示保存的配置文件 display saved-configuration

<Huawei>display
<Huawei>display current-configuration
current-configuration
##
sysname
sysname Huawei
Huawei
……
……
##
Return
Return
<Huawei>display
<Huawei>display saved-configuration
saved-configuration
##
sysname
sysname Huawei
Huawei
……
……
##
Return
Return

Copyright © 2013 Huawei Technologies Co., Ltd. All rights reserved. Page 9
配置文件保存

功能 命令

保存当前配置信息 save

<Huawei>save
<Huawei>save
The
The current
current configuration
configuration will
will be
be written
written to
to the
the device.
device.
Are
Are you
you sure
sure to
to continue?
continue? (y/n)[n]:y
(y/n)[n]:y
It
It will take several minutes to
will take several minutes to save
save configuration
configuration file,
file, please
please
wait...............
wait...............
Configuration
Configuration file
file had
had been
been saved
saved successfully
successfully
Note:
Note: The configuration file will take effect
The configuration file will take effect after
after being
being
activated
activated

Copyright © 2013 Huawei Technologies Co., Ltd. All rights reserved. Page 10
系统启动文件查询

功能 命令

查看系统启动配置参数 display startup

<Huawei>display
<Huawei>display startup
startup
MainBoard:
MainBoard:
Startup
Startup system
system software:
software: sd1:/ar2220-v200r003c00spc200.cc
sd1:/ar2220-v200r003c00spc200.cc
Next startup system software: sd1:/ar2220-v200r003c00spc200.cc
Next startup system software: sd1:/ar2220-v200r003c00spc200.cc
Backup
Backup system
system software
software for
for next
next startup:
startup: null
null
Startup saved-configuration file:
Startup saved-configuration file: null
null
Next
Next startup
startup saved-configuration
saved-configuration file:
file: sd1:/vrpcfg.zip
sd1:/vrpcfg.zip
Startup license file:
Startup license file: null
null
Next startup license file:
Next startup license file: null
null
Startup patch package:
Startup patch package: null
null
Next startup patch package:
Next startup patch package: null
null
Startup voice-files:
Startup voice-files: null
null
Next
Next startup
startup voice-files:
voice-files: null
null

Copyright © 2013 Huawei Technologies Co., Ltd. All rights reserved. Page 11
系统启动配置文件修改

功能 命令

配置系统下次启动时使用的配置文件 startup saved-configuration

<Huawei>startup
<Huawei>startup saved-configuration
saved-configuration huawei.zip
huawei.zip
This
This operation will take several minutes, please
operation will take several minutes, please wait.....
wait.....
Info:
Info: Succeeded in setting the configuration for booting system.
Succeeded in setting the configuration for booting system.
<Huawei>display startup
<Huawei>display startup
MainBoard:
MainBoard:
Configured
Configured startup
startup system
system software:sd1:/ar2220-v200r003c00spc200.cc
software:sd1:/ar2220-v200r003c00spc200.cc
Startup system software:
Startup system software: sd1:/ar2220-v200r003c00spc200.cc
sd1:/ar2220-v200r003c00spc200.cc
Next startup system software:
Next startup system software: NULL
NULL
Startup saved-configuration
Startup saved-configuration file:file: NULL
NULL
Next startup saved-configuration file: sd1:/huawei.zip
Next startup saved-configuration file: sd1:/huawei.zip
Startup
Startup paf
paf file:
file: NULL
NULL
Next startup paf file:
Next startup paf file: NULL
NULL
Startup license file:
Startup license file: NULL
NULL
Next startup license file:
Next startup license file: NULL
NULL
Startup patch package:
Startup patch package: NULL
NULL
Next
Next startup
startup patch
patch package:
package: NULL
NULL

Copyright © 2013 Huawei Technologies Co., Ltd. All rights reserved. Page 12
比较当前配置和保存的配置

功能 命令

比较当前配置与下次启动的配置 compare configuration

<Huawei>compare
<Huawei>compare configuration
configuration
======
====== Current configuration line
Current configuration line 36
36 ======
======
ip
ip address
address 10.1.1.1
10.1.1.1 255.255.255.0
255.255.255.0
##
interface
interface GigabitEthernet0/0/2
GigabitEthernet0/0/2
##
interface
interface GigabitEthernet0/0/3
GigabitEthernet0/0/3
##
interface
interface NULL0
NULL0
======
====== Configuration file
Configuration file line
line 37
37 ======
======
interface GigabitEthernet0/0/2
interface GigabitEthernet0/0/2
##
interface
interface GigabitEthernet0/0/3
GigabitEthernet0/0/3
##
……
……

Copyright © 2013 Huawei Technologies Co., Ltd. All rights reserved. Page 13
配置文件重置

功能 命令

清除下次启动时加载的配置文件 reset saved-configuration

<Huawei>reset
<Huawei>reset saved-configuration
saved-configuration
Warning:
Warning: The
The action
action will
will delete
delete the
the saved
saved configuration
configuration in
in the
the
device.
device.
The
The configuration
configuration will
will be
be erased
erased to
to reconfigure.
reconfigure. Continue?
Continue? [Y/N]:y
[Y/N]:y
Warning: Now clearing the configuration in the device.
Warning: Now clearing the configuration in the device.
Apr
Apr 10
10 2013
2013 14:43:13-08:00
14:43:13-08:00 Huawei
Huawei %%01CFM/4/RST_CFG(l)[2]:The
%%01CFM/4/RST_CFG(l)[2]:The user
user
chose
chose YY when
when
deciding
deciding whether
whether to
to reset
reset the
the saved
saved configuration.
configuration.
Info:
Info: Succeeded in clearing the configuration in
Succeeded in clearing the configuration in the
the device.
device.

Copyright © 2013 Huawei Technologies Co., Ltd. All rights reserved. Page 14
存储设备

 SDRAM <Huawei>display
<Huawei>display version
version
……
……
 Flash
SDRAM
SDRAM Memory
Memory Size
Size :: 2048
2048 MM bytes
bytes
 NVRAM Flash
Flash Memory
Memory Size
Size :: 16
16 MM bytes
bytes
NVRAM
NVRAM Memory
Memory Size
Size :: 512
512 KK bytes
bytes
 SD Card SD
SD Card1
Card1 Memory
Memory Size
Size :: 1882
1882 MM bytes
bytes
……
……
 USB

Copyright © 2013 Huawei Technologies Co., Ltd. All rights reserved. Page 15
存储设备修复

<Huawei>fixdisk
<Huawei>fixdisk flash:
flash:
Fixdisk
Fixdisk flash:
flash: will
will take
take long
long time
time if
if needed
needed
%Fixdisk
%Fixdisk flash:
flash: completed.
completed.

<Huawei>fixdisk
<Huawei>fixdisk sd1:
sd1:
sd1:/
sd1:/ -- disk
disk check
check in
in progress
progress
……
……
%Fixdisk
%Fixdisk sd1:
sd1: completed.
completed.

 当存储设备的文件系统出现异常时,可以通过 fixdisk 命令进行修复。


Copyright © 2013 Huawei Technologies Co., Ltd. All rights reserved. Page 16
存储设备格式化

<Huawei>format
<Huawei>format flash:
flash:
All
All data(include
data(include configuration
configuration and
and system
system startup
startup file)
file) on
on flash:
flash:
will
will be
be lost
lost ,, proceed
proceed with
with format?
format? (y/n)[n]:
(y/n)[n]:

<Huawei>format
<Huawei>format sd1:
sd1:
All
All data(include
data(include configuration
configuration and
and system
system startup
startup file)
file) on
on sd1:
sd1: will
will
be
be lost
lost ,, proceed
proceed with
with format?
format? (y/n)[n]:
(y/n)[n]:

 格式化会导致数据丢失!
Copyright © 2013 Huawei Technologies Co., Ltd. All rights reserved. Page 17
总结

 设备中的文件属性中有 drw ,其中 d 代表什么含义?


 如果设备中有多个配置文件,如何指定下次启动时使用的配置文件 ?

Copyright © 2013 Huawei Technologies Co., Ltd. All rights reserved. Page 18
谢谢
www.huawei.com

You might also like