Brocade CF Replacement
Brocade CF Replacement
Brocade CF Replacement
Introduction
If you open a Brocade SAN switch you’ll see a standard CF (Compact Flash) drive. On this drive are
stored all the specific information of your switch (licenses, configuration) and your Linux OS that
keeps your switch working.
I not aware of a procedure how to reinstall your OS and your specific configuration if this CF drive
fails.
So, it is better to do a complete backup / dump of your CF drive and to know how a replace your
drive with a new one.
All step a described here.
Backup
You need a running Linux PC (here with IP-Address 192.168.50.53) to manage the complete copy
task.
Login to your brocade switch as root and run the following command
Put the new CF drive into this reader. Create two primary partitions of the same size on this CF drive
(gParted helps a lot):
The filesystem type should be the same as the original. In this case here it is “ext3”
# file hda1.dmp
# cd ; umount /mnt ; umount /mnt1 (remark: the umount take some time to be finished; be patient!)
If you put your new CF drive into your SAN switch, the boot process fails (logged through the serial
line):
CPU: AMCC PowerPC 440EPx Rev. A at 660 MHz (PLB=132, OPB=66, EBC=33 MHz)
No Security/Kasumi support
I2C boot EEPROM enabled
Bootstrap Option G - Boot ROM Location I2C (Addr 0x54)
Internal PCI arbiter enabled, PCI async ext clock used
32 kB I-Cache 32 kB D-Cache
Board: Tomahawk
I2C: ready
DRAM: Initializing DDRSDRAM
DDR Init: speed = 132000002
DQS calibration - Window detected:
max_passing_cases = 54
wr_dqs_shift = 95
dll_dqs_delay_X = 30
dll_dqs_delay_X window = 4 - 57
DDR0_09=0x00011d5f
DDR0_22=0x00267f0b
DDR0_17=0x1e005900
DDR0_18=0x1e1e1e1e
DDR0_19=0x1e1e1e1e
ECC Enabling DONE
512 MB
POST RAM test disabled.
Now running in RAM - U-Boot at: 1fb26000
trap_init : 0x0
system inventory subsystem initialized
FLASH: Tomahawk CFI Flash Driver Initialized
4 MB
CPLD: Init complete
bootrom_verbose_flag=1
PCI: gd->brcd_flags = 0, PCI init
Skip our host bridge
00 07 1657 0011 0280 18
In: serial
Out: serial
Err: serial
Net:
Checking system RAM - press any key to stop test
Checking memory address: 00100000
System RAM test using Default POST RAM Test succeeded.
set_bootstatus: BS_LOAD_OS, platform_idx = 1
Type run flash_nfs to mount root filesystem over NFS
Hit ESC to stop autoboot: 0
ATA device vendor SMI MODEL, product SMI 00004A18, revision 20071116
Map file at LBA sector 0x19ad08
Blk map has an invalid version 0
ATA device vendor SMI MODEL, product SMI 00004A18, revision 20071116
Map file at LBA sector 0x9c067
Blk map has an invalid version 0
do_bootm 171: load_addr 0x00100000 addr 0x00400000
do_bootm 174: ## Booting image at 00400000 load_addr 0x00100000 ...
Bad Magic Number
You have to change specific parameters that you’ll get if you have a running SAN switch.
So, you need to bypass the “Bad Magic Number” problem.
It is possible to boot the SAN switch not only from your CF drive but from a RAM-disk, too. This RAM
boot process lets you get into your SAN Linux OS.
You need specific programs to handle the RAM images. The program package is called “u-boot-
tools”.
First of all, you must create a new directory i.e. /home/a/boot and get into this directory.
Mount the hda1.dmp again and copy the contents of the ./boot directory into directory just created:
# cp /mnt/boot/* /home/a/boot
# dumpimage -l ./zImage.tree.initrd
Image Name: Linux-2.6.14.2
Created: Wed Jan 29 11:06:53 2020
Image Type: PowerPC Linux Multi-File Image (uncompressed)
Data Size: 4306459 Bytes = 4205.53 KiB = 4.11 MiB
Load Address: 00000000
Entry Point: 00000000
Contents:
Image 0: 3227782 Bytes = 3152.13 KiB = 3.08 MiB
Image 1: 1078663 Bytes = 1053.38 KiB = 1.03 MiB
This file consists of two images that must be extracted into separate files:
Put these two img-files into a tftp-server file directory (I use a OpenTFTPServer for Windows that can
be started by a batch-script).
Access your brocade SAN switch through a serial line and select the command shell option:
1) Start system.
2) Recover password.
3) Enter command shell.
Option? 3
=> saveenv
=> Saving Environment to Flash...
Done
=>
Now it’s time to download this img-files
….
Login as root
# mapinst /mnt/boot/zImage.tree.initrd
Map file starting LBA: 0x19ad08
# mapinst /mnt/boot/zImage.tree.initrd
Map file starting LBA: 0x9c067
# bootenv OSLoader "ATA()0x19ad08;ATA()0x9c067" <= hex numbers from output above!
# reboot
The boot process starts now regularly from your new CF drive.