Throughout this
document, a filename can be entered as either of the following:
l
A fully qualified filename with the path
included to indicate a file under a specific path. The filename can be 1 to 135
characters in length.
l
A short filename with the path excluded to
indicate a file in the current path. The filename can be 1 to 91 characters in
length.
When configuring the file system management,
go to these sections for information you are interested in:
l
File
System Management
l
Configuration
File Management
l
Displaying
and Maintaining Device Configuration
1.1 File System Management
This section covers these topics:
l
File
System Overview
l
Directory
Operations
l
File
Operations
l
Storage
Device Operations
l
File
System Prompt Mode Setting
l
File
System Operations Examples
1.1.1 File System Overview
A major function of the file system is to
manage storage devices. It allows you to perform operations such as directory
create and delete, and file copy and display. If an operation, delete or
overwrite for example, may cause problems such as data loss or corruption, the
file system will ask you to confirm the operation by default.
Depending on the managed object, file
system operations fall into Directory
Operations, File
Operations, Storage
Device Operations, and File System Prompt Mode Setting.
1.1.2 Directory Operations
Directory operations include create,
delete, display the current path, display specified directory or file
information as shown in the following table:
|
To do…
|
Use the command…
|
Remarks
|
|
Create a directory
|
mkdir directory
|
Optional
|
|
Remove a directory
|
rmdir directory
|
Optional
|
|
Display the current path
|
pwd
|
Optional
|
|
Display files or directories
|
dir [
/all ] [ file-url ]
|
Optional
|
|
Change the current path
|
cd directory
|
Optional
|
l
The directory to be removed must be empty,
meaning before you remove a directory, you must delete all the files and the
subdirectory under this directory. For file deletion, refer to the delete
command.
l
After the execution of the rmdir command,
the files in this directory will be automatically deleted forever.
1.1.3 File
Operations
File operations include delete (removing files
into the recycle bin), restore the deleted, permanently delete (deleting files from
the recycle bin), display, rename, copy, and move files, and display specified
directory or file information as shown in the following table:
|
To do…
|
Use the command…
|
Remarks
|
|
Remove a file to the recycle bin or
delete it permanently
|
delete
[ /unreserved ] file-url
|
Optional
|
|
Restore a file from the recycle bin
|
undelete file-url
|
Optional
|
|
Empty the recycle bin
|
reset recycle-bin [ file-url ] [ /force ]
|
Optional
|
|
Display the contents of a file
|
more file-url
|
Optional
Currently only a .txt file can be
displayed.
|
|
Rename a file
|
rename fileurl-source
fileurl-dest
|
Optional
|
|
Copy a file
|
copy fileurl-source
fileurl-dest
|
Optional
|
|
Move a file
|
move fileurl-source
fileurl-dest
|
Optional
|
|
Display files or directories
|
dir [
/all ] [ file-url ]
|
Optional
|
|
Enter system view
|
system-view
|
—
|
|
Execute the batch file
|
execute filename
|
Optional
|
You can create a
file by copying or downloading or using the save command.
Caution:
l
Timely empty the recycle bin with the reset
recycle-bin command to save memory space.
l
As the delete /unreserved file-url
command deletes a file permanently and the action cannot be undone, use it with
caution.
l
The original and target directory of the file to
be moved must be on the same device. The move command does not support
cross-device file moving.
l
The execute command cannot ensure the
execution of each command. For example, if a certain command is not correctly
configured, the system will omit this command and go to the next one.
Therefore, each configuration command in a batch file must be a standard
configuration command, meaning the valid configuration information which can be
displayed with the display current-configuration command after this
command is configured successfully; otherwise, this command may not be executed
correctly.
1.1.4 Storage Device Operations
I. Naming rules
If storage device partitioning is
supported, the name of the partition device is composed of the physical device
name and partition number. The serial numbers of partitions are displayed in
numbers such as 0, 1 or 2. For example, the second partition of a CF card is
cf1. If there is only one partition on the CF card, the partition name is the
physical device name followed by 0.
II. Memory space management
You can use the fixdisk command to
restore the space of a storage device or the format command to format a
specified storage device as shown in the following table:
|
To do…
|
Use the command…
|
Remarks
|
|
Restore the space of a storage device
|
fixdisk device
|
Optional
|
|
Format a storage device
|
format
device type
|
Optional
|
You may use the two commands when some
space of a storage device becomes inaccessible due to abnormal operations for
example.
Caution:
l
When you format a storage device, all the files stored
on it are erased and cannot be restored. In particular, if there is a startup configuration
file on the storage device, formatting the storage device results in loss of
the startup configuration file. Format a file under the directions of technical
support engineers.
l
When you format a partition of a storage device,
the type argument can only be set to FAT16 or FAT32, and the English
letters must be in uppercase.
l
Because switches support partitioning, you can
only format a partition device rather than the whole storage device.
III. Mounting/unmounting a storage
device
S9500 series switches support hot swappable
storage devices, such as CF card, USB device, etc (excluding Flash), you can
use the mount and umount command to mount or unmount the storage device.
When a device is unmounted, it is in a logically
disconnected state, you can then remove the storage device from the system
safely. To mount a device, you are reconnecting the logically disconnected device
to the system.
Follow the
steps below to mount/unmount a storage device:
|
To do…
|
Use the command…
|
Remarks
|
|
Mount
a storage device
|
mount
device
|
Optional
A
storage device is in mounted state when it is connected to the system by
default.
|
|
Unmount
a storage device
|
umount device
|
Optional
A storage
device is in mounted state by default. Before unplugging a storage device,
unmount it.
|
Caution:
l
Do not remove the storage device or swap the
board when mounting or unmounting the device, or when you are processing files
on the storage device. Otherwise, the file system could be damaged.
l
When a storage device is connected to a low
version system, the system may not be able to recognize the device automatically;
you need to use the mount command for the storage device to function
normally.
l
Before removing a mounted storage device from
the system, you should first unmount it to avoid damaging the device.
l
If one or more partitions of a CF card are not
unmounted through the umount command, the CF card will still be powered
on. Therefore, make sure you have unmounted all the partitions before removing
the CF card from the system to avoid storage device damage caused by charged
operations.
IV. Partitioning a CF card
The CF card partitioning function enables
you to divide a CF card into several different logical devices called
partitions and you can perform file operations on each partition respectively.
This prevents interaction of files on each partition.
The following two partitioning modes are
supported on a CF card:
l
Simple: In this mode, you should specify the
number of partitions. The system divides a CF card into the specified number of
partitions with the same size.
l
Interactive: In this mode, you need not specify
the number of partitions. The system partitions the CF card according to user
input. Each partition, however, must be 32 MB at least.
Follow these
steps to partition a CF card:
|
To do…
|
Use the command…
|
Remarks
|
|
Partition a storage device
|
fdisk device
[ partition-number ]
|
Required
A CF card has only one partition
cf0:/ by default.
|
Caution:
l
Partitioning a CF card will clear all data on the
CF card. Backup the files on the CF card before partitioning it.
l
CF card partitioning may add or remove partition
devices. You need reset the path of the application program as needed.
l
If a switch starts from the CF card, the startup
file and the configuration file must be in the first partition of the CF card.
l
To prevent log file from affecting the startup
file and configuration file, you are recommended to set the path of the log
file to a partition other than the first partition if there are multiple
partitions on the CF card. By default, the system automatically sets the path
of the log file to the second partition. If the path does not exist on the CF
card, you can use the info-center logfile switch-directory
command to change the path to avoid loss of the log files. For details of this
command, refer to Information Center Commands in the System Volume.
l
After partitioning is completed, the sizes of
the partitions are not necessarily consistent with those specified in an
interactive way. The dispersion, however, is smaller than 5% of the total
memory of the CF card.
1.1.5 File System Prompt Mode Setting
The file system provides the following two
prompt modes:
l
alert: where the
system warns you about operations that may bring undesirable consequence such
as file corruption or data loss.
l
quiet: where the
system does not do that in any cases.
Follow these steps to set the operation
prompt mode of the file system:
|
To do…
|
Use the command…
|
Remarks
|
|
Enter system view
|
system-view
|
—
|
|
Set the operation prompt mode of the
file system
|
file prompt { alert | quiet }
|
Required
The default is alert.
|
1.1.6 File System Operations Examples
# Display the files under the root directory.
<Sysname> dir
Directory of flash:/
0 drw- - May 08 2006
21:27:24 hafile
1 -rw- 248 May 08 2006
21:40:44 manuinfo.txt
2 -rw- 118 Jun 16 2006
10:16:05 ls.pwd
3 -rw- 3530 Oct 16 2006
16:39:53 config.cfg
4 -rw- 326944 Jul 24 2006
14:03:04 lsbSRP1N43202.app
5 -rw- 207624 Jul 07 2006
14:27:30 lsblmcua0110y.app
6 -rw- 326944 Jul 07 2006
11:05:39 srpbt.app
7 -rw- 326944 Jul 10 2006
10:40:42 switch.app
15621 KB total (14363 KB free)
# Create a new folder called mytest
under the test directory.
<Sysname> cd test
<Sysname> mkdir mytest
..
%Created dir flash:/test/mytest.
# Display the files under the test
directory.
<Sysname> dir
Directory of flash:/test/
0 drw- - Feb 16 2006
15:28:14 mytest
2540 KB total (2519 KB free)
# Return to the upper directory.
<Sysname> cd ..
1.2 Configuration File Management
This section covers these topics:
l
Configuration File Management
Overview
l
Saving the Current Configuration
l
Synchronizing Configuration
Files Saved on the AMB to SMB
l
Erasing the Startup Configuration
File
l
Specifying a Configuration
File for Next Startup
l
Backing up/Restoring the
Configuration File for Next Startup
1.2.1 Configuration File Management Overview
I. Types of configuration
The configuration of a device falls into
two types:
l
Saved configuration, a configuration file used
for initialization. If this file does not exist, the default parameters are
used.
l
Current configuration, which refers to the user’s
configuration during the operation of a device. This configuration is stored in
dynamic random-access memory (DRAM). It is removed when the device is rebooting.
II. Format of configuration file
Configuration files are saved as text files
for ease of reading. They:
l
Save configuration in the form of commands.
l
Save only non-default configuration settings.
l
List commands in sections by view in this view order:
system, interface, routing protocol, and so on. Sections are separated with one
or multiple blank lines or comment lines that start with a pound sign (#).
l
End with a return.
The operating interface provided by the configuration
file management function is user-friendly. With it, you can easily manage your
configuration files.
1.2.2 Saving the Current Configuration
You can modify the configuration on your
device at the command line interface (CLI). To use the modified configuration for
your subsequent startups, you must save it (using the save command) as a
configuration file.
Modes in saving the configuration:
l
Fast saving mode. This is the mode when you use the
save command without the safely keyword. The mode saves the file faster
but is likely to lose the configuration file if the device reboots or the power
fails during the saving process.
l
Safe mode. This is the mode when you use the save
command with the safely keyword. The mode saves the file slower but can
retain the configuration file on the device even if the device reboots or the
power fails during the saving process.
Caution:
Device reboot or the power failure during configuration file saving
may result in loss of the configuration file for next startup. In this case,
the device will be started with empty configuration, and after the device
starts, you need to re-specify a configuration file for next startup.
Follow the step below to save the current
configuration:
|
To do…
|
Use the command…
|
Remarks
|
|
Save the current configuration
|
save [
file-name | safely ]
|
Available in any view
|
l
When you use the save file-name command,
if you specify the saving directory in the file-name, the configuration
will be saved in the specified directory; if you do not specify a saving
directory in the file-name, the configuration will be saved in the
current directory.
l
In interactive mode, if you specify a saving
directory in the file name, the directory to be specified must be the directory
of the saving device on the active main board (AMB).
l
To save the configuration file, you can specify either
the filename argument or the safely keyword.
l
Fast saving mode is suitable for environments
where power supply is stable. The safe mode, however, is preferred where stable
power supply is unavailable or remote maintenance is involved.
l
The extension name of the configuration file
must be .cfg.
1.2.3 Synchronizing Configuration Files Saved on the AMB to SMB
For an S9500 series switch, you can only execute
commands on the active main board (AMB) instead of a standby main board (SMB).
After the configuration file saving synchronization function is enabled, when
you use the save command on the AMB to save the current configuration,
the SMB will automatically save the current configuration to its configuration
files to keep the consistency of the configuration files on the AMB and SMB.
Follow these
steps to configure configuration file saving synchronization on the AMB and
SMB:
|
To do…
|
Use the command…
|
Remarks
|
|
Enter system view
|
system-view
|
—
|
|
Enable configuration file saving
synchronization for the AMB and SMB
|
slave auto-update config
|
Optional
Enabled by default.
|
1.2.4 Erasing the Startup Configuration File
With the configuration file erased, your
device will boot up with the default configuration next time it is powered on.
You may need to erase the configuration
file for one of these reasons:
l
After you upgrade software, the original configuration
file does not match the new software.
l
The startup configuration file is corrupted or not
the one you need.
Follow the step below to erase the
configuration file:
|
To do…
|
Use the command…
|
Remarks
|
|
Erase the startup configuration file
from the storage device
|
reset saved-configuration
|
Required
Available in user view
|
Caution:
This command will
permanently delete the configuration file from the device. Use it with caution.
1.2.5 Specifying a Configuration File for Next Startup
Follow the
step below to specify a configuration file for next startup:
|
To do…
|
Use the command…
|
Remarks
|
|
Specify a configuration file for next
startup
|
startup saved-configuration cfgfile
|
Required
Available in user view
|
Caution:
The configuration
file must use “.cfg” as its extension name and the startup
configuration file must be saved under the root directory of the device.
1.2.6 Backing up/Restoring the Configuration File for Next Startup
I. Backup/restore function overview
The backup/restore function allows you to
backup or restore a configuration file for next startup through operations at the
CLI. TFTP is used for intercommunication between the device and the server. The
backup function enables you to backup a configuration file to the TFTP server,
while the restore function enables you to download the configuration file from
the TFTP server for next startup.
For an S9500 series switch, when you execute
the restore command on your AMB, you are restoring the startup configuration
file for both the AMB and the SMB. However, when you execute the backup
command on your AMB, your operation has no effect on the SMB.
The backup/restore
operation applies to the next startup configuration file.
II. Backing up the configuration
file for next startup
|
To do…
|
Use the command…
|
Remarks
|
|
Back up the configuration file for
next startup
|
backup startup-configuration to dest-addr [ dest-filename ]
|
Required
Available in user view
|
Before backup, you should:
l
Ensure that the server is reachable, the server
is enabled with TFTP service, and the client has
permission to read and write.
l
Use the display startup command (in user
view) to verify if you have set the startup configuration file, and use the dir
command to verify if this file exists. If the file is set as NULL or does
not exist, the backup will be unsuccessful.
III. Restoring the startup
configuration file
|
To do…
|
Use the command…
|
Remarks
|
|
Restore the startup configuration
file
|
restore startup-configuration from
src-addr src-filename
|
Required
Available in user view
|
l
Before restoring a configuration file, you
should ensure that the server is reachable, the server is enabled with TFTP service, and the client has permission to read and write.
l
After the command is successfully executed, you
can use the display startup command (in user view) to verify if the
filename of the startup configuration file is the same with the src-filename
argument, and use the dir command to verify if the restored file exists.
1.3 Displaying and Maintaining Device Configuration
|
To do…
|
Use the command…
|
Remarks
|
|
Display the configuration file saved
in the storage device
|
display saved-configuration [ by-linenum ]
|
Available in any view
|
|
Display the configuration file used
for this and next startup
|
display startup
|
Available in any view
|
|
Display the validated configuration
in current view
|
display this [ by-linenum ]
|
Available in any view
|
|
Display current configuration
|
display current-configuration [ interface [ interface-type
[ interface-number ] ] | configuration [ configuration
] | [ by-linenum ] | [ | { begin | exclude | include
} regular-expression ] ] *
|
Available in any view
|
l
Configuration files are displayed in the same
format in which they are saved.
l
The support for the optional arguments in both
the display this and display current-configuration command varies
with devices. For detailed description of this command, refer to Basic
System Commands in the System Volume.