The configuration files and VRP system files of network equipment are stored in physical storage media, so file system is the base of the VRP. Only by mastering the basic operation of the file system, the network engineer can efficiently manage the configuration files and VRP system files of the device.
Learning Goals:
Master the basic operation of the file system
The VRP is based on the file system to manage files and directories on the device. When managing files and directories, you often use basic commands to query for information about files or directories, commonly used commands include PWD,DIR [/all] [filename | directory] and
more [/binary] filename [offset] [all].
The PWD command is used to display the current working directory.
The dir [/all] [filename | directory] command is used to view the file information in the current directory.
More [/binary] the filename [offset] [all] command is used to view the specific contents of a text file.
In this example, you can view the file information in Flash by using the dir command in the user view.
Common commands for directory operations include: CD Directory,mkdir directory and rmdir directory.
The CD Directory command is used to modify the user's current working directory.
The mkdir Directory command is able to create a new directory. A catalog name can contain 1-64
Character.
The rmdir directory command removes directories from the file system, and it is important to note that only empty directories can be deleted.
This example uses mkdir test to create a new catalog test, which can be viewed through dir to see that the new catalog test has been created successfully.
File operations include: Copy, move, rename, compress, delete, restore, and so on.
The copy source-filename destination-filename command can copy files. If the destination file already exists, the system will prompt that the file will be replaced. The target file name cannot be the same as the system boot file, or the system will be prompted with an error.
The move source-filename destination-filename command can be used to move files to a different directory. The move command is only available for moving files in the same storage device.
The rename old-name new-name command can be used to rename a directory or file. In this example, the Rename command was used to modify the name of Test.txt to
delete [/unreserved] [/force] {filename | devicename} command can be used to delete files. In general, deleted files will be moved directly to the Recycle Bin. Files in the Recycle Bin can also be recovered by executing the undelete command, but if you specify the unreserved parameter when you execute the delete command, the file is permanently deleted. When you delete a file, you are prompted for "whether or not to delete the file", but if you specify the/force parameter in the command, the system will not give any prompt information. The filename parameter refers to the name of the file that needs to be deleted, and the Device-name parameter specifies the name of the storage device.
Reset Recycle-bin [filename | devicename] can be used to permanently delete files in the Recycle Bin, the filename parameter specifies the name of the file that needs to be permanently deleted, and the Device-name parameter specifies the name of the storage device.
There are two types of configuration files in the device: the current profile and the saved configuration file. Current profile storage exists in the device's RAM. The user can configure the device from the command line, and after the configuration is complete, save the current configuration to the storage device using the Save command to form a saved profile. The saved profiles are either ". Cfg" or ". zip" as extensions, which are stored in the root directory of the storage device.
When the device starts, the saved configuration file is loaded into RAM from the default storage path. If there is no saved configuration file in the default storage path, the device initializes the configuration with the default parameters.
The Display current-configuration command can be used to view the configuration that the device is currently in effect.
Display Current-configuration | The BEGIN {regular-expression} command can display configurations that begin with different parameters or expressions.
Display Current-configuration | The Include {regular-expression} command can display a configuration that contains the specified keyword or expression.
The display saved-configuration [last|time] command is used to view the configuration files that are loaded the next time the device starts. Use the last parameter to display the configuration file content that was used at startup. Use the time parameter to display the most recent manual or system auto-save configuration after system startup.
The save [configuration-file] command can be used to save the current configuration information to the system's default storage path. Configuration-file is the file name of the configuration file, which is optional.
In this example, after the Save command is executed, the current configuration is saved to the default storage path for the device, and the default file name is Vrpcfg.zip.
The display startup command is used to view the system software, backup system software, configuration files, license files, patch files, and voice files associated with this and the next launch of the device.
Startup system software represents the VRP file used for this system startup. Next startup system software represents the VRP file that is used by the next system startup.
The startup Saved-configuration file represents the configuration files used by this system startup.
Next startup Saved-configuration file represents the configuration files that are used by the next system startup.
When the device starts, the configuration file is loaded and initialized from the storage device. If there is no configuration file on the storage device, the device will initialize with the default parameters.
The startup Saved-configuration [Configuration-file] command is used to specify the configuration file that the system uses at the next boot, and the Configuration-file parameter is the name of the system startup profile.
The compare configuration [Configuration-file] [current-line-number save-line-number] command is used to compare the difference between the contents of the configuration file that is not next started by the current configuration, CONFIGURATION-FILE Specifies a profile name that needs to be compared without the current configuration, Current-line-number represents a comparison starting from the line number of the current configuration, and Save-line-number represents the line number from the specified configuration. When the command is executed, the system defaults to a pre-configured configuration of the saved configuration to be compared line by row from the first line. If the Current-line-number or Save-line-number parameter is specified, the system skips the unrelated configuration, starting with the specified line number to find the two configuration files. When the system compares the differences, the characters are displayed starting from the difference between the two, displaying 120 characters by default, and if the difference is less than 120 characters from the end of the file, it will appear at the end of the file.
The Reset saved-configuration command is used to clear the contents of the boot configuration file from the storage device.
After executing this command, if you do not use the command startup Saved-configuration to reassign the configuration file that is used by the device the next time it starts, and you do not use the Save command to save the configuration file, the next time the device starts, it initializes with the default configuration parameters.
Storage devices include SDRAM, Flash, NVRAM, SD card, USB flash drive. For example, AR2200 routers have built-in flash memory and SD cards (slot number SD1). The router has two reserved USB slots (USB0 and USB1) and an SD card slot (SD0). The S5700 switch contains a built-in flash memory that differs in storage capacity depending on the model, S5700c-hi,s5700-li,s5700s-li and S5710-ei support 64M Flash, and other models support 32M Flash. Perform the display version command to view the details of the storage device.
The Fixdisk command is used to fix a storage device that has an exception on the file system. When the file system on the storage device has an exception, the terminal gives a hint, which is recommended to fix it, but does not ensure that the repair succeeds. After you execute this command, if you still receive information that the system recommends fixing, the physical media may be damaged.
This command is the issue Repair Class command, which is recommended for users who do not have problems with the system.
A storage device can be formatted when an exception to the file system cannot be repaired, and it is confirmed that all data on the storage is no longer needed. Formatting a storage device causes all files on the device to be lost, and these files cannot be recovered.
The format [devicename] command is used for formatting memory. When you execute the format command, you need to specify the DeviceName parameter, which indicates that the specific memory is formatted. When this command is executed, all files and directories in the specified storage are emptied and unrecoverable. Please use this command with caution!
Summarize:
1. There is drw in the file attribute of the device, where D is the meaning?
2. If there are multiple profiles in the device, how do I make the configuration file to be used at the next startup?
For:
1. D indicates that it is a directory. R,w are readable, writable meanings.
2. The configuration file may not use the default file name Vrp.cfg, and other specified names are stored in the router or switch. If you need to specify a profile to use for the next startup, you can execute the startup saved-configuration [Configuration-file-name] command, where the file name and extension are included in the configuration file.
11.hcna-hntd--File System Basics