Managing File Systems and the Swap Drive

Primary file system and swap drive

The flash file system on IE switches is the primary file system for booting an IE switch. The swap drive allows you to use SD card as a backup for the startup configuration and the installation file (Cisco IOS XE .bin).

Primary file system

The flash file system on IE switches is the primary file system for booting an IE switch, regardless of whether an SD card is present. If the IE switch cannot find a configuration in flash, it will attempt to find one in sdflash, copy the configuration and the installation file to flash, and then boot from flash.

Swap drive

The Swap Drive feature allows you to use an SD card as a backup for the startup configuration and the installation file. You can remove the SD card from one IE switch and install into a new IE switch. When the new IE switch (without a startup configuration in flash) is powered on, it checks flash for a configuration file. If the file is not found, the feature checks for a configuration file in the sdflash. If found, it:

  • copies the startup configuration and the installation files from sdflash to flash

  • automatically reboots, and

  • uses the copied files from the previous IE switch.

Supported SD card options and usage considerations

  • The switch does not support third-party SD cards or SD High Capacity (SDHC) cards. Attempting to use a non-supported card results in the following message being displayed:

    WARNING: Non-IT SD flash detected.
    Use of this card during normal operation can impact and
    severely degrade performance of the system.
    Please use supported SD flash cards only.
  • When the SD card's write-protect switch is locked, the switch can read and boot from the card. However, updates and files cannot be written to the card.


Note


After running the write erase command and reloading the device, the following message may appear during bootup.
% failed to initialize nvram
This is a harmless message and does not indicate a functional issue.

ROM Monitor variables and configuration

The following table explains the ROM Monitor variables and configurations.

Table 1. ROM Monitor variables and configuration

Boot and Install Settings

Description

Storage Location

ROM Monitor variables (romvars) and configurations are always stored and retrieved from flash.

Auto Install Condition

If the flash is empty, the software triggers auto install, copying the first available image to flash from removable media.

Boot Precedence

  1. Boot using the image path set in boot variable.

  2. Install boot using packages.conf file from flash.

  3. Bundle boot using bootable image from flash.

  4. Bundle boot using the bootable image (.conf or .bin) located in the sdflash.

  5. Bundle boot using the bootable image (.conf or .bin) located in the usbflash.

SD card operation

An SD card (Secure Digital card) is a non-volatile memory card used for storing data. An SD card provides external storage for configuration files, system logs, and software images.

You can insert or remove an SD card while the switch is running. If you insert a supported SD card while the switch is running, it validates the Cisco-embedded string in the Product Name (PNM) field and displays the product number and the flash capacity of the SD card. If you remove an SD card while the switch is running, a warning message is displayed to alert you that the SD card has been removed.

Enable syslog to get a message when the SD card is inserted or removed.

How commands work with SD cards

When an SD card is installed in the switch, the write, boot, and sync commands behave as described in the below sections.

Behavior of write command

The write command saves the running configuration. See the table below for command behavior details.

Table 2. Behavior of write command
Command Boot Source SD Card Status Behavior
write SD card Present Saves running configuration to internal flash
write SD card Removed Saves running configuration to internal flash
write Internal flash Present Saves running configuration to internal flash

Behavior of boot command

The boot command lets you change the system boot parameters. See the table below for the command behavior details.

Table 3. SD card boot behavior
Command Boot Source SD Card Status Behavior
boot SD card Present
  • If the boot path points to the SD card, the system boot path is saved to the SD card

  • If the boot path points to flash, the system boot path is saved to the flash memory

boot SD card Removed
  • If the boot path points to the SD card, an error is displayed stating that SD card is not available

  • If the boot path points to flash, the system boot path is saved to the flash memory

boot Internal flash Inserted
  • If the boot path points to flash, the system boot path is saved to the flash memory

  • If the boot path points to the SD card, the system boot path is saved to the SD card

Table 4. Internal flash boot behavior with SD card
Command Boot Source SD Card Status Behavior
boot Internal flash Present
  • If the boot path points to internal flash, the system boot path is set to the flash memory

  • If the boot path points to the SD card, the system boot path is set to the SD card

