3. File system management

This chapter provides information about file system management.

3.1. The file system

The 7210 SAS file system is used to store files used and generated by the system; for example, image files, configuration files, logging files and accounting files.

The file commands allow you to copy, create, move, and delete files and directories, navigate to a different directory, and display file or directory contents and the image version.

3.1.1. Compact flash devices

The file system is based on a DOS file system. The 7210 SAS devices provide several storage options, including internal flash and USB.

The following compact flash devices are supported:

  1. SD slot, USB slot, or internal flash, cf1:\
  2. external USB slot, uf1:\

The preceding device names are relative device names in that they refer to the devices local to the control processor running the current console session. As in the DOS file system, the colon (“:”) at the end of the name indicates it is a device.

The following table lists the storage locations available on different 7210 SAS platforms.

Table 16:  Storage locations on 7210 SAS platforms  

7210 SAS platforms

Storage locations

cf1:\

uf1:\ 1

7210 SAS-D

 2

7210 SAS-Dxp

 3

7210 SAS-K 2F1C2T

 4

7210 SAS-K 2F6C4T

 5

7210 SAS-K 3SFP+ 8C

 5

    Notes:

  1. USB port located on the front panel; allows a supported USB device to be plugged in
  2. Supports an internal flash
  3. SD card slot located on the front panel
  4. Depending on the 7210 SAS-K 2F1C2T model, the cf1:\ storage location is either an SD card slot or USB slot. The slot is located on the rear panel and allows the use of a supported SD card or USB device. Secure access to the SD card or USB device is also supported.
  5. SD card slot located on the rear panel; allows the use of a supported SD card. Secure access to the SD card is also supported.

In addition to user-added files and directories, the number of files in the root directory can also increment when the admin save or bof save commands are issued. The system enforces a threshold limit of 80 entries (files and directories) for contents of the root directory on cf1:\; there is no restriction on the number of files and directories that you can add in the subdirectories. A trap (tmnxRootDirFull) is generated if the threshold limit is exceeded, and a warning is generated for each new file or directory created in the root directory on cf1:\ after the threshold limit is exceeded.

Note:

User intervention is required when the system displays the threshold exceeded event (tmnxRootDirFull). You are required to clean the root directory on cf1:\ and ensure that the number of entries (files or directories) is below the enforced threshold limit of 80 entries. Remove unnecessary files and directories from the root directory or move them to a subdirectory that you have created under the root directory. The system does not generate a warning when the number of files and directories is reduced below the threshold limit.

Use the file dir cf1:\ command to determine the number of entries (files or directories) present in the root directory, as shown in the following output example. For example, in the following listing, the total number of entries in the root directory (files and directories) is 14 files + 2 directories = 16.

*A:7210-SAS #
 
*A:7210-SAS #file dir
 
 Volume in drive cf1 on slot A is /flash.
 
 Volume in drive cf1 on slot A is formatted as FAT32.
 
Directory of cf1:\
 
10/12/2011  10:37p             4248394 boot.tim
10/17/2011  07:28a                 524 sasm.sdx
10/26/2011  10:06p                 828 bof.cfg
10/27/2011  09:04p      <DIR>          act-collect
10/27/2011  09:06p      <DIR>          act
10/17/2011  07:30a                   0 test1.txt
10/26/2011  10:43p                5360 sasm.cfg
10/11/2011  06:42a            28821599 both.tim
10/26/2011  10:42p               14597 bootlog.txt
10/19/2011  04:22a                 832 bof.cfg.1
10/17/2011  07:37a                 827 test1
10/17/2011  07:38a                 827 tes2
10/17/2011  07:38a                 827 tes3
10/17/2011  07:39a                 827 tes3567
10/17/2011  07:38a                 827 tes356
10/18/2011  10:46p                5481 sasm.cfg.1
 
              14 File(s)               33117369 bytes.
               2 Dir(s)                80470016 bytes free.
 
*A:7210-SAS #

3.1.2. USB storage device

Note:

USB devices are supported on all 7210 SAS platforms as described in this document, except the 7210 SAS-D and 7210 SAS-Dxp.

7210 SAS platforms support the use of the USB interface as an alternate storage location that provides a larger storage capacity than the internal flash. You can use a USB storage device to store TiMOS images, configuration files, accounting records, and log files. The BOF can point to images on the USB and you can use the USB to load TiMOS images and configuration files.

The 7210 SAS-K 2F1C2T, 7210 SAS-K 2F6C4T, and 7210 SAS-K 3SFP+ 8C provide an option to load the boot loader (boot.tim) from the USB storage device plugged into any one of the USB ports.

