Cisco Router File System – Exclusive Details

The Cisco IOS File System (IFS) has different directories, depending on the device. The IFS also allows the creation of subdirectories in flash memory or on a disk. The figure below displays the output of the show file system command, which lists all of the available file systems on the router.

The command gives helpful information such as the information about available and free memory, the file types, and its permissions. Permissions contain read-only (wr), write-only (ro), and read-and-write (rw). The asterisk against the Flash file system means Flash is the current default file system. The pound symbol (#) appended to the flash indicates that bootable IOS is in a flash.

The Flash File System

The figure below displays the output of the dir command. Since Flash is the default file system, the dir command lists the contents of Flash.

The NVRAM File System

To view and list the contents of NVRAM, the command will be given as dir NVRAM: in user exec mode. as shown in the Figure below.

Switch File Systems

The show file systems command also shows the file systems on a Catalyst switch, which are the same as on a Cisco router, as shown in the figure.

Backup and Restoring using Text files

Backup

Using Tera Term, we can also back up the Configuration file and restore the configuration from the text file when needed. The steps for backup and restoring using Tera Term is the following:-

  1. On the File menu of Tera Term, click Log.
  2. Then select the location where you want to save the file. Now Tera Term will start capturing.
  3. Once the capture has been started, execute the show running-config or show startup-config command at the privileged EXEC prompt. The displayed text in the Tera Terminal will be directed to the chosen file.
  4. After completing the capture, select Close in the Tera Term: Log window.
  5. View the file at the chosen location to verify that it was not corrupted.

Restoring

When configuration is copied from a text file and pasted into a terminal window, the Inter Operating System executes each line of the text file as a command. So, the captured file will require editing to ensure that encrypted passwords are in plain text and that there is no non-command text.

Furthermore, the device must be set to the global configuration mode to receive the commands from the text file pasted into the terminal window. The following are the steps to restore the configuration using Tera Term.

  1. On the File menu of Tera Term, click Send File.
  2. Locate the configuration text file to be copied into the device and click Open.
  3. Tera Term will paste the file into the device, and the text will be applied as a command.

Backup and Restoring Configurations with TFTP

Backup

Startup configuration or running configuration files can be stored on a TFTP (Trivial File Transfer Protocol) server and restored in the event of a problem. The configuration file should also be included in the network documentation.

To save the running configuration or the startup configuration file to a TFTP (Trivial File Transfer Protocol) server, use the copy running-config tftp or copy startup-config tftp command. Following are the steps to back up the running configuration to a TFTP server:

  1. Enter the copy running-config tftp command in user exec mode and then enter the hostname or IP  address where the configuration file will be stored.
  2. Enter the name to assign to the configuration file.
  3. Press Enter to confirm every choice.

The figure below illustrates the backup process to TFTP.

Restoring

To restore the running configuration or the startup configuration from a TFTP (Trivial File Transfer Protocol) server, use copy tftp running-config or copy tftp startup-config command. Following are the steps to restore the running configuration from a TFTP server:

  1. Enter the copy tftp running-config command in user exec mode then enter the hostname or IP address where the configuration file is stored.
  2. Enter the name to assign to the configuration file.
  3. Press Enter to confirm each choice.

The Figure below illustrates the restore process from the TFTP server.

Backing Up and Restoring Using a USB

Backup

Before backing up to a USB port, it is important to verify that the USB drive is there and confirm the name of the drive using the show file systems command in the user exec mode. If the USB drive is there, use the copy run usbflash0:/ command to copy the configuration file to the USB flash drive. Be sure to use the name of the flash drive exactly, as indicated in the file system.

The slash indicates the root directory of the USB flash drive. Then the IOS will prompt for the filename. If the file already copied and exists on the USB flash drive, the router will then prompt to overwrite. We can see files and directories in the USB using the dir command.

Restore

To copy the file back, use the command copy usbflash0:/Router-Config running-config to restore a running configuration where Router-Config is the backup file name in the USB.