Showing results for 
Search instead for 
Did you mean: 
Aleksandar Vidakovic
Cisco Employee
Cisco Employee


This document and the accompanying script helps users of 64-bit IOS XR identify unnecessary files on file systems, that can lead over time to disk space shortage. A high number of showtechs or coredumps, SW packages copied to a disk are some of the well known contributors to disk space depletion.


The script contained in this document is identifying commonly seen large files that are not required for the proper functioning of the system. Such files can should be copied to a file server and afterwards deleted from the device. This script can be used on ASR 9000 (64-bit only), NCS5500, NCS5000, NCS540, NCS560 devices.


Script is using the following criteria to identify potentially unnecessary files:


  1. Files with specific extensions (.iso, .rpm, core.txt, core.gz, .tar, and .tgz) across all file systems
  2. Any files in folders used for collecting troubleshooting information (/disk0:/core, harddisk:/dumper, and harddisk:/showtech in XR VM)

The script auto-detects whether it's executed within XR or Admin VM/LXC.

Working With The Script 

Script source code is attached to this document. Working with the script is very simple:


  1. Download the script
  2. Change the script extension from .txt to .py
  3. Copy the script to XR and Admin VMs/LXCs on active and standby RPs on the target device
  4. Execute the script in python environment

The script is not taking any action on the identified files.



// Copy file from file server to active RP's XR VM
RP/0/RSP0/CPU0:CORE-TOP#copy ftp://<username>:<password>@@ harddisk
Destination filename [/harddisk:/]?
Accessing ftp://<username>:*@
10695 bytes copied in 0 sec

Copy operation success

// Execute script in active RP's XR VM:
RP/0/RSP0/CPU0:CORE-TOP#run python /misc/disk1/
<output omitted>

// Copy script to active RP's Admin VM:
root connected from using ssh on sysadmin-vm:0_RSP0
sysadmin-vm:0_RSP0# copy harddisk:/ location 0/RSP0/CPU0/VM1 harddisk: location 0/RSP0
Copying harddisk:/ to harddisk:
File copied successfully

Execute script in active RP's Admin VM:
sysadmin-vm:0_RSP0# run python /misc/disk1/
<output omitted>



Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Recognize Your Peers
Quick Links