Note:

  1. The USB devices and capacities that are supported for use with 7210 SAS are listed in the 7210 SAS Software Release Notes 22.x.Rx.
  2. When a USB device is unplugged or removed from the system, a major alarm is raised. The alarm can be cleared using the shutdown command.
  3. 7210 SAS also auto-detects the device type when any of the supported devices are connected to the USB interface. Only approved USB mass storage devices and optical clip-on devices can be plugged in to the USB port and are recognized as valid devices. All other unsupported devices will result in an error log being printed.
  4. Nokia recommended to use the shutdown command before removing the USB storage device.

3.1.3. URLs

The arguments for the 7210 SAS file commands are modeled after standard universal resource locators (URLs). A URL refers to a file (a file-url) or a directory (a directory-url).

The 7210 SAS supports operations on both the local file system and remote files. For the purposes of categorizing the applicability of commands to local and remote file operations, URLs are divided into three types: local, ftp and tftp. The following table describes the syntax for each of the URL types.

Table 17:  URL types and syntax 

URL type

Syntax

Notes

local-url

[cflash-id:\]path

[usb-flash-id:\]path

cflash-id is the compact flash device name

Values: cf1:

usb-flash-id is the USB device name

Values: uf1:

ftp-url

ftp://[username[:password]@]host/path

An absolute ftp path from the root of the remote file system

username is the ftp username

password is the ftp user password

host is the remote host

path is the path to the directory or file

ftp://[username[:password]@]host/./path

A relative ftp path from the user’s home directory Note the period and slash (“./”) in this syntax compared to the absolute path

tftp-url

tftp://host[/path]/filename

tftp is only supported for operations on file URLs

The system accepts either forward slash (“/”) or backslash (“\”) characters to delimit directory and/or filenames in URLs. Similarly, the 7210 SAS SCP client application can use either slash or backslash characters, but not all SCP clients treat backslash characters as equivalent to slash characters. In particular, UNIX systems will often interpret the backslash character as an “escape” character. This can cause problems when using an external SCP client application to send files to the SCP server. If the external system treats the backslash like an escape character, the backslash delimiter will get stripped by the parser and will not be transmitted to the SCP server.

For example, a destination directory specified as “cf1:\dir1\file1” will be transmitted to the SCP server as “cf1:dir1file1” where the backslash escape characters are stripped by the SCP client system before transmission. On systems where the client treats the backslash like an “escape” character, a double backslash “\\” or the forward slash “/” can typically be used to correctly delimit directories and the filename.

All the commands can operate on the local file system. The following table describes which commands also support remote file operations.

Table 18:  File command local and remote file system support 

Command

local-url

ftp-url

tftp-url

attrib

cd

copy

delete

dir

md

move

rd

scp

Source only

type

version

3.1.4. Wildcards

The 7210 SAS supports the standard DOS wildcard characters. The asterisk (*) can represent zero or more characters in a string of characters, and the question mark (?) can represent any one character.

Example:
A:ALA-1>file cf1:\ # copy test*.cfg siliconvalley
cf1:\testfile.cfg
1 file(s) copied.
A:ALA-1>file cf1:\ # cd siliconvalley
A:ALA-1>file cf1:\siliconvalley\ # dir
Volume in drive cf1 on slot A has no label.
Directory of cf1:\siliconvalley\
05/10/2006 11:32p <DIR> .
05/10/2006 11:14p <DIR> ..
05/10/2006 11:32p 7597 testfile.cfg
1 File(s) 7597 bytes.
2 Dir(s) 1082368 bytes free.
A:ALA-1>file cf1:\siliconvalley\ #

3.2. File management tasks

The following sections contain information about the basic system tasks.

Note:

When a file system operation is performed with a command that can potentially delete or overwrite a file system entry (such as a copy, delete, move, rd, or scp command), a prompt appears to confirm the action. The force keyword performs these file management operations without displaying the confirmation prompt.

3.2.1. Modifying file attributes

The system administrator can change the read-only attribute in the local file. Enter the attrib command with no options to display the contents of the directory and the file attributes.

Use the following CLI syntax to modify file attributes.

CLI Syntax:
file>
attrib [+r | -r] file-url

The following example shows command syntax usage:

Example:
# file
file cf3:\ # attrib
file cf3:\ # attrib +r BOF.SAV
file cf3:\ # attrib

The following example shows the file configuration:

A:ALA-1>file cf1:\ # attrib
cf1:\bootlog.txt
cf1:\bof.cfg
cf1:\boot.ldr
cf1:\bootlog_prev.txt
cf1:\BOF.SAV
A:ALA-1>file cf1:\ # attrib +r BOF.SAV
A:ALA-1>file cf1:\ # attrib
cf1:\bootlog.txt
cf1:\bof.cfg
cf1:\boot.ldr
cf1:\bootlog_prev.txt
cf1:\BOF.SAV

