Using an SD Card

This document explains how to use a Secure Digital (SD) flash memory module (SD card).

This document contains these sections:

blank.gifOverview

blank.gifInserting and Removing an SD Card

blank.gifSD Card Operation

blank.gifSD Card Alarms

Overview

The SD card can be used instead of the internal flash memory of the switch to update or restore configuration settings. In addition, the SD card can be used to boot the switch. You can also copy IOS software and switch configuration settings from a PC or from the switch to the SD card, and then use the SD card to copy this software and settings to other switches.

When an SD card is formatted on the switch, the card is formatted with the Disk Operating System Filing System (DOSFS), a platform-independent industry-standard file system that is supported on various Cisco switches and routers.

The switch does not support third-party SD cards or SD High Capacity (SDHC) cards. Attempting to operate the switch with a non-supported card causes the following message to be 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, but updates and files cannot be written to the card.

Inserting and Removing an SD Card

To put an SD card in the switch, make sure that the card is oriented properly, and press it into the SD card slot on the switch until the card is seated. To remove the card, press it to release it, then pull it out of the slot.

The SD card is hot-swappable, but it should not be removed from the switch during the boot process or while sdflash write is in progress.

When an SD card is inserted, a syslog message similar to the following is logged:

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

When an SD card is removed, a syslog message similar to the following is logged:

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

SD Card Operation

The SD card can be accessed by either the switch boot-loader or by the IOS. The following sections describe the operations that can be performed by the controlling software:

blank.gifBoot Loader Operation

blank.gifIOS Operation

Boot Loader Operation

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

blank.gifboot—Load and boot an executable IOS image

blank.gifcat—Concatenate (type) file or files

blank.gifcopy—Copy a file

blank.gifdelete—Delete file of files

blank.gifdir—List files in directories

blank.giffsck—Check file system consistency

blank.gifformat—Format a file system

blank.gifmkdir—Create directories

blank.gifmore—Concatenate (display) file

blank.gifrename—Rename a file

blank.gifrmdir—Delete empty directories

blank.gifsd_init—Initialize sd flash file systems

Important: The switch can be booted from its internal flash memory or from an SD card. The SD card takes precedence over internal flash memory. If an SD card is installed in the switch, the switch attempts to boot in the following order:

1.blank.gif From the IOS image that is specified in the SD card system boot path

2.blank.gif From the first IOS image in the SD card

3.blank.gif From the IOS image that is specified in the internal flash memory system boot path

4.blank.gif From the first IOS image in the internal flash

IOS Operation

You can insert or remove an SD card while the IOS is running. If you insert a supported Cisco SD card while the IOS 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 the IOS 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.

When an SD card is installed in a switch, the following IOS commands operate as described:

blank.gif write command—Saves the running configuration. If the system boots from an SD card and you run a write command, the system saves the running configuration to the SD card, if the card is still installed. If the SD card has been removed, the system saves the running configuration to the internal flash memory and displays this message:

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.
 

If the system boots from the internal flash memory and you then insert an SD card and run the write command, the system saves the running configuration to the internal flash memory.

blank.gif boot command—Lets you change the system boot parameters.

If the system boots from an SD card and you run a boot command, the following behavior applies:

blank.gifIf the SD card is installed and the system boot path or configuration file path points to the SD card, the system boot path or configuration file path is saved to the SD card

blank.gifIf the SD card is installed and the system boot path or configuration file path points to the internal flash memory, the system boot path or configuration file path is saved to the internal flash memory

blank.gifIf the SD card has been removed and the system boot path or configuration file path points to the SD card, the system boot path or configuration file path is not saved and the following message displays:

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.

 

If the system boots from the internal flash memory and you then insert an SD card and run the boot command, the following behavior applies:

blank.gifIf the system boot path or configuration file path points to the internal flash memory, the system boot path or configuration file path is saved to the internal flash memory

blank.gifIf the system boot path or configuration file path points to the SD card, the system boot path or configuration file path is saved to the SD card and the following message is displayed:

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.

 

— If the SD card has been removed and the system boot path or configuration file path points to the SD card, the system boot path or configuration file path is not saved and the following message is displayed:

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.

 

n sync command—Copies the IOS image directory (which includes the IOS image file, FPGA image files, Device Manager files, and Profinet/CIP configuration files), the config.text IOS configuration file, the vlan.dat VLAN configuration file, and IOS boot parameters from the internal flash memory to the SD card or from the SD card to the internal flash memory. This command verifies that the IOS image is appropriate for the switch model and that enough destination flash memory is present, and aborts the sync process if a potential problem is detected. The sync command obtains the source IOS image directory path and source IOS configuration files path from the IOS boot parameters on the source flash device that is specified in the sync command. By default, this command overwrites the destination IOS image directory and IOS configuration files. The “save-old-files” option can be used to override this default behavior. If the running configuration has not been saved and you run the sync command, the switch provides the option for you to save the running configuration before the command executes.

The sync command options are:

blank.gifSwitch# sync flash: sdflash: —Sync IOS image directory, configuration files, and boot parameters from internal flash memory to SD card.

blank.gifSwitch# sync sdflash: flash: —Sync IOS image directory, configuration files, and boot parameters from SD card to internal flash memory.

blank.gifSwitch# sync flash: sdflash: ios-image-name IOS_image_path —Sync the designated IOS image directory, configuration files, and boot parameters from internal flash memory to SD card. For example, IOS_image_path might be f lash:/ie2000-universalk9-mz.150-2.EA1/ie2000-universalk9-mz.150-2.EA1.bin.

blank.gifSwitch# sync sdflash: flash: ios-image-name IOS_image_path —Sync the designated IOS image directory, configuration files, and boot parameters from SD card to internal flash memory. For example, IOS_image_path might be f lash:/ie2000-universalk9-mz.150-2.EA1/ie2000-universalk9-mz.150-2.EA1.bin.

blank.gifSwitch# sync flash: sdflash: skip config.text vlan.dat —Sync only IOS image directory from internal flash memory to SD card.

blank.gifSwitch# sync sdflash: flash: skip config.text vlan.dat —Sync only IOS image directory from SD card to internal flash memory.

blank.gifSwitch# sync flash: sdflash: skip ios-image —Sync only IOS configuration files from internal flash memory to SD card.

blank.gifSwitch# sync sdflash: flash: skip ios-image —Sync only IOS configuration files from SD card to internal flash memory.

SD Card Alarms

The switch supports the following SD card alarms:

blank.gifSD Card Alarm—Enabled when the SD card is removed and cleared when the SD card is inserted

blank.gifSD Card Unsupported Alarm—Enabled when an unsupported SD card is detected

blank.gifSD Card Corrupt Alarm—Enabled when an SD card DOSFS corruption is detected

blank.gifSD Card Files Corrupt Alarm—Enabled when the IOS image specified in the SD Card system boot path is corrupted

It takes approximately 2 minutes to trigger the alarm relay (LED output) after an SD card is inserted or removed.

You also can configure alarms and traps that are associated with the SD card alarm to be sent to syslog and the SNMP server.

Enabling SD Card Alarms

SD card alarms are disabled by default.

To use alarms, enter the alarm facility sd-card enable global configuration command to enable alarms, then enter the alarm f acility sd-card global configuration commands to associate the alarm to the relay:

Switch(config)# alarm facility sd-card enable

Switch(config)# alarm facility sd-card notifies

Switch(config)# alarm facility sd-card sysm

Switch(config)# alarm facility sd-card syslog

Switch(config)# alarm facility sd-card relay major

Clearing an SD Card Alarm

To clear the last SD card alarm warning state, enter the following command:

Switch# clear facility-alarm