Latest Posts

Upgrade JunOS from RAM Disk

Here is the steps to upgrade JunOS from RAM disk if you do not have enough available space on your disk, but you have enough memory free to use.

First, make sure you have enough free memory on your system:
Method1:
john@FW-GDBURTI-SRX-0> show system processes extensive 
node0:
--------------------------------------------------------------------------
last pid: 15489;  load averages:  0.14,  0.08,  0.08  up 10+23:35:46    18:27:00
124 processes: 18 running, 92 sleeping, 2 zombie, 12 waiting

Mem: 160M Active, 32M Inact, 560M Wired, 17M Cache, 112M Buf, 201M Free
Swap:


  PID USERNAME  THR PRI NICE   SIZE    RES STATE  C   TIME   WCPU COMMAND
 1114 root        7  76    0   490M 46780K RUN    0 820.3H 281.10% flowd_octeon_hm
   22 root        1 171   52     0K    16K RUN    0 226.7H 86.43% idle: cpu0
   23 root        1 -20 -139     0K    16K WAIT   0 170:59  0.00% swi7: clock
    5 root        1 -84    0     0K    16K rtfifo 0  56:51  0.00% rtfifo_kern_recv
 1120 root        1  76    0  4272K  1644K select 0  38:08  0.00% license-check
 1117 root        1  76    0  9864K  3088K select 0  12:40  0.00% jsrpd
 1119 root        1  76    0  9924K  3544K select 0  11:29  0.00% rtlogd
   25 root        1 -40 -159     0K    16K WAIT   0  11:02  0.00% swi2: net
 1111 root        2  76    0 20116K  5336K select 0   9:53  0.00% pfed
 1104 root        1  76    0 31052K  4920K select 0   9:03  0.00% chassisd
 1105 root        1  76    0  7140K  2500K select 0   8:04  0.00% alarmd
   48 root        1 -16    0     0K    16K psleep 0   6:57  0.00% vmkmemdaemon
 1101 root        1  76    0  2624K   744K select 0   6:31  0.00% bslockd
   26 root        1 -16    0     0K    16K -      0   5:41  0.00% yarrow
 1167 root        1  76    0 14640K  5500K select 0   2:53  0.00% mib2d
 1168 root        1  76    0 12680K  5480K select 0   2:50  0.00% snmpd
   41 root        1  20    0     0K    16K vnlrum 0   2:34  0.00% vnlru_

Method2:
root@FW-MAO-UAC> show chassis routing-engine
node0:
--------------------------------------------------------------------------
Routing Engine status:
    Temperature                 36 degrees C / 96 degrees F
    CPU temperature             34 degrees C / 93 degrees F
    Total memory              1024 MB Max   748 MB used ( 73 percent)
      Control plane memory     560 MB Max   386 MB used ( 69 percent)
      Data plane memory        464 MB Max   362 MB used ( 78 percent)
    CPU utilization:
      User                      10 percent
      Background                 0 percent
      Kernel                     5 percent
      Interrupt                  0 percent
      Idle                      85 percent
    Model                          RE-SRX240H
    Serial ID                      AABG0967
    Start time                     2013-10-02 20:50:57 EDT
    Uptime                         19 minutes, 26 seconds
    Last reboot reason             0x200:normal shutdown
    Load averages:                 1 minute   5 minute  15 minute
                                       0.27       0.21       0.30

The unused part of control plane memory can be used to create a RAM disk. In the above example you can calculate it (560 - 386 = 174 MB free).
Note: Do not try to create a RAM disk if you do not have enough free memory for this operation. The system may halt and stop responding, if you run out of memory while creating or using the RAM disk.

Other steps to create a RAM Disk
0. Login as root to shell.
1. Create tmp directory: "mkdir /var/tmp/disk1"
2. Mount it to RAM: "mount_mfs -s 200m md /var/tmp/disk1/"
3. Copy Junos image to /var/tmp/disk1
4. From CLI run update "request system software add
/var/tmp/disk1/junos-srxsme-11.4R5.5-domestic.tgz no-copy no-validate"
5. If you have managed to upgrade software on node-0 move to node-1 and upgrade Junos on it.
6. Reboot both nodes at same time.

Note: after reboot, the files in RAM disk will disappear automatically.

No comments