Junos OS

last person joined: yesterday 

Ask questions and share experiences about Junos OS.
  • 1.  Any way to clear the system commit history?

    Posted 07-01-2011 11:08

    I'm trying to get a box to a factory-default condition, and need to remove all entries shown when the show system commit command is executed. None of the rollback configs are needed, and in fact have been removed from the box, but I can't seem to be able to clear the history of the show system commit command. Any thoughts or suggestions are appreciated!

     

    Sincerely,

     

    David.



  • 2.  RE: Any way to clear the system commit history?

    Posted 07-01-2011 11:17

    > I'm trying to get a box to a factory-default condition, 

     

    If all you need to do is to bring the box to its pristine state (i.e. factory-default), the best way would be to use the Junos install media appropriate for your platform to do a full re-install.

     

    Look for "install media" on the Junos download page; you will need a Compact Flash or a USB stick according to the platform.

     

    Hope it helps,

     Saverio 

     

     



  • 3.  RE: Any way to clear the system commit history?

    Posted 07-01-2011 20:44

    I don't think re-installing would work here, as this box is already running 10.4R5.5.



  • 4.  RE: Any way to clear the system commit history?

    Posted 07-02-2011 03:29

    Hi,

     

    Please try it; it will work.

     

    An install-media re-installation will wipe a router and remove all information regardless of which version you are running.

    When you plug an install-media and reboot the router, your console will show a message asking you if it is ok to completely wipe out the router.

    If you answer yes, your router will be wiped out and brought back to factory default (i.e. no logs, nothing).

     

    Quoting from the guide:

     

    > The installation media repartitions the media and completely reinstall the JUNOS software.

    > No information from previous installations is retained during this installation.

     

    You can find more information here:

     

    http://www.juniper.net/techpubs/en_US/junos11.1/topics/reference/general/junos-installation-media.html

     

    This is the standard procedure to bring a router back to factory default, as used by Juniper and partners to bring a router to pristine state.

     

    In some special cases, this is preceded by multiple wipes (or even replacement/destruction) of both physycal media, but unless your router was used in some 'highly sensitive' network, it is not likely you will have the need to do this.

     

    I hope it helps,

     Saverio

     

     



  • 5.  RE: Any way to clear the system commit history?

    Posted 07-02-2011 03:34

    Hi

     

    Apart form the way suggested by Saverio, which should work, you can

    try "request system zeroize" (it won't work on EX, but should work on

    other platforms).



  • 6.  RE: Any way to clear the system commit history?
    Best Answer

    Posted 07-04-2011 08:22

    Hello,

    System commit history is in /var/db/commits file.

    This is simple text file with UNIX timestamp, username and commit method per line:

     

    root@Audi% more /var/db/commits
    1308651499 root other 
    1308651375 admin cli commit confirmed, rollback in 2mins
    1308650931 admin cli 
    1308646738 admin cli 
    1308646721 admin cli commit confirmed, rollback in 2mins

     Overwriting this file with empty string does the trick:

     

    root@Audi% echo "" > /var/db/commits
    root@Audi% more /var/db/commits
    
    root@Audi% exit
    exit
    
    aarseniev@Audi> show system commit 
    
    aarseniev@Audi> edit 
    Entering configuration mode
    
    [edit]
    aarseniev@Audi# commit 
    commit complete
    
    [edit]
    aarseniev@Audi# exit configuration-mode 
    Exiting configuration mode
    
    aarseniev@Audi> show system commit 
    0   2011-07-04 17:16:49 CEST by aarseniev via cli

     HTH

    Rgds
    Alex 

     

     



  • 7.  RE: Any way to clear the system commit history?

    Posted 07-05-2011 09:23

    So I tried all three methods, my fault for not providing enough info, this is not a physical box but a training instance of Olive, so install-media like USB would be more cumbersome to implement. Zeroizing and re-installing did not work, however Alex's solution to replace the contents of the /var/db/commits file did exactly what I was looking for. Thanks Alex!