Configuring SD Swap Drive

Overview

Changes to the Primary File System in Cisco IOS XE 17.10.1

From Cisco IOS XE 17.10.1, 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. The primary file system can no longer be configured. If the IE switch cannot find a configuration in flash, it will attempt to find one in sdflash, then copy the configuration and IOS XE image to flash, and boot from flash as described in the following section.

The sync command after 17.10.1 works only in on direction - from flash to sdflash - as the sync from sdflash to flash is an automated process.

Swap Drive

The Swap Drive feature allows you to use SD card as a backup for the startup configuration and the IOS XE .bin or install 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 switch looks for a configuration file in the sdflash. If found, it:

  • automatically copies the startup configuration and IOS XE files from sdflash to flash

  • automatically reboots, and

  • boots with the copied files from the previous IE switch.

Booting the Switch from Flash or an SD Card

Prior to Cisco IOS XE 17.10.1, the switch could boot from either its internal flash memory or an SD card, with the SD card taking precedence. If an SD card was installed, the switch attempted to boot in the following order:

  1. From the Cisco IOS-XE image that is specified in the boot path.

  2. From the Cisco IOS-XE image in the SD card.

  3. From the Cisco IOS-XE image in the internal flash.

SD Card Support, Formatting 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. 
  • If the write-protect switch on the SD card is in the lock position, the switch can read data on the card 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 message "% failed to initialize nvram" may appear during bootup. This is a harmless message and does not indicate a functional issue.


Inserting and Removing the SD Card

Inserting an SD Card into the Switch

  1. Ensure the SD card is oriented correctly.

  2. Gently press the SD card into the SD card slot on the switch until it clicks into place.

When an SD card is inserted, the system logs a syslog message similar to:

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

Removing an SD Card from the Switch

  1. Press the SD card inward slightly to release it.

  2. Once it ejects, pull the card straight out of the slot.

When an SD card is removed, the system logs a syslog message similar to:

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

Hot-Swappable Behavior

  • The SD card is hot-swappable—it can be inserted or removed while Cisco IOS XE is running.

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

ROM Monitor Variables and Configuration Handling

The following table explains the ROM Monitor variables and configurations.

Table 1. ROM Monitor Variables and Configuration Handling

Configuration Set

Description

Storage Location

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

Auto Install Condition

If flash is empty, the Cisco IOS-XE software triggers auto install by copying the first available image to flash from removable media.

Boot Precedence

  1. Boot using image path set in VAR.

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

  3. Bundle boot using bootable image from flash.

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

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

SD Card Operation

You can insert or remove an SD card while Cisco IOS-XE is running. If you insert a supported Cisco SD card while Cisco IOS-XE is running, the switch 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 Cisco IOS-XE is running, the switch displays a warning message to alert you that the SD card has been removed.

If syslog is enabled, the system also sends a message when the SD card is inserted or removed.

Boot Loader Commands

The following boot loader commands can be executed on an SD card:

  • 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

How Commands Work with SD Cards

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

write Command

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

Table 2. write command behavior from 17.10.1
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
Table 3. write command behavior before 17.10.1
Command Boot Source SD Card Status Behavior Message Displayed
write SD card Present Saves running configuration to SD card None
write SD card Removed Saves running configuration to internal flash

WARNING: The SD flash is not present. The running-config is saved to the on-board flash.

NOTE: This warning message is displayed only once.

write Internal flash Present Saves running configuration to internal flash None

boot Command

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

Table 4. boot Command (SD Card Boot Behavior from 17.10.1)
Command Boot Source SD Card Status Behavior
boot SD card Present
  • If the path points to SD card: saved to SD card

  • If the path points to flash: saved to flash

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

  • If the path points to flash: saved to flash

boot Internal flash Inserted
  • If the path points to flash: saved to flash

  • If the path points to SD card: saved to SD card

Table 5. boot Command (SD Card Boot Behavior Prior to 17.10.1)
Command Boot Source SD Card Status Behavior Message Displayed
boot SD card Present
  • If the path points to SD card: saved to SD card

  • If the path points to flash: saved to flash

None
boot SD card Removed Boot/config path not saved; system attempts to boot from flash if image is available

WARNING: The BOOT/config file path points to the SD flash card and the SD flash card is not present. The environment variable(s) is not saved.

NOTE: This warning message is displayed only once.

boot Internal flash Inserted
  • If the path points to flash: saved to flash

  • If the path points to SD card: saved to SD card

None
Table 6. boot Command (Internal Flash Boot Behavior with SD Card Inserted from 17.10.1)
Command Boot Source SD Card Status Behavior
boot Internal flash Present
  • If the boot path points to internal flash, system boot path is set to flash

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

Note

 

The configuration path cannot be set manually, as it is always stored in internal flash memory.

Table 7. boot Command (Internal Flash Boot Behavior with SD Card Inserted prior to 17.10.1)
Command Boot Source SD Card Status Behavior Message Displayed
boot Internal flash Present If the boot or config path points to internal flash, the system boot path or config file is saved to internal flash None
boot Internal flash Removed If the boot or config path points to SD card, the system boot path or config file is saved to SD card

WARNING: The BOOT/config file path points to the SD flash card. The environment variable(s) is saved onto the SD flash card.

NOTE: This warning message is displayed only once.

sync Command

The sync command copies the Cisco IOS-XE image directory, configuration files, and boot parameters from the internal flash memory to the SD card. Prior to 17.10.1, you could copy from the SD card to the internal flash memory as well.

Table 8. 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

Prior to 17.10.1

After copying the files, the sync command verifies whether the Cisco IOS-XE image is appropriate for the switch model and that sufficient destination flash memory is available. If a potential issue is detected, the sync process is aborted.

When the verification is successful, the sync command retrieves the files from the SD card and overwrites the destination Cisco IOS-XE image directory and configuration files. By default, the sync command overwrites the destination files. However, there is an option to save the old files, overriding this default behavior.


Note


If the running configuration has not been saved before running the sync command, the switch prompts you to save the running configuration before proceeding.


Table 9. sync Command Options
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. See the table below for alarm details.

By default, the SD card alarms are disabled. 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 10. SD card alarm facility command options
Command Purpose

Examples

enable Enables the SD card alarm feature

Switch(config)# alarm facility sd-card enable

notifies Enables 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 the alarm, 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.