元NWエンジニアが語るブログ

NWエンジニアの思いの丈サイト

cat4500 vlan.dat削除方法


最近SDN、NFVなどの技術が流行っておりますが、なかなか触る機会がないので向上心が消えつつある今日この頃です。なので向上心をわずかでも上げようと今回はCisco機器で少しはまった事を書いてみます。
内容は、cat4500シリーズでvlan.datが消えないという事象です。

■まずvlan.datの在り処は
Switch#dir cat4000_flash:
Directory of cat4000_flash:/

    1 -rw- 916 <no date> vlan.dat

524284 bytes total (523368 bytes free)


■deleteコマンドで削除しようとすると
Switch#delete cat4000_flash:vlan.dat
Delete filename [vlan.dat]?
Delete cat4000_flash:vlan.dat? [confirm]
%Error deleting cat4000_flash:vlan.dat (Permission denied)
Permission deniedと怒られる。権限無いってどゆことは(激おこ

CISCOページ
To erase the vlan.dat file on the 6500/6000 switches, issue the erase const_nvram: command. On the 4500/4000 switches, issue the erase cat4000_flash: command. On the fixed configuration switches, issue the delete flash:vlan.dat command.


■vlan.datはdeleteコマンドではなく、eraseコマンドで消せと書かれてる。
なので、eraseコマンドで消すと
Switch#erase cat4000_flash:vlan.dat
                           ^
% Invalid input detected at '^' marker.

あれ?だめじゃん。タブ補完効かんしアカンやん。

しかたねーcat4500_flash:の中身はvlan.datしかないし、丸ごと消すか
ということでcat4500_flash:を丸ごと消すと。
Switch#erase cat4000_flash:
Erasing the cat4000_flash filesystem will remove all files! Continue? [confirm]
[OK]
Erase of cat4000_flash: complete

おお消えた。

あとは、そのままreloadすればOKやった。