- Table of Contents
-
- 01-Fundamentals
- 00-Preface
- 01-CLI configuration
- 02-RBAC configuration
- 03-Login management configuration
- 04-FTP and TFTP configuration
- 05-File system management configuration
- 06-Configuration file management configuration
- 07-Software upgrade configuration
- 08-Device management configuration
- 09-Tcl configuration
- 10-Python configuration
- 11-License management
- 12-Automatic configuration
- Related Documents
-
Title | Size | Download |
---|---|---|
05-File system management configuration | 90.50 KB |
Contents
Specifying a directory name or file name
Command and hardware compatibility
File system management restrictions and guidelines
Displaying directory information
Displaying the working directory
Changing the working directory
Archiving or extracting directories
Setting the operation mode for directories
Displaying the contents of a text file
Compressing or decompressing a file
Archiving or extracting files·
Deleting files from the recycle bin
Setting the operation mode for files
Managing file systems
Overview
File systems
Each storage medium on the device has a file system.
The following matrix shows the supported storage medium types:
Hardware series |
Model |
Storage medium types |
WX1800H series |
WX1804H WX1810H WX1820H |
Flash memory |
WX2500H series |
WX2510H WX2540H WX2560H |
Flash memory |
WX3000H series |
WX3010H-X |
CF card |
WX3010H WX3010H-L WX3024H WX3024H-L |
Flash memory |
|
WX3500H series |
WX3508H |
Flash memory |
WX3510H WX3520H WX3540H |
CF card |
|
WX5500E series |
WX5510E WX5540E |
CF card |
WX5500H series |
WX5540H WX5560H WX5580H |
CF card |
Access controller modules |
EWPXM1MAC0F EWPXM1WCME0 EWPXM2WCMD0F LSQM1WCMX20 LSQM1WCMX40 LSUM1WCME0 LSUM1WCMX20RT LSUM1WCMX40RT |
CF card |
File system location
To identify a file system that is located on a subordinate member of an IRF fabric, you must specify the file system location in the slotn# format. The n argument represents the IRF member ID of a member device. For example, the location is slot2# for a file system that resides on member device 2.
File system naming conventions
The file system on the flash memory has the following parts:
· (Optional.) File system location. For more information, see "File system location".
· Storage medium type flash.
· Colon (:).
The name of a file system on the CF card or USB disk has the following parts:
· (Optional.) File system location. For more information, see "File system location".
· Storage medium type, cf or usb.
· Sequence number, a lower-case English letter such as a, b, or c.
· Number 0.
· Colon (:).
For example, the file system on the first USB disk is named usba0:.
|
IMPORTANT: File system names are case sensitive and must be entered in lower case. |
Default file system
You are working with the default file system by default after you log in. To specify a file or directory on the default file system, you do not need to specify the file system name. For example, you do not need to specify any location information if you want to save the running configuration to the root directory of the default file system.
Directories
Directories in a file system are structured in a tree form.
Root directory
The root directory is represented by a forwarding slash (/). For example, flash:/ represents the root directory of the flash memory.
Working directory
The working directory is also called the current directory.
On standalone devices that support the flash memory, the default working directory is the root directory of the flash memory.
On standalone devices that support the CF card, the default working directory is the root directory of the CF card.
On an IRF fabric that supports the flash memory, the default working directory is the root directory of the flash memory on the master device.
On an IRF fabric that supports the CF card, the default working directory is the root directory of the CF card on the master device.
Directory naming conventions
When you specify a name for a directory, follow these conventions:
· A directory name can contain letters, digits, and special characters except for asterisks (*), vertical bars (|), forward slashes (/), backward slashes (\), question marks (?), left angle brackets (<), right angle brackets (>), quotation marks ("), and colons (:).
· A directory whose name starts with a dot character (.) is a hidden directory. To prevent the system from hiding a directory, make sure the directory name does not start with a dot character.
Commonly used directories
The device has some factory-default directories. The system automatically creates directories during operation. These directories include:
· diagfile—Stores diagnostic information files.
· license—Stores license files.
· logfile—Stores log files.
· seclog—Stores security log files.
· versionInfo—Stores software version information files.
Files
File naming conventions
When you specify a name for a file, follow these conventions:
· A file name can contain letters, digits, and special characters except for asterisks (*), vertical bars (|), forward slashes (/), backward slashes (\), question marks (?), left angle brackets (<), right angle brackets (>), quotation marks ("), and colons (:).
· A file whose name starts with a dot character (.) is a hidden file. To prevent the system from hiding a file, make sure the file name does not start with a dot character.
Common file types
The device is shipped with some files. The system automatically creates files during operation. The types of these files include:
· .ipe file—Compressed software image package file.
· .bin file—Software image file.
· .cfg file—Configuration file.
· .mdb file—Binary configuration file.
· .log file—Log file.
Hidden files and directories
Some system files and directories are hidden. For correct system operation and full functionality, do not modify or delete hidden files or directories.
Specifying a directory name or file name
Specifying a directory name
To specify a directory, you can use the absolute path or a relative path. For example, the working directory is flash:/. To specify the test2 directory in Figure 1, you can use the following methods:
· flash:/test/test1/test2 (absolute path)
· flash:/test/test1/test2/ (absolute path)
· test/test1/test2 (relative path)
· test/test1/test2/ (relative path)
Figure 1 Sample directory hierarchy
Specifying a file name
To specify a file, use the following methods:
· Enter the absolute path of the file and the file name in the format of filesystem/directory1/directory2/…/directoryn/filename, where directoryn is the directory in which the file resides.
· Enter the relative path of the file and the file name.
For example, the working directory is flash:/. The samplefile.cfg file is in the test2 directory shown in Figure 1. To specify the file, you can use the following methods:
· flash:/test/test1/test2/samplefile.cfg
· test/test1/test2/samplefile.cfg
Command and hardware compatibility
The WX1800H series, WX2500H series, and WX3000H series access controllers do not support the slot keyword or the slot-number argument.
File system management restrictions and guidelines
To avoid file system corruption, do not perform the following tasks during file system management:
· Installing or removing storage media.
· Performing master/subordinate switchover on the IRF fabric.
If you remove a storage medium while a directory or file on the medium is being accessed, the device might not recognize the medium when you reinstall it. To reinstall this kind of storage medium, perform one of the following tasks:
· If you were accessing a directory on the storage medium, change the working directory.
· If you were accessing a file on the storage medium, close the file.
Make sure a USB disk is not write protected before an operation that requires the write right on the disk.
You cannot access a file system that is being formatted or repaired. To access a file system after it is formatted or repaired, use one of the following methods:
· Use the absolute path to specify a file or directory. For example, use the dir flash:/ command to display the files and directories in the file system on the flash memory.
· Use the cd command to change the working directory to the root directory of the file system before accessing a file or directory in the file system. For example, to display the files and directories in the root directory of the file system on the flash memory, perform the following tasks:
a. Use the cd flash:/ command to change the working directory to the root directory of the file system.
b. Execute the dir command.
Before managing file systems, directories, and files, make sure you know the possible impacts.
Formatting a file system
|
CAUTION: Formatting a file system permanently deletes all files and directories in the file system. You cannot restore the deleted files or directories. |
You can format a file system only when no other users are accessing the file system.
Perform this task in user view.
Task |
Command |
Format a file system. |
format filesystem |
Managing directories
Displaying directory information
Perform this task in user view.
Task |
Command |
Display directory or file information. |
dir [ /all ] [ file | directory | /all-filesystems ] |
Displaying the working directory
Perform this task in user view.
Task |
Command |
Display the working directory. |
pwd |
Changing the working directory
Perform this task in user view.
Task |
Command |
Change the working directory. |
cd { directory | .. } |
Creating a directory
Perform this task in user view.
Task |
Command |
Create a directory. |
mkdir directory |
Renaming a directory
Perform this task in user view.
Task |
Command |
Rename a directory. |
rename source-directory dest-directory |
Archiving or extracting directories
When you archive or extract directories or display archived directories, files in the directories are also archived, extracted, or displayed.
Perform the following tasks in user view:
Task |
Command |
Archive directories. |
tar create [ gz ] archive-file dest-file [ verbose ] source source-directory &<1-5> |
Extract directories. |
tar extract archive-file file [ verbose ] [ screen | to directory ] |
Display archived directories. |
tar list archive-file file |
Deleting a directory
To delete a directory, you must delete all files and subdirectories in the directory. To delete a file, use the delete command. To delete a subdirectory, use the rmdir command.
Deleting a directory permanently deletes all its files in the recycle bin, if any.
Perform this task in user view.
Task |
Command |
Delete a directory. |
rmdir directory |
Setting the operation mode for directories
The device supports the following directory operation modes:
· alert—The system prompts for confirmation when your operation might cause problems such as data loss. This mode provides an opportunity to cancel a disruptive operation.
· quiet—The system does not prompt for confirmation.
To set the operation mode for directories:
Step |
Command |
Remarks |
1. Enter system view. |
system-view |
N/A |
2. Set the operation mode for directories. |
file prompt { alert | quiet } |
The default mode is alert. This command also sets the operation mode for files. |
Managing files
You can create a file by copying a file, downloading a file, or using the save command. For more information about downloading a file, see "Configuring FTP" and "Configuring TFTP." For more information about the save command, see Fundamentals Command Reference.
Displaying file information
Perform this task in user view.
Task |
Command |
Display directory or file information. |
dir [ /all ] [ file | directory | /all-filesystems ] |
Displaying the contents of a text file
Perform this task in user view.
Task |
Command |
Display the contents of a text file. |
more file |
Renaming a file
Perform this task in user view.
Task |
Command |
Rename a file. |
rename source-file dest-file |
Copying a file
Perform this task in user view.
Task |
Command |
Copy a file. |
copy source-file { dest-file | dest-directory } [ vpn-instance vpn-instance-name ] [ source interface interface-type interface-number ] |
Moving a file
Perform this task in user view.
Task |
Command |
Move a file. |
move source-file { dest-file | dest-directory } |
Compressing or decompressing a file
Perform the following tasks in user view:
Task |
Command |
Compress a file. |
gzip file |
Decompress a file. |
gunzip file |
Archiving or extracting files
Perform the following tasks in user view:
Task |
Command |
Archive files. |
tar create [ gz ] archive-file dest-file [ verbose ] source source-file &<1-5> |
Extract files. |
tar extract archive-file file [ verbose ] [ screen | to directory ] |
Display the names of archived files. |
tar list archive-file file |
Deleting or restoring a file
You can delete a file permanently or move it to the recycle bin. A file moved to the recycle bin can be restored, but a permanently deleted file cannot.
Files in the recycle bin occupy storage space. To save storage space, periodically empty the recycle bin by using the reset recycle-bin command.
Perform the following tasks in user view:
Task |
Command |
Delete a file by moving it to the recycle bin. |
delete file |
Restore a file from the recycle bin. |
undelete file |
Delete a file permanently. |
delete /unreserved file |
|
IMPORTANT: Do not use the delete command to delete files from the recycle bin. To delete files from the recycle bin, use the reset recycle-bin command. |
Deleting files from the recycle bin
Each file system has a recycle bin of its own.
A recycle bin is a folder named .trash in the root directory of a file system.
To view which files or directories are in a recycle bin, use either of the following methods:
· Access the file system and execute the dir/all .trash command.
· Execute the cd .trash command to enter the recycle bin folder, and then execute the dir command.
To delete files from a recycle bin, perform the following task in user view:
Task |
Command |
Delete files from the recycle bin. |
reset recycle-bin [ /force ] |
Calculating the file digest
File digests are used to verify file integrity.
Use the following commands in user view:
Task |
Command |
Calculate the digest of a file by using the SHA-256 algorithm. |
sha256sum file |
Calculate the digest of a file by using the MD5 algorithm. |
md5sum file |
Setting the operation mode for files
The device supports the following file operation modes:
· alert—The system prompts for confirmation when your operation might cause problems such as file corruption or data loss. This mode provides an opportunity to cancel a disruptive operation.
· quiet—The system does not prompt for confirmation.
To set the operation mode for files:
Step |
Command |
Remarks |
1. Enter system view. |
system-view |
N/A |
2. Set the operation mode for files. |
file prompt { alert | quiet } |
The default mode is alert. This command also sets the operation mode for directories. |