Changes between Version 3 and Version 4 of Realisations/2011-2012/Projet/Core2


Ignore:
Timestamp:
Jul 11, 2012, 11:46:15 AM (13 years ago)
Author:
bbaron
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Realisations/2011-2012/Projet/Core2

    v3 v4  
    7272|| Nagios || {{{nagiosadmin}}} || {{{password}}} || http || {{{13.8.0.40/28}}} ||
    7373|| Cacti || {{{admin}}} || {{{password}}} || http || {{{13.8.0.40/28}}} ||
     74
     75----
     76== Problème du routeur Juniper 3 ==
     77Site : [[http://www.cciezone.com/?p=311|CCIEZone.com]]
     78
     79>=== Upgrading a Juniper J4350 to 2GB Compact Flash ===
     80>
     81>This is somewhat of an impossibility, right?  Well, not really.  Although not technically supported by Juniper, we are able to go above the recommended 1GB Compact Flash size on J-series routers (at least J4350s).
     82>
     83>This was performed on lab equipment, not production equipment.  I wouldn’t advise doing anything that would violate any manufacturer’s support agreement on production equipment.  Use this at your own risk – your mileage may vary, especially as it’s not following Juniper’s recommendations.  Phew – disclaimer finished – now let’s move on…
     84>
     85>Here’s my predicament: I have two J4350s in a lab.  Both routers were running an ancient version of JUNOS (JUNOS 8.2), however to move to the most recent JUNOS version (10.1), I needed to have 1GB of compact flash in the router.  Well, checking where I was currently at didn’t help:
     86>
     87>{{{
     88>admin@J4350-1> show system storage
     89>Filesystem              Size       Used      Avail  Capacity   Mounted on
     90>/dev/ad0s1a             213M        63M       148M       30%  /
     91>devfs                   1.0K       1.0K         0B      100%  /dev
     92>devfs                   1.0K       1.0K         0B      100%  /dev/
     93>/dev/md0                146M       146M         0B      100%  /junos
     94>/cf                     213M        63M       148M       30%  /junos/cf
     95>devfs                   1.0K       1.0K         0B      100%  /junos/dev/
     96>procfs                  4.0K       4.0K         0B      100%  /proc
     97>/dev/bo0s1e              24M       5.0K        24M        0%  /config
     98>/dev/md1                168M       7.2M       147M        5%  /mfs
     99>/cf/var/jail            213M        63M       148M       30%  /jail/var
     100>devfs                   1.0K       1.0K         0B      100%  /jail/dev
     101>
     102>admin@J4350-1>
     103>}}}
     104>
     105>Hmm – the /cf only shows 213M (close enough to 256MB to indicate that we have a 256MB Compact Flash (CF) card in the router).
     106>
     107>Okay, looking at the JUNOS release notes, it looks like I could upgrade to JUNOS 9.3 ES with 256MB of CF. This won’t get me to JUNOS 10.1 – let’s keep looking for a solution.
     108>
     109>The JUNOS 10.1 release notes provide a table of supported storage on the J-series routers.  I looked up the 3rd-party part number on several websites (newegg.com, pricewatch.com, microcenter.com, etc.) and couldn’t find the 1GB CF card listed.
     110>
     111>At this point it looks like I’m stuck buying genuine Juniper CF memory.  This is a good idea in a production environment, but this is a lab and I’m looking for the cheapest possible solution.
     112>
     113>I found a couple of the cheapest 2GB SanDisk Compact Flash cards at Microcenter (item number: SDCFH-002G-A11) for ~$16 a piece, and decided to try these before buying genuine Juniper memory.
     114>
     115>Since the J4350 doesn’t have any externally-accessible CF slots, you need to either replace the internal CF memory (doesn’t help you in pre-staging the new card) or use a CF-to-USB reader.  I went down to the local office supply store and picked up an Ativa Compact Flash Memory Card USB drive (item number: 755-130) for ~$8.50.
     116>
     117>I downloaded the JUNOS 10.1 CF1024 install media image and installed it to the new 2GB compact flash card using dd in Linux:
     118>
     119>{{{
     120>gunzip junos-jsr-10.1R1.8-export-cf1024.gz
     121>dd if=~/downloads/junos-jsr-10.1R1.8-export-cf1024 of=/dev/sdb1
     122>}}}
     123>
     124>WARNING – DO NOT USE DD UNLESS YOU KNOW WHAT YOU’RE DOING AND ARE WILLING TO ACCEPT ANY RISK OF POTENTIAL DATA LOSS – IT CAN DESTROY YOUR DRIVE/DATA/ETC.!!! DO NOT RUN THE ABOVE COMMAND ON YOUR SYSTEM, AS YOUR DRIVE STRUCTURE MIGHT BE DIFFERENT – THIS COMMAND IS SIMPLY GIVEN AS AN EXAMPLE.
     125>
     126>DD came back with the typical (and expected) “no unused space” when it was finished, indicating a successful write.
     127>
     128>Well, I plopped the CF in the J4350 and booted it up and here’s what I was greeted with an endless rebooting cycle, with the router indicating that it had a missing operating system.
     129>
     130>After trying several different versions of JUNOS install images (JUNOS 8.5, 9.3 and 10.5), I finally gave up and realized that dd wasn’t going to cut it (why I wasn’t sure).
     131>
     132>I attached the CF USB drive to the router that was operational (remember, I had two routers, one that I was tinkering with, the other that was up and running JUNOS). After attaching it, I created a snapshot on the new 2GB CF:
     133>
     134>{{{
     135>admin@J4350-1> request system snapshot media usb
     136>error: cannot use usb media, may need to partition
     137>}}}
     138>
     139>Hmm, let’s try it again, this time telling it to partition the USB media:
     140>
     141>{{{
     142>admin@J4350-1> request system snapshot media usb partition as-primary
     143>Clearing current label...
     144>Partitioning usb media (da0) ...
     145>Partitions on snapshot:
     146>
     147>  Partition  Mountpoint  Size    Snapshot argument
     148>      a      /           1024MB  root-size
     149>      e      /config     196MB   config-size
     150>      g      /data       693MB   data-size
     151>Running newfs (1024MB) on usb media / partition (da0s1a)...
     152>Running newfs (196MB) on usb media /config partition (da0s1e)...
     153>Running newfs (693MB) on usb media /data partition (da0s1g)...
     154>Copying '/dev/ad0s1a' to '/dev/da0s1a' .. (this may take a few minutes)
     155>Copying '/dev/ad0s1e' to '/dev/da0s1e' .. (this may take a few minutes)
     156>The following filesystems were archived: / /config
     157>
     158>admin@J4350-1>
     159>}}}
     160>
     161>This worked! I loaded the newly formatted (and pre-loaded) CF in one of the J4350s and it worked like a champ! Now, I have plenty of memory on the router:
     162>{{{
     163>admin@j4350-2> show system storage
     164>Filesystem              Size       Used      Avail  Capacity   Mounted on
     165>/dev/ad0s1a             991M       272M       709M       28%  /
     166>devfs                   1.0K       1.0K         0B      100%  /dev
     167>/dev/md0                406M       406M         0B      100%  /junos
     168>/cf                     991M       272M       709M       28%  /junos/cf
     169>devfs                   1.0K       1.0K         0B      100%  /junos/dev/
     170>procfs                  4.0K       4.0K         0B      100%  /proc
     171>/dev/bo0s1e             189M       6.0K       187M        0%  /config
     172>/dev/md1                168M        13M       141M        9%  /mfs
     173>/cf/var/jail            991M       272M       709M       28%  /jail/var
     174>devfs                   1.0K       1.0K         0B      100%  /jail/dev
     175>/dev/md2                 39M       4.0K        36M        0%  /mfs/var/run/utm
     176>
     177>admin@j4350-2>
     178>}}}
     179>
     180>I’ve thought about why dd didn’t let me install the JUNOS install media images, however I don’t have an explanation for this. I tried the (non-supported) 2GB flash media with a 1024MB image, which could have caused problems (but most likely not). I also took the original (Juniper-branded) 256MB CF media and tried to use dd to load a CF256 install media to it, also resulting in failure (unable to boot off of the media).
     181>
     182>It wasn’t until I took the media to another Juniper router and partitioned/loaded it from this router. I was using dd on an Ubuntu 8.04 (LTS) system. I can’t imagine that dd behavior differs between distros like this, although never say never. Both the unsupported and supported media were unsuccessful when using dd. This is a little scary to me, realizing that if there hadn’t been another Juniper router available, I would’ve had to resort to using an Olive to prep (and fix the 256MB Juniper) CF media.
     183>
     184>Maybe this is a well-known fact – only certain OSs will let you copy over the install media, etc. I’ve never run into this, but am thankful that the CF USB drive worked on the remaining J4350 router.
     185>
     186>In conclusion, the two J4350s are equipped with 2GB of CF – pretty nifty, although not supported officially by Juniper!
     187
     188Site : [[http://www.defaultrouteuk.com/technical/articles/index.php?id=8839741048823279865#disqus_thread|defaultrouteUK]]
     189
     190>=== Recovering a faulty Juniper 4350 CF (with an iMac and a USB Printer) ===
     191>
     192>Recovering a Juniper J4350 should be easy because the manual says so. Just remember to take your screwdriver ;-)
     193>
     194>A few weeks ago my lab router fell off the network. The console showed me repeating hash (#) symbols followed by a HEX dump of a few characters. I figured this looked bad...don’t know what happened. Since I didn’t need it right away I’ve left it until now. So time to have a go at fixing this now.
     195>
     196>You’ll have to remove chassis from the rack (4 cage screws).
     197>Put the router on the bench and take off the rack ears from both sides of the chassis.
     198>Now go to the back of the chassis and you’ll see three black screws on the top. You need to unscrew these.
     199>Along each of the sides of the chassis (again toward the top of the case) you’ll see three more screws. Unscrew these on both sides.
     200>Now the case lid should come off.
     201>
     202>{{{
     203>######################################################################################
     204>############L'$LR#S###################################################################
     205>######################################################################################
     206>######################################################################################
     207>######################################################################################
     208>######################################################################################
     209>######################################################################################
     210>######################################################################################
     211>######################################################################################
     212>######################################################################################
     213>######################################################################################
     214>######################################################################################
     215>##################################################+#L'&LR#S###########################
     216>######################################################################################
     217>######################################################################################
     218>######################################################################################
     219>}}}
     220>
     221>With the router lid off I now see there are 4 x PC3200 DIMMS toward the left hand side and the compact flash (256MB) is sat snugly against the motherboard. My task here is to reformat the flash with the ‘install’ image from the Juniper software download page. Now I’ve chosen 9.3 because I felt like it but notice that there are three flavours available for 256, 512 and 1024MB flash cards...choose the right one for your flash size - this one shows the 512MB version.
     222>
     223>I’ve gotten the image and extracted the flash from the 4350 (man that was a pain too because the fan buffer was in the way). Now, I don’t have a flash/PCMCIA slot in my iMAC but I do have a printer connected to it with a compact flash reader so I figure I’m going to give it a try with that. Flash plugged in I see this error by loading the Terminal, changing to root (sudo -i) then doing a ‘dmesg’ to see any kernel messages.
     224>
     225>{{{
     226>               0 [Level 3] [ReadUID 0] [Facility com.apple.system.fs] [ErrType 10] [ErrNo 6]
     227>[IOType Write] [PBlkNum 246] [LBlkNum 0] [FSLogMsgID 222261612] [FSLogMsgOrder First]
     228>               0 [Level 3] [ReadUID 0] [Facility com.apple.system.fs] [DevNode /dev/disk2sl]
     229>[MountPt /Volumes/NO NAME] [FSLogMsgID 222261612] [FSLogMsgOrder Last]
     230>}}}
     231>
     232>Check it out, maybe my luck is changing. I see /dev/disk2s1 must be my Juniper flash card. Great now I can format it. First things first I need to uncompress the gzip file I just downloaded from Juniper. The original file was junos-jsr-9.3R4.4-export-cf256.gz. I run ‘gzip -d junos-jsr-9.3R4.4-export-cf256.gz’ to extract the file. Now I run the old faithful ‘dd’ (disk duplicate) command which is fairly common on *nix platforms to copy the contents of the archive onto the flash.
     233>
     234>{{{
     235>localhost:Downloads root# dd if=./junos-jsr-9.3R4.4-export-cf256 of=/dev/disk2sl
     236>}}}
     237>
     238>....I wait...and wait some more...then
     239>
     240>{{{
     241>500736+0 records in
     242>500736+0 records out
     243>256376832 bytes transferred in 690.853256 secs (371102 bytes/sec)
     244>}}}
     245>
     246>Awesome - looks like the data is on now. So I replace the CF card into the chassis and power on (there is no way I’m putting all those screws back in just yet)..and...it didn’t work ;-( All I see is #’s and the fan keeps spinning up and down.
     247>
     248>So I tried a USB stick. I took out the CF card because that is booted first. Then plug the USB flash into the front of the router and power on.