Cisco – How to delete data from IOS-XE

cisco

I would like to completely initialize the ASR1002 to securely pass the device to third party.

To delete all configuration in regular IOS, I usually run "write erase" and delete unnecessary file from "flash" by "delete flash:FILENAME" because I sometimes found backup configuration stored under flash:.

Is there any special way to delete configuration on IOS-XE?
I deleted startup and running config by following the instruction written here.
How to erase running-configuration in Cisco IOS-XE?

And checked under bootflash:.

Here is the latest output by "show file systems".

 Router#show file systems
File Systems:

       Size(b)       Free(b)      Type  Flags  Prefixes
             -             -    opaque     rw   system:
             -             -    opaque     rw   tmpsys:
*   7819087872    7215439872      disk     rw   bootflash:
    2872836096    2384969728      disk     rw   fpd:

       2097152       1585152      disk     rw   obfl:

             -             -    opaque     rw   null:

             -             -    opaque     ro   tar:

             -             -   network     rw   tftp:

      33554432      33553356     nvram     rw   nvram:

             -             -    opaque     wo   syslog:

             -             -   network     rw   rcp:

             -             -   network     rw   ftp:

             -             -   network     rw   http:

             -             -   network     rw   scp:

             -             -   network     rw   https:

             -             -    opaque     ro   cns:


Router#

Best Answer

I actually deleted all directories and files under bootflash: by following commands.

Router#delete /force /recursive lost+found
Router#delete /force /recursive .prst_sync
Router#delete /force /recursive tracelogs.923
Router#delete /force /recursive tracelogs
Router#delete /force /recursive .installer
Router#delete /force /recursive .rollback_timer
Router#dir /all
Directory of bootflash:/
242881  drwx        4096  May 10 2017 02:03:45 +00:00  .rollback_timer
    14  -rw-   205119800   Mar 1 2016 16:32:14 +00:00  asr1000rp1-ipbasek9.02.04.02.122-33.XND2.bin
7819087872 bytes total (7216553984 bytes free)
Router#

HOWEVER, after reboot, as shown below some directories are recreated. I guess it is OS-XE's normal behavior..

Router>en
Router#pwd
bootflash:
Router#dir /all
Directory of bootflash:/
242881  drwx        4096  May 10 2017 02:03:45 +00:00  .rollback_timer
437185  drwx        4096  May 10 2017 02:08:09 +00:00  tracelogs
    11  -rwx        5947  May 10 2017 02:04:30 +00:00  tracelogs.585
728641  drwx        4096  May 10 2017 02:06:18 +00:00  core
259073  drwx        4096  May 10 2017 02:06:18 +00:00  .prst_sync
129537  drwx        4096  May 10 2017 02:07:11 +00:00  .installer
    14  -rw-   205119800   Mar 1 2016 16:32:14 +00:00  asr1000rp1-ipbasek9.02.04.02.122-33.XND2.bin
7819087872 bytes total (7216197632 bytes free)
Router#