Replacing or removing local switch software

This section describes commands for erasing a software version and copying an existing software version between primary and secondary flash.


It is not necessary to erase the content of a flash location before downloading another software file. The process automatically overwrites the previous file with the new file. If you want to remove an unwanted software version from flash, Hewlett Packard Enterprise recommends that you do so by overwriting it with the same software version that you are using to operate the switch, or with another acceptable software version. To copy a software file between the primary and secondary flash locations, See "Copying a switch software image from one flash location to another", below.

The local commands described here are for flash image management within the switch. To download a software image file from an external source, see "File Transfers" in the Management and Configuration Guide for your switch.

Copying a switch software image from one flash location to another. When you copy the flash image from primary to secondary or the reverse, the switch overwrites the file in the destination location with a copy of the file from the source location. This means you do not have to erase the current image at the destination location before copying in a new image.

CAUTION: Verify that there is an acceptable software version in the source flash location from which you are going to copy. Use the show flash command or, if necessary, the procedure under Displaying the current flash image data to verify an acceptable software version. Attempting to copy from a source image location that has a corrupted flash image overwrites the image in the destination flash location. In this case, the switch will not have a valid flash image in either flash location, but will continue running on a temporary flash image in RAM. Do not reboot the switch. Instead, immediately download another valid flash image to primary or secondary flash. Otherwise, if the switch is rebooted without a software image in either primary or secondary flash, the temporary flash image in RAM will be cleared and the switch will go down. To recover, see "Restoring a Flash Image" in the Management and Configuration Guide for your switch.


copy flash flash <destination flash>

where: destination flash = primary or secondary:

For example, to copy the image in secondary flash to primary flash:

  • Verify that there is a valid flash image in the secondary flash location. The following figure indicates that a software image is present in secondary flash. (If you are unsure whether the image is secondary flash is valid, try booting from it before you proceed by using boot system flash secondary

The following example indicates two different software versions in Primary and Secondary flash:

switch(config)# show flash
Image             Size (bytes) Date     Version
----------------- ------------ -------- --------------------
Primary Image     : 10167529    10/14/11 K.14.89
Secondary Image   : 15085139    08/17/12 K.15.10.0001

Boot ROM Version : K.15.28
Default Boot     : Primary


Execute the copy command as follows:

switch(config)# copy flash flash primary

Erasing the contents of Primary or Secondary flash. This command deletes the software image file from the


No undo! Before using this command in one flash image location (primary or secondary), ensure that you have a valid software file in the other flash image location (secondary or primary). If the switch has only one flash image loaded (in either primary or secondary flash) and you erase that image, then the switch does not have a software image stored in flash. In this case, if you do not reboot or power cycle the switch, you can recover by using xmodem or tftp to download another software image.

erase flash [primary | secondary]

For example, to erase the software image in primary flash, do the following:
  1. First verify that a usable flash image exists in secondary flash. The most reliable way to ensure this is to reboot the switch from the flash image you want to retain. For example, if you are planning to erase the primary image, then first reboot from the secondary image to verify that the secondary image is present and acceptable for your system:

    switch# boot system flash secondary
  2. Then erase the software image in the selected flash (in this case, primary):

    switch# erase flash primary
    The Primary OS Image will be deleted, continue [y/n]?
  3. Type ‘y’ at the prompt to complete the flash erase.

  4. Use show flash to verify erasure of the selected software flash image. The “0” shows that the primary flash has been erased.

The following example shows flash listing after erasing Primary flash

switch# show flash
Compressed Primary Code size = 0
Compressed Secondary code size = 2555802
Boot ROM Version : K.15.19
Default Boot : Secondary

In redundant management systems, this command will erase the selected flash in both the active and the standby management modules. If redundancy has been disabled or the standby module has failed self-test, this command only affects the active management module.