cisco hands-on experience


Flash File System 2970,3550,3560,3750 and Image Handling

flash-file-system-2970-3550-3560-3750-and-image-handling

It’s very useful to know, how a file system on a Catalyst
2970, 3550, 3560, and 3750 Flash file system
work. If you loose your password, it’s a easy way with above mentioned hardware
to set it to factory default.

Step-by-Step Recovery Procedure

As a prerequisite, a PC must be attached to the console port to the switch.
Choose a terminal software of your choice. For example putty.exe.

    1. Unplug the power cord
    2. Press the mode button while you reconnect the power cable to the switch
    3. Release the MODE button after the STAT LED goes out
      now you should see the switch:prompt
      It depends on the model. Press the mode button for approximately 30-40sec. Now, you should be on the safe side

 

rommon mode
The system has been interrupted prior to initializing the
flash filesystem. The following commands will initialize
the flash filesystem, and finish loading the operating
system software:

flash_init
boot

switch:

Issue the flash_init command or if availabe the load_helper command
to see the flash:/ file system

directory

switch: flash_init
Initializing Flash…
flashfs[0]: 441 files, 8 directories
flashfs[0]: 0 orphaned files, 0 orphaned directories
flashfs[0]: Total bytes: 32514048
flashfs[0]: Bytes used: 18242560
flashfs[0]: Bytes available: 14271488
flashfs[0]: flashfs fsck took 17 seconds.
…done Initializing Flash.

switch:

switch: dir flash:/
Directory of flash://

2   -rwx   2072     multiple-fs
3   drwx   192     c3560-ipbasek9-mz.122-58.SE2
4   -rwx   1911     private-config.text
448   -rwx    106     info
450   -rwx   2330    config.text

14271488 bytes available (18242560 bytes used)

switch:

The startup config file is usually the config.text.
If you change the boot system value on a completely
reloaded switch, the start-up config file will be the name you have been entered in
the boot system variable.

See next step.

change boot system variable – current condition
Cat3560#sh boot
BOOT path-list : flash:/c3560-ipbasek9-mz.122-58.SE2/c3560-ipbasek9-mz.122-58.bin
Config file : flash:/config.text
Private Config file : flash:/private-config.text
Enable Break : no
Manual Boot : no
HELPER path-list :
Auto upgrade : yes
Auto upgrade path :
NVRAM/Config file
buffer size: 524288
Timeout for Config
Download: 0 seconds
Config Download
via DHCP: disabled (next boot: disabled)

Choose a new startup(config.text)name of your choice.

boot system variable
Cat3560(config)#boot config-file flash:/new.file.startup
change boot system variable-target state
Cat3560#sh boot
BOOT path-list : flash:/c3560-ipbasek9-mz.122-58.SE2/c3560-ipbasek9-mz.122-58.bin
Config file : flash:/new.file.startup
Private Config file : flash:/private-config.text
Enable Break : no
Manual Boot : no
HELPER path-list :
Auto upgrade : yes
Auto upgrade path :
NVRAM/Config file
buffer size: 524288
Timeout for Config
Download: 0 seconds
Config Download
via DHCP: disabled (next boot: disabled)
Cat3560#dir
Directory of flash:/

2 -rwx 2628 Mar 1 1993 00:05:28 +00:00 new.file.startup
3 drwx 192 Mar 1 1993 00:14:42 +00:00 c3560-ipbasek9-mz.122-58.SE2
448 -rwx 106 Mar 1 1993 00:14:42 +00:00 info
449 -rwx 2567 Mar 1 1993 00:01:06 +00:00 config.text
450 -rwx 5144 Mar 1 1993 00:05:28 +00:00 multiple-fs
451 -rwx 3819 Mar 1 1993 00:05:28 +00:00 private-config.text

32514048 bytes total (14262784 bytes free)

The switch create a new start-up config file on the switch file system, which is named ‘new.file.startup’
If you do any changes on the switch-config, the alternation will be saved
in the new generated start-up config file (‘new.file.startup’)

Summary
  • start-up file = config.text or name of the boot config file variable
    (Config file : flash:/config.text)
Password recovery

If you forgot you password and so forth – act like the following.
Start the switch into the rommon mode like mentioned above.
Issue the flash_init command and type ? and press enter.
Now you see the config file generated on the file system.
If you want to delete it – do like this