Boot loader commands

You can run these boot loader commands on an SD card.

Table 5. Boot loader commands

Command

Description

boot

Load and boot an executable Cisco IOS XE image

cat

Concatenate (type) a file or files

copy

Copy a file

dir

List files in directories

fsck

Check file system consistency

format

Format a file system

mkdir

Create directories

more

Concatenate (display) file

rename

Rename a file

rmdir

Delete empty directories

sd_init

Initialize SD flash file systems

Behavior of sync command

The sync command copies the Cisco IOS XE image directory, configuration files, and boot parameters from internal flash memory to the SD card.


Note


The sync command works only in one direction—from flash to sdflash—as the sync from sdflash to flash is an automated process.

When a type-6 password is configured, the sync command status shows the configuration as out of sync with the message that type-6 passwords are not synced.


Table 6. Components and files copied by sync command

Component

Included Files

Cisco IOS XE Image Directory

  • Cisco IOS XE image file (.bin)

  • Device Manager files

  • Profinet/CIP configuration files

Configuration Files

  • NVRAM config files

  • VLAN configuration file (vlan.dat)

  • DLR, PNP, and CIP config files

Boot Parameters

Cisco IOS XE boot parameters

Table 7. Options of sync command
Command Purpose

Examples

sync sdflash

Synchronizes the Cisco IOS XE image directory, configuration files, and boot parameters from internal flash memory to the SD card and restores the IE switch in install mode by default.

Switch# sync sdflash
sync sdflash: ios-image ios-image-name

Synchronizes the Cisco IOS XE image directory from internal flash memory to the SD card.

Switch# sync sdflash: ios-image 
ie3x00-universalk9.17.10.01.SPA.bin
sync sdflash: restore-bundle

Synchronizes the Cisco IOS XE image directory from internal flash memory to the SD card to restore the IE switch in bundle mode.

Switch# sync sdflash: restore-bundle
sync sdflash: skip [all | config | ios-image]

Synchronizes either the Cisco IOS XE configuration or the Cisco IOS XE image directory flash memory to the SD card.

Switch# sync sdflash: skip ios-image

SD card alarms

The SD card alarms notify users of potential issues related to the SD card.

The SD card alarms are disabled by default. To activate the alarms, use the options of the alarm facility sd-card global configuration command. Additionally, you can configure the alarms and associated traps to be sent to syslog and the SNMP server.

Table 8. SD card alarm facility command options
Command Purpose

Examples

enable Enables the SD card alarm feature
Switch(config)# alarm facility sd-card enable
notifies Enable notifications to the server
Switch(config)# alarm facility sd-card notifies
relay Enables relay setting
Switch(config)# alarm facility sd-card relay major
syslog Enables system logging
Switch(config)# alarm facility sd-card syslog

Note


To disable alarms or clear alarm warnings, use the following commands:

no alarm facility sd-card enable — disables the alarm facility enabled for the SD card.

clear facility-alarm —clears the alarm warning state for the alarms configured on the switch.


Insert or remove SD card

This section explains how to insert and remove an SD card. It also describes the hot-swappable behavior supported by the IE switch.

Hot-swappable behavior

Follow these important guidelines for handling the SD card on the IE switch:

  • The SD card is hot-swappable. You can insert or remove it while the switch is running.

  • Do not remove the SD card during the boot process or when a write operation to SD card is in progress.

Insert the SD card into the Switch

This task instructs you on inserting an SD card into the switch.

Procedure


Step 1

Orient the SD card correctly.

Step 2

Press the SD card into the slot until it clicks.

Inserting an SD card triggers the system to log a syslog message similar to:

Mar 30 01:38:51.965: %FLASH-6-DEVICE_INSERTED: Flash device inserted

Remove the SD card from the Switch

This task instructs you on removing an SD card from the Switch.

Procedure


Step 1

Press the SD card slightly inward to release it.

Step 2

