For information on
the modification of the order for the device to select Web file when the device
boots, refer to Booting with the
Startup File.
When configuring file system management, go
to these sections for information you are interested in:
l
File System Configuration
l
File Attribute Configuration
l
Configuration File Backup
and Restoration
To facilitate management on the switch memory,
S5600 series Ethernet switches provide the file system function, allowing you to
access and manage the files and directories. You can create, remove, copy or
delete a file through command lines, and you can manage files using
directories.
1.1.2 File System Configuration Task List
Complete the following tasks to configure the
file system:
The S5600 series Ethernet switches support Intelligent Resilient
Framework (IRF), and allow you to access a file on a switch in one of the
following ways:
l
To access a file on the specified unit, you need
to specify the file in universal resource locator (URL) format and starting with
unit[No.]>flash:/, where [No.] represents the unit ID of the
switch. For example, if the unit ID of the switch is 1, the URL of a file named
text.txt in the root directory of the switch is unit1>flash:/text.txt.
l
To access a file on the current unit, you need
to enter the file URL starting with flash:/. For example, the URL of
file text.txt in the root directory of the Flash on the current unit is flash:/text.txt.
l
To access a file in the current directory, enter
the path name or file name directly. For example, to access file text.txt in
the current directory, you can directly input the file name text.txt as
the file URL.
1.1.3 Directory Operations
The file system provides directory-related functions,
such as:
l
Creating/deleting a directory
l
Displaying the current work directory, or contents
in a specified directory
Follow these steps to perform directory-related operations:
|
To do…
|
Use the command…
|
Remarks
|
|
Create a directory
|
mkdir directory
|
Optional
Available in user view
|
|
Delete a directory
|
rmdir directory
|
Optional
Available in user view
|
|
Display the current work directory
|
pwd
|
Optional
Available in user view
|
|
Display the information about specific directories
and files
|
dir [ /all
] [ /fabric | file-url ]
|
Optional
Available in user view
|
|
Enter a specified directory
|
cd directory
|
Optional
Available in user view
|
l
Only empty directories can be deleted by using
the rmdir command.
l In the output information of the dir /all command,
deleted files (that is, those stored in the recycle bin) are embraced in
brackets.
Follow these
steps to perform file-related operations:
|
To do…
|
Use the command…
|
Remarks
|
|
Delete a file
|
delete [ /unreserved
] file-url
delete { running-files
| standby-files } [ /fabric ] [ /unreserved ]
|
Optional
A deleted file can be restored by using
the undelete command if you delete it by executing the delete
command without specifying the /unreserved keyword.
Available in user view
|
|
Restore a file in the recycle bin
|
undelete file-url
|
Optional
Available in user view
|
|
Delete a file from the recycle bin
|
reset recycle-bin [ file-url ] [ /force ]
reset recycle-bin [ /fabric ]
|
Optional
Available in user view
|
|
Upgrade the software of the whole fabric
|
update fabric file-name
|
Optional
Available in user view
|
|
Rename a file
|
rename
fileurl-source fileurl-dest
|
Optional
Available in user view
|
|
Copy a file
|
copy
fileurl-source fileurl-dest
|
Optional
Available in user view
|
|
Move a file
|
move fileurl-source
fileurl-dest
|
Optional
Available in user view
|
|
Display the content of a file
|
more file-url
|
Optional
Available in user view
Currently, the file system only supports
displaying the contents of text files.
|
|
Display the information about a directory
or a file
|
dir [ /all
] [ /fabric | file-url ]
|
Optional
Available in user view
|
|
Enter system view
|
system-view
|
—
|
|
Execute the specified batch file
|
execute filename
|
Optional
Available in system view
|
Caution:
l
For deleted files whose names are the same, only
the latest deleted file is kept in the recycle bin and can be restored.
l
The files which are deleted by the delete
command without the /unreserved keyword are actually moved to the
recycle bin and thus still take storage space. You can clear the recycle bin by
using the reset recycle-bin command.
l
Use the update fabric command after all traffic
flows are stopped.
l
The dir /all command displays the files in
the recycle bin in square brackets.
l
If the configuration files are deleted, the
switch adopts the null configuration when it starts up next time.
Follow these steps to perform Flash memory operations:
|
To do…
|
Use the command…
|
Remarks
|
|
Format the Flash memory
|
format device
|
Required
Available in user view
|
|
Restore space on the Flash memory
|
fixdisk device
|
Required
Available in user view
|
Caution:
The format
operation leads to the loss of all files, including the configuration files, on
the Flash memory and is irretrievable.
You can set the prompt mode of the current
file system to alert or quiet. In alert mode, the file system
will give a prompt for confirmation if you execute a command which may cause
data loss, for example, deleting or overwriting a file. In quiet mode, such
prompt will not be displayed.
Follow these steps to set the prompt mode
of file system:
|
To do…
|
Use the command…
|
Remarks
|
|
Enter
system view
|
system-view
|
—
|
|
Configure
the prompt mode of the file system
|
file
prompt { alert | quiet }
|
Required
By default,
the prompt mode of the file system is alert.
|
# Display all the files in the root
directory of the file system on the local unit.
<Sysname> dir /all
Directory of unit1>flash:/
1 (*) -rw- 5822215 Jan 01
1970 00:07:03 test.bin
2 -rwh 4 Apr 01
2000 23:55:49 snmpboots
3 -rwh 428 Apr 02
2000 00:47:30 hostkey
4 -rwh 572 Apr 02
2000 00:47:38 serverkey
5 -rw- 1220 Apr 02
2000 00:06:57 song.cfg
6 -rw- 5026103 Jan 01
1970 00:04:34 testv1r1.bin
7 -rwh 88 Apr 01
2000 23:55:53 private-data.txt
8 (*) -rw- 1376 Apr 02
2000 01:56:28 config.cfg
15367 KB total (4634 KB free)
(*) -with main attribute (b) -with
backup attribute
(*b) -with both main and backup
attribute
# Copy the file flash:/config.cfg to
flash:/test/, with 1.cfg as the name of the new file.
<Sysname> copy flash:/config.cfg
flash:/test/1.cfg
Copy unit1>flash:/config.cfg to
unit1>flash:/test/1.cfg?[Y/N]:y
..
%Copy file unit1>flash:/config.cfg
to unit1>flash:/test/1.cfg...Done.
# Display the file information after the
copy operation.
<Sysname>
dir /all
Directory of unit1>flash:/
1 (*) -rw- 5822215 Jan 01
1970 00:07:03 test.bin
2 -rwh 4 Apr 01
2000 23:55:49 snmpboots
3 -rwh 428 Apr 02
2000 00:47:30 hostkey
4 -rwh 572 Apr 02 2000
00:47:38 serverkey
5 -rw- 1220 Apr 02
2000 00:06:57 song.cfg
6 -rw- 5026103 Jan 01
1970 00:04:34 testv1r1.bin
7 -rwh 88 Apr 01
2000 23:55:53 private-data.txt
8 (*) -rw- 1376 Apr 02
2000 01:56:28 config.cfg
9 drw- - Apr 04
2000 04:50:07 test
15367 KB total (4631 KB free)
(*) -with main attribute (b) -with
backup attribute
(*b) -with both main and backup
attribute
<Sysname> dir
unit1>flash:/test/
Directory of unit1>flash:/test/
1 -rw- 1376 Apr 04
2000 04:50:30 1.cfg
15367 KB total (2025 KB free)
(*) -with main attribute (b) -with
backup attribute
(*b) -with both main and backup
attribute
The following three startup files support
file attribute configuration:
l
App files: An app file is an executable file,
with .bin as the extension.
l
Configuration files: A configuration file is
used to store and restore configuration, with .cfg as the extension.
l
Web files: A Web file is used for Web-based
network management, with .web as the extension.
The app files, configuration files, and Web
files support three kinds of attributes: main, backup and none, as described in
Table 1-1.
Table 1-1 Descriptions on file
attributes
|
Attribute name
|
Description
|
Feature
|
Identifier
|
|
main
|
Identifies main startup files. The main
startup file is preferred for a switch to start up.
|
In the Flash memory, there can be only
one app file, one configuration file and one Web file with the main
attribute.
|
(*)
|
|
backup
|
Identifies backup startup files. The
backup startup file is used after a switch fails to start up using the main
startup file.
|
In the Flash memory, there can be only one
app file, one configuration file and one Web file with the backup attribute.
|
(b)
|
|
none
|
Identifies files that are neither of main
attribute nor backup attribute.
|
—
|
None
|
A file can have
both the main and backup attributes. Files of this kind are labeled *b.
Note that, there can be only one app file,
one configuration file and one Web file with the main attribute in the Flash
memory. If a newly created file is configured to be with the main attribute,
the existing file with the main attribute in the Flash memory will lose its
main attribute. This circumstance also applies to the file with the backup
attribute in the Flash memory.
File operations and file attribute
operations are independent. For example, if you delete a file with the main
attribute from the Flash memory, the other files in the flash memory will not
possess the main attribute. If you download a valid file with the same name as
the deleted file to the flash memory, the file will possess the main attribute.
After the Boot ROM of a switch is upgraded,
the original default app file has the main attribute.
The device selects the main startup file as
the preferred startup file. If the device fails to boot with the main startup
file, it boots with the backup startup file.
For the Web file and configuration file, Hangzhou
H3C Technologies Co., Ltd (referred to as H3C hereinafter) may provide
corresponding default file when releasing software versions. When booting, the
device selects the startup files based on certain order. The device selects Web
files in the following steps:
1)
If the default Web file exists, the device will boot
with the default Web file;
2)
If the default Web file does not exist, but the
main Web file exists, the device will boot with the main Web file;
3)
If neither the default Web file nor the main Web
file exists, but the backup Web exists, the device will boot with the backup
Web file;
4)
If neither of the default Web file, main Web
file and backup Web exists, the device considers that no Web file exists.
For the selection of the configuration file
when the device boots, refer to the Configuration File Management part
in this manual.
You can configure and view the main
attribute or backup attribute of the file used for the next startup of a
switch, and change the main or backup attribute of the file.
Follow these steps to configure file
attributes:
|
To do…
|
Use the command…
|
Remarks
|
|
Configure the app file with the main
attribute for the next startup
|
boot boot-loader
file-url [ fabric ]
|
Optional
Available in user view
|
|
Configure the app file with the backup
attribute for the next startup
|
boot boot-loader
backup-attribute file-url [ fabric ]
|
Optional
Available in user view
|
|
Configure the Web file and its attribute
|
boot web-package
webfile { backup | main }
|
Optional
Available in user view
|
|
Switch the file attributes between main
and backup
|
boot attribute-switch
{ all | app | configuration | web } fabric
|
Optional
Available in user view
|
|
Specify to enable user to use the
customized password to enter the BOOT menu
|
startup bootrom-access enable
|
Optional
By default, the user is enabled to use
the customized password to enter the BOOT menu.
Available in user view
|
|
Display the information about the app
file used as the startup file
|
display boot-loader [ unit unit-id ]
|
Optional
Available in any view
|
|
Display information about the Web file
used by the device
|
display web package
|
Caution:
l
Before configuring the main or backup attribute
for a file in the fabric, make sure the file already exists on all devices in
the fabric.
l
The configuration of the main or backup
attribute of a Web file takes effect immediately without restarting the switch.
l
After upgrading a Web file, you need to specify
the new Web file in the Boot menu after restarting the switch or specify a new
Web file by using the boot web-package command. Otherwise, Web server
cannot function normally.
l
Currently, a configuration file has the
extension of cfg and resides in the root directory of the Flash memory.
l
For the detailed configuration of configuration
file attributes, refer to the Configuration File Management module in
this manual.
Formerly, you can only back up and restore
the configuration file of the units one by one in a fabric system.
By using the configuration file backup and
restoration feature, you can easily back up and restore the configuration files
in the whole fabric as well as in a specific unit.
In the backup process, the system first
saves the current configuration of a unit to the startup configuration file,
and then uploads the file to the TFTP server. In the restore process, the
system downloads the startup configuration file from the TFTP server to the
local unit.
The configurations of different units in
the fabric system can be saved in different .cfg configuration files on the
TFTP server. These configuration files form the startup configuration of the
whole fabric.
I. Configuration prerequisites
Before performing the following operations,
you must first ensure that:
l
The relevant units support TFTP client.
l
The TFTP server is started
l
A route exists between the TFTP server and TFTP
client.
II. Configuration procedure
Follow these steps to back up and restore configuration file:
|
To do…
|
Use the command…
|
Remarks
|
|
Back up
the current configuration of a specified unit
|
backup unit unit-id current-configuration to { dest-addr
| dest-hostname } filename.cfg
|
Optional
Available
in user view
|
|
Back up the
current configuration of the whole fabric system
|
backup fabric current-configuration to { dest-addr
| dest-hostname } filename.cfg
|
Optional
Available
in user view
|
|
Restore the startup configuration of a
specified unit
|
restore unit
unit-id startup-configuration from { source-addr | source-hostname
} filename.cfg
|
Optional
Available in user view
|
|
Restore the startup configuration of the
whole fabric system
|
restore fabric
startup-configuration from { source-addr | source-hostname }
filename.cfg
|
Optional
Available in user view
|