delete the config file
switch: delete flash:/config.text
Are you sure you want to delete “flash:/config.text” (y/n)?y
File “flash:/config.text” deleted

After that, the file is deleted

Image Handling

There a two different types of IOS image files.

  • *.bin
  • *.tar

To download a bin file to the switch use the copy tftp flash command to do this.
Prerequisits are the ip reachability of the switch and a tftp server software on the PC.
For example tftpd32 or tftpd64.
Bin files can be copied directly to the flash:/ root directory to functional in a proper manner.
Tar files have to be extracted on the system file. Tar file will give you ability to manage the switch via a browser.

How to extract an image tar file?
xtract tar file
Cat3560#archive tar /xtract tftp://10.10.10.11/c2960-lanbasek9-tar.122-58.SE2.tar flash:/
Loading c2960-lanbasek9-tar.122-58.SE2.tar from 10.10.10.11 (via Vlan1): !
c2960-lanbasek9-mz.122-58.SE2/ (directory)
c2960-lanbasek9-mz.122-58.SE2/html/ (directory)
extracting c2960-lanbasek9-mz.122-58.SE2/html/status.htm (8107 bytes)
extracting c2960-lanbasek9-mz.122-58.SE2/html/menu.css (1654 bytes)
extracting c2960-lanbasek9-mz.122-58.SE2/html/graph_dash.js (19448 bytes)
extracting c2960-lanbasek9-mz.122-58.SE2/html/layers.js (1616 bytes)
extracting c2960-lanbasek9-mz.122-58.SE2/html/topbannernofpv.shtml (18137 bytes)O
extracting c2960-lanbasek9-mz.122-58.SE2/html/portset.shtml (75856 bytes)
c2960-lanbasek9-mz.122-58.SE2/html/zh/ (directory)
extracting c2960-lanbasek9-mz.122-58.SE2/html/zh/xhome_new.htm (5360 bytes)
extracting c2960-lanbasek9-mz.122-58.SE2/html/zh/re_framework.js (4876 bytes)
extracting c2960-lanbasek9-mz.122-58.SE2/html/zh/troubleshooting_Browser.htm (3783 bytes)
extracting c2960-lanbasek9-mz.122-58.SE2/html/zh/re_xsetup.js (12993 bytes)O
extracting c2960-lanbasek9-mz.122-58.SE2/html/zh/charset.js (331 bytes)
extracting c2960-lanbasek9-mz.122-58.SE2/html/zh/re_smartports.js (3803 bytes)
c2960-lanbasek9-mz.122-58.SE2/html/zh/help/ (directory)

!— Output suppressed.

This command extract the tar file to the root flash:/ directory

PC TFTP Server IP = 10.10.10.11
How to delete a directory completely
delete directory
Cat3560#delete /force /recursive flash:/c3560-ipbasek9-mz.122-58.SE2

This command delete a directory of your choice
3    drwx    192    Mar 1 1993 01:57:06 +00:00 c2960-lanbasek9-mz.122-58.SE2

  1. Loriane Reply

    Have you ever thought about anddig a little bit morethan just your articles? I mean, what you say is fundamentaland all. But think about if you added some great pictures or video clips to give your posts more, pop !Your content is excellent but with images and clips, this site could certainly be one of the best in its field.Terrific blog!

    • Jacob Reply

      Hi Loriane,
      thanks for your feedback. I share your opinion.
      But it is very time-consuming to create great pics or vids.
      I keep your comment in mind and will improve my posts.

  2. Alexandra Reply

    Howdy! This is my first comment here soI just watned to give a quick shout out and tell you I truly enjoy reading through your blog posts.Can you suggest any other blogs/websites/forums that deal with the same topics?Many thanks!

    • Jacob Reply

      Hi Alexandra,
      i have some good blog links. But instant not at one’s fingertips.

  3. Lothar Beckstein Reply

    when you need to disable the mode button express setup (e.g. deleting configurations…):

    Switch(config)# no setup express

  4. Gregg Reply

    wonderful issues altogether, you just won a new reader.
    What might you recommend about your publish that you
    simply made a few days ago? Any certain?

  5. IsiahXAndrzejczyk Reply

    I just like the valuable info you provide on your articles.

    I’ll bookmark your weblog and test again right here frequently.
    I am relatively sure I will learn lots of new stuff right here!
    Good luck for the next!

Leave a Reply

*

captcha *