After the card ejects, pull it straight out of the slot.

Removing an SD card triggers the system to log a syslog message similar to:

Mar 30 01:39:12.467: %FLASH-1-DEVICE_REMOVED: Flash device removed

Enable the SD card

The SD card provides external storage for system data.

Procedure


Step 1

To enable an SD card on the switch, use one of the following options:

  • ROMMON mode: Set the SD card-related ROMMON variable to 'no'.
Switch# set var DISABLE_SD_FLASH=no 
  • Switch CLI mode: Enable the SD card from the switch using the sdflash command in the global configuration mode.
Switch(config)# sdflash 

Step 2

(Optional) To confirm whether the SD card is enabled, use the show file systems command.

Switch# show file systems 

File Systems:

Size(b) Free(b) Type Flags Prefixes
- - opaque rw system:
- - opaque rw tmpsys:
518885376 474765312 disk rw crashinfo:
* 1697755136 1133522944 disk rw flash: bootflash:
3967811584 3962859520 disk rw sdflash:
1711341568 1645002752 disk ro webui:
- - opaque ro xmodem:
- - opaque ro ymodem:
- - opaque rw null:
- - opaque ro tar:
- - network rw tftp:
33554432 33492400 nvram rw nvram: 

Step 3

(Optional) To confirm that the SD card has been enabled, use the dir sdflash: command.

Switch# dir sdflash:

Directory of sdflash:/

5 drwx 4096 Nov 4 2024 12:25:50 +00:00 System Volume Information
8 drwx 4096 Nov 4 2024 07:11:22 +00:00 ProfinetGSD
7 drwx 8192 Nov 4 2024 07:10:50 +00:00 EDScisco
6 drwx 4096 Jun 17 2014 23:49:52 +00:00 moncfg 


Disable the SD card

Procedure


Step 1

To disable an SD card on the switch, use one of the following options:

  • ROMMON mode: Set the SD card-related ROMMON variable to 'yes'.
Switch# set var DISABLE_SD_FLASH=yes 
  • Switch CLI mode: Disable the SD card from the switch using the no sdflash command in the global configuration mode.
Switch(config)# no sdflash 

Step 2

(Optional) After you log in to the switch, you will not see the SD card in the list of file systems. To confirm, use the show file systems command.

Switch# show file systems 

File Systems:
Size(b) Free(b) Type Flags Prefixes
- - opaque rw system:
- - opaque rw tmpsys:
518885376 474765312 disk rw crashinfo:
* 1697755136 1133522944 disk rw flash: bootflash:
1711341568 1645002752 disk ro webui: 
- - opaque ro xmodem:
- - opaque ro ymodem:
- - opaque rw null:
- - opaque ro tar:
- - network rw tftp:
33554432 33492400 nvram rw nvram:
- - opaque wo syslog:

 

Step 3

(Optional) To confirm that the SD card has been disabled, use the dir sdflash: command.

Switch# dir sdflash:

%Error opening flash:/sdflash (No such file or directory)


Configure automatic synchronization from internal flash to SD card

This procedure configures automatic synchronization of files from the internal flash memory of the switch to an SD card.

Procedure


Step 1

Use configure terminal command to enter global configuration mode.

Example:

Switch# configure terminal

Step 2

Use the auto sync enable command to enable the automatic synchronization service, allowing the switch to automatically synchronize files from the internal flash to the SD card.

Example:

Switch(config)# auto sync enable

Note

 
auto sync is disabled by default. Unless you enable it, you cannot use other options for the feature.

Step 3

Use the auto sync run time hh:mm:ss command to configure the time of day when the automatic synchronization service should run.

Switch(config)# auto sync run time 02:00:00

Step 4

(Optional) Use the auto sync config sdflash: restore-bundle command to set up automatic synchronization for restoring configurations and image files using bundle mode.

Switch(config)# auto sync config sdflash: restore-bundle

Step 5

(Optional) Use the auto sync config sdflash: skip ios-image command to configure the automatic synchronization to exclude Cisco IOS XE image files, syncing only the configuration files.

