Pages

Sunday, August 16, 2015

Juniper Warning Boot from Backup after corruption primary root partition and Auto recovery


Juniper Warning Boot from Backup after corruption primary root partition and Auto recovery



*** When we loging to any Juniper Router / Switch if this shows like bellow....

THIS DEVICE HAS BOOTED FROM THE BACKUP JUNOS IMAGE


***********************************************************************
**                                                                   **
**  WARNING: THIS DEVICE HAS BOOTED FROM THE BACKUP JUNOS IMAGE      **
**                                                                   **
**  It is possible that the primary copy of JUNOS failed to boot up  **
**  properly, and so this device has booted from the backup copy.    **
**                                                                   **
**  Please re-install JUNOS to recover the primary copy in case      **
**  it has been corrupted.                                           **
**                                                                   **
***********************************************************************


### Solutions ####
##################


* Check Alarms by bellow command

## show chassis alarms

2 alarms currently active
Alarm time               Class  Description
2015-07-10 21:09:58 UTC  Major  PEM 1 Output Failure
2015-07-10 21:09:53 UTC  Minor  Host 0 Boot from backup root



* Now check partitions by bellow command

### show system storage partitions

Boot Media: internal (ad0)
Active Partition: ad0s1a
Backup Partition: ad0s2a
Currently booted from: backup (ad0s2a)

Partitions information:
  Partition  Size   Mountpoint
  s1a        619M   altroot
  s2a        620M   /      
  s3e        49M    /config
  s3f        615M   /var    
  s4a        54M    recovery
  s4e        5.6M


* We can repair the primary partition, by using "request system snapshot media internal slice alternate" without any downtime.

** Copy from backup to Active partition (Also Format Primary Active Partition) by bellow command
### request system snapshot media internal slice alternate

Formatting alternate root (/dev/ad0s1a)...
Copying '/dev/ad0s2a' to '/dev/ad0s1a' .. (this may take a few minutes)
The following filesystems were archived: /


* The following commands are issued to verify the Junos image installed on each slice:

        ###show system snapshot media internal slice 1
        ###show system snapshot media internal slice 2

** againg see alarms by ## show chassis alarms 

** To avoid alarms, use the following command to ensure that the switch boots from the primary partition:

## For EX2200 Switch **  request system reboot slice alternate media internal

### request system reboot slice alternate media internal
*N.B. to reboot now and show the effect  ## request system reboot

** after reboot check Currently booted from:  active or backup ?? if active then ok....
## show system storage partitions          
Boot Media: internal (ad0)
Active Partition: ad0s1a
Backup Partition: ad0s2a
Currently booted from: active (ad0s1a)


** Use auto recovery for some Juniper devices like SRX
### request system autorecovery state save  


Sunday, August 2, 2015

Saturday, August 1, 2015

Juniper root password recovery

Juniper root password recovery::



### Connect your device  directly with a Laptop or PC via console:


Configure the port settings as follows:
Bits per second: 9600
Data bits: 8
Parity: None
Stop bits: 1
Flow control: None


### Power off and  on your switch by plugging in the power cord of the device.

### Hit [Enter] to boot immediately, or space bar for command prompt.
Booting [kernel] in 1 second...

loader>

### Type "boot -s" when it shows "loader>"

### loader> boot -s

### Type "recovery" when it shows "/bin/sh:"

### enter full pathname of shell or 'recovery' for root password recovery or RETURN for /bin/sh: recovery



### Enter configuration mode in the CLI:

user@switch> configure

Set the root password. For example:

root@switch# set system root-authentication plain-text-password

root@switch# set system login user noc uid 210

## Exit configuration mode in the CLI.

root@switch#exit


root@switch> exit

### enter y to reboot the switch

Reboot the system? [y/n] y