Upgrading a Juniper J4350 to 2GB Compact Flash
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).
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…
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:
admin@J4350-1> show system storage Filesystem Size Used Avail Capacity Mounted on /dev/ad0s1a 213M 63M 148M 30% / devfs 1.0K 1.0K 0B 100% /dev devfs 1.0K 1.0K 0B 100% /dev/ /dev/md0 146M 146M 0B 100% /junos /cf 213M 63M 148M 30% /junos/cf devfs 1.0K 1.0K 0B 100% /junos/dev/ procfs 4.0K 4.0K 0B 100% /proc /dev/bo0s1e 24M 5.0K 24M 0% /config /dev/md1 168M 7.2M 147M 5% /mfs /cf/var/jail 213M 63M 148M 30% /jail/var devfs 1.0K 1.0K 0B 100% /jail/dev admin@J4350-1>
Hmm – the /cf only shows 213M (close enough to 256MB to indicate that we have a 256MB Compact Flash (CF) card in the router).
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.
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.
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.
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.
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.
I downloaded the JUNOS 10.1 CF1024 install media image and installed it to the new 2GB compact flash card using dd in Linux:
gunzip junos-jsr-10.1R1.8-export-cf1024.gz dd if=~/downloads/junos-jsr-10.1R1.8-export-cf1024 of=/dev/sdb1
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.
DD came back with the typical (and expected) “no unused space” when it was finished, indicating a successful write.
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.
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).
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:
admin@J4350-1> request system snapshot media usb error: cannot use usb media, may need to partition
Hmm, let’s try it again, this time telling it to partition the USB media:
admin@J4350-1> request system snapshot media usb partition as-primary
Clearing current label...
Partitioning usb media (da0) ...
Partitions on snapshot:
Partition Mountpoint Size Snapshot argument
a / 1024MB root-size
e /config 196MB config-size
g /data 693MB data-size
Running newfs (1024MB) on usb media / partition (da0s1a)...
Running newfs (196MB) on usb media /config partition (da0s1e)...
Running newfs (693MB) on usb media /data partition (da0s1g)...
Copying '/dev/ad0s1a' to '/dev/da0s1a' .. (this may take a few minutes)
Copying '/dev/ad0s1e' to '/dev/da0s1e' .. (this may take a few minutes)
The following filesystems were archived: / /config
admin@J4350-1>
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:
admin@j4350-2> show system storage Filesystem Size Used Avail Capacity Mounted on /dev/ad0s1a 991M 272M 709M 28% / devfs 1.0K 1.0K 0B 100% /dev /dev/md0 406M 406M 0B 100% /junos /cf 991M 272M 709M 28% /junos/cf devfs 1.0K 1.0K 0B 100% /junos/dev/ procfs 4.0K 4.0K 0B 100% /proc /dev/bo0s1e 189M 6.0K 187M 0% /config /dev/md1 168M 13M 141M 9% /mfs /cf/var/jail 991M 272M 709M 28% /jail/var devfs 1.0K 1.0K 0B 100% /jail/dev /dev/md2 39M 4.0K 36M 0% /mfs/var/run/utm admin@j4350-2>
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).
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.
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.
In conclusion, the two J4350s are equipped with 2GB of CF – pretty nifty, although not supported officially by Juniper!