Switch(config)# auto sync config sdflash: skip ios-image

Step 6

(Optional) Use the auto sync config sdflash: skip config command to skip configuration files and synchronize only the Cisco IOS XE image.

Switch(config)# auto sync config sdflash: skip config

Step 7

(Optional) Use auto sync config sdflash: ios-image image_name command to replace the existing image with the image file you wish to synchronize.

Switch(config)# auto sync config sdflash: ios-image ie3x00-universalk9.17.10.01.SPA.bin

Setup switch using SD card

This task shows how to restore a switch using an SD card.


Note


  • You cannot use the packages from the SD card to load or boot the IE3100 devices. Do not run the boot sdflash:packages.conf command at the switch prompt.

  • If you are operating in install mode and the IE switch is loading package files (*.pkg) using the file packages.conf, do not use the sync sdflash: restore-bundle command:

  • To load the device in bundle mode using the boot file as an image (for example, ie3k_iosxe.17.17.01.SPA.bin), use the sync sdflash:restore-bundle command to sync the image and restore the switch. After recovery, the switch comes up in bundle mode.


Procedure


Step 1

Run the write memory command on the switch before inserting the SD card.

Switch# write memory

Step 2

Run the sync sdflash: command to synchronize from internal flash to SD card. This saves the startup configuration and Cisco IOS XE bundle images on the switch to the SD card.

Switch# sync sdflash:

Step 3

Insert the SD card with the startup configuration and the Cisco IOS XE bundle images into the new switch.

Step 4

Power on the new switch.

The switch automatically restores and loads both the startup configuration and Cisco IOS XE bundle image from the SD card.

Format the SD card to load Cisco IOx

To support Cisco IOx applications on the switch, the SD card must be formatted for the successful deployment and operation of IOx applications.

Before you begin

To run Cisco IOx applications on the switch, format the SD card in EXT4 format.

To run both Cisco IOS XE and Cisco IOx applications, create both FAT32 and EXT4 file system partitions on the SD card using the partition sdflash command.

  • The first partition is the FAT32 partition for Cisco IOS XE, which requires a minimum of 1 GB of space.

  • The second partition is the EXT4 partition for Cisco IOx, which requires a minimum of 2.5 GB of space.

Procedure


Step 1

Use the partition sdflash command to create a partition for Cisco IOx.

partition sdflash <create iox partition [size (MB or percentage)]>

The command splits the SD card into two partitions. See the table below for partition information.

SD Card Size

Partition 1 (FAT32)

Partition 2 (EXT4)

Notes

4 GB or greater

34% of total SD card size, mounted to /flash11

66% of total SD card size, mounted to /flash12

The SD card is auto-partitioned by default.

Less than 4 GB

Must be manually specified

Must be manually specified

At least 1 GB for Cisco IOS XE partition and 2.5 GB for IOx is required.

If inadequate space is specified, a warning is shown and partitioning fails.

Caution

 

When the partition sdflash command is used, all data present before the partition is lost.

Step 2

Use the format sdflash command to dedicate the entire SD card to Cisco IOx or Cisco IOS XE.

format sdflash <filesystem format> 

This command deletes all existing partitions and replaces them with a single partition of the specified filesystem format:

  • FAT32 — Cisco IOS XE

  • EXT4— Cisco IOx

Note

 

The standard SD card format is FAT32.


Emergency recovery for Cisco IOS XE image

The emergency recovery process for the Cisco IOS XE image restores the switch to a functional state.

When a switch or SD card has a corrupted image and configuration file, or if the switch is stuck in ROMMON mode at the switch: prompt , perform the emergency recovery procedure using a valid image in the emgy0 storage directory.

At the switch: prompt , boot the image from the emgy0 partition. Ensure you have a connection to the switch console. After fixing the issue, the switch boots with factory default settings. For information on the emergency recovery steps, see Emergency Recovery Installation for Cisco Catalyst IE3x00 Rugged and IE3400 Heavy Duty Switches.