fateame 发表于 2018-7-20 11:11:33

Reset a Cisco 2960 Switch To Factory Default Settings-winshenting

  Flattening a switch before re-deployment is one of those simple tasks that I always find myself having lookup on the web, so I thought I’d save myself some time in future and document it here.
Step 1.
  Connect up your console cable and power on the switch, whilst holding down the “mode” button:

  This interrupts the boot process before the Flash file system can initialize, and after a short while (continue holding the “mode” button) you will see the following prompt:
Using driver version 1 for media type 1  
Base ethernet MAC Address: 4c:30:2d:81:ef:80
  
Xmodem file system is available.
  
The password-recovery mechanism is enabled.
  
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:
Step 2.
  Initialize the flash file system with the command: flash_init
switch: flash_init  
Initializing Flash...
  
mifs: 10 files, 1 directories
  
mifs: Total bytes : 1806336
  
mifs: Bytes used : 612352
  
mifs: Bytes available : 1193984
  
mifs: mifs fsck took 1 seconds.
  
mifs: 0 files, 1 directories
  
mifs: Total bytes : 3870720
  
mifs: Bytes used : 1024
  
mifs: Bytes available : 3869696
  
mifs: mifs fsck took 0 seconds.
  
mifs: 5 files, 1 directories
  
mifs: Total bytes : 258048
  
mifs: Bytes used : 9216
  
mifs: Bytes available : 248832
  
mifs: mifs fsck took 0 seconds.
  
mifs: 5 files, 1 directories
  
mifs: Total bytes : 258048
  
mifs: Bytes used : 9216
  
mifs: Bytes available : 248832
  
mifs: mifs fsck took 1 seconds.
  -- MORE --
  
mifs: 566 files, 19 directories
  
mifs: Total bytes : 57931776
  
mifs: Bytes used : 28429312
  
mifs: Bytes available : 29502464
  
mifs: mifs fsck took 21 seconds.
  
...done Initializing Flash.
Step 3.
  Delete the config.text file from the flash directory:
switch: del flash:config.text  
Are you sure you want to delete "flash:config.text" (y/n)?y
  
File "flash:config.text" deleted
Step 4.
  Delete the vlan.dat file from the flash directory:
switch: del flash:vlan.dat  
Are you sure you want to delete "vlan.dat" (y/n)?y
  
File "flash:vlan.dat" deleted
Step 5.
  Reboot the switch and you're done:
switch: boot  
Loading "flash:c2960s-universalk9-mz.122-58.SE2.bin"...
  
--- System Configuration Dialog ---
  
Enable secret warning
  
----------------------------------
  
In order to access the device manager, an enable secret is required
  
If you enter the initial configuration dialog, you will be prompted for the enable secret
  
If you choose not to enter the intial configuration dialog, or if you exit setup without setting the enable secret,
  
please set an enable secret using the following CLI in configuration mode-
  
enable secret 0 <cleartext password>
  
----------------------------------
  
Would you like to enter the initial configuration dialog? :
  
% Please answer 'yes' or 'no'.
页: [1]
查看完整版本: Reset a Cisco 2960 Switch To Factory Default Settings-winshenting