3.2.2. Creating directories

Use the md command to create a new directory in the local file system, one level at a time.

Enter the cd command to navigate to different directories.

Use the following CLI syntax to create a new directory:

CLI Syntax:
file>
md file-url

The following example shows command syntax usage:

Example:
file cf1:\ # md test1
file cf1:\ # cd test1
file cf1:\test1\ # md test2
file cf1:\test1\ # cd test2
file cf1:\test1\test2\ # md test3
file cf1:\test1\test2\ # cd test3
file cf1:\test1\test2\test3 #

3.2.3. Copying files

Use the copy command to upload or download an image file, configuration file, or other file types to or from a flash card or a TFTP server.

The scp command copies files between hosts on a network. It uses SSH for data transfer, and uses the same authentication and provides the same security as SSH.

The source file for the scp command must be local. The file must reside on the router. The destination file has to be of the following format: user@host:file-name. The destination does not need to be local.

Use the following CLI syntax to copy files.

CLI Syntax:
file>
copy source-file-url dest-file-url [force]
scp local-file-url destination-file-url [router router-name | service-id] [force]

The following example shows the copy command syntax usage:

Example:
A:ALA-1>file cf1:\ # copy 104.cfg cf1:\test1\test2\test3\test.cfg
A:ALA-1>file cf1:\ # scp file admin@192.168.x.x:cf1:\file1
A:ALA-1>file cf1:\ # scp file2 user2@192.168.x.x:/user2/file2
A:ALA-1>file cf1:\ # scp cf1:/file3 admin@192.168.x.x:cf1:\file3

3.2.4. Moving files

Use the move command to move a file or directory from one location to another.

Use the following CLI syntax to move files.

CLI Syntax:
file>
move old-file-url new-file-url [force]

The following example shows command syntax usage.

Example:
A:ALA-1>file cf1:\test1\test2\test3\ # move test.cfg cf1:\test1
cf1:\test1\test2\test3\test.cfg
A:ALA-1>file cf1:\test1\test2\test3\ # cd ..
A:ALA-1>file cf1:\test1\test2\ # cd ..
A:ALA-1>file cf1:\test1\ # dir
Directory of cf1:\test1\
05/04/2006 07:58a      <DIR>          .
05/04/2006 07:06a      <DIR>          ..
05/04/2006 07:06a      <DIR>          test2
05/04/2006 07:58a               25278 test.cfg
 1 File(s)                  25278 bytes.
 3 Dir(s)                 1056256 bytes free.
A:ALA-1>file cf1:\test1\ #

3.2.5. Removing files and deleting directories

Use the delete and rd commands to delete files and remove directories. Directories must be empty before they can be removed. When files or directories are deleted, they cannot be recovered.

Use the following CLI syntax to delete files and remove directories.

CLI Syntax:
file>
delete file-url [force]
rd file-url [force]

The following example shows command syntax usage.

A:ALA-1>file cf1:\test1\ # delete test.cfg
A:ALA-1>file cf1:\test1\ # delete abc.cfg
A:ALA-1>file cf1:\test1\test2\ # cd test3
A:ALA-1>file cf1:\test1\test2\test3\ # cd ..
A:ALA-1>file cf1:\test1\test2\ # rd test3
A:ALA-1>file cf1:\test1\test2\ # cd ..
A:ALA-1>file cf1:\test1\ # rd test2
A:ALA-1>file cf1:\test1\ # cd ..
A:ALA-1>file cf1:\ # rd test1
A:ALA-1>file cf1:\ #

3.2.6. Displaying directory and file information

Use the dir command to display a list of files on a file system. Use the type command to display the contents of a file. Use the version command to display the version of a cpm.tim or iom.tim file.

Use the following CLI syntax to display directory and file information.

CLI Syntax:
file>
dir [file-url]
type file-url
version file-url

The following example shows command syntax usage.

*A:card-1>file cf1:\ # dir
  Volume in drive cf1 on slot A is /flash.
 
  Volume in drive cf1 on slot A is formatted as FAT32.
 
Directory of cf1:\
 
10/22/2008  10:30a                8849 bootlog.txt
10/22/2008  10:30a                 733 bof.cfg
10/22/2008  10:29a                5531 bootlog_prev.txt
02/01/2001  09:25a             3528373 boot.tim
02/01/2001  09:21a                4860 config.cfg
10/22/2008  11:07a      <DIR>          test1
10/17/2008  07:32p                 724 env.cfg
10/15/2008  03:38p                9499 snake.cfg
                7 File(s)                3558569 bytes.
                1 Dir(s)                53135360 bytes free.