Options

Restoring factory default 2950

BadFishBadFish Member Posts: 8 ■□□□□□□□□□
Hello all,
I am trying to wipe out the vlan.dat info on a switch I just recently bought.
So I do the following:
SW2950>en
Password:
SW2950#write erase
Erasing the nvram filesystem will remove all files! Continue? [confirm]
[OK]
Erase of nvram: complete
SW2950#
SW2950#delete flash:vlan.dat
Delete filename [vlan.dat]? y
Delete flash:y? [confirm]y
%Error deleting flash:y (No such file or directory)
SW2950#reload

System configuration has been modified. Save? [yes/no]: n
Proceed with reload? [confirm]

1d02h: %SYS-5-RELOAD: Reload requested

However when I do a show run command I see a bunch of vlans in the config.
Switch#show run
Building configuration...

Current configuration : 1067 bytes
!
version 12.1
no service pad
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname Switch
!
!
!
vlan 2
 name DC80004C
!
vlan 3
 name DC80005C
!
vlan 4
 name SPARE
!
vlan 5
 name SPARE1
!
vlan 29
 name DC80004C_P2P
!
vlan 62
 name DC80004C_SECURE
!
vlan 63
!
vlan 122
 name DC80004C_COMPLIMENTARY
ip subnet-zero
vtp domain TMO
vtp mode transparent
!
spanning-tree extend system-id
!
!
interface FastEthernet0/1
 no ip address
!
interface FastEthernet0/2
 no ip address
!
interface FastEthernet0/3
 no ip address
!
interface FastEthernet0/4
 no ip address
!
interface FastEthernet0/5
 no ip address
!
interface FastEthernet0/6
 no ip address
!
interface FastEthernet0/7
 no ip address
!
interface FastEthernet0/8
 no ip address
!
interface FastEthernet0/9
 no ip address
!
interface FastEthernet0/10
 no ip address
!
interface FastEthernet0/11
 no ip address
!
interface FastEthernet0/12
 no ip address
!
interface Vlan1
 no ip address
 no ip route-cache
 shutdown
!
ip http server
!
!
line con 0
line vty 5 15
!
end

Any help or suggestions would be appreciated.

Comments

  • Options
    shednikshednik Member Posts: 2,005
    vlans aren't saved in the running config, you will need to remove the vlan.dat from flash.

    EDIT: wow I completely missed you doing that my fault...but yea what slowhand said.
  • Options
    SlowhandSlowhand Mod Posts: 5,161 Mod
    What I like to do is make sure I've got a backup copy of the IOS running on the device saved to a T.F.T.P. server or USB stick, then erase all the contents of the flash storage and then reload the IOS. (You have to go through the basic ROMMON setup afterwards, so make sure you know what IP address to give your device so you can properly retrieve your IOS image.)

    Be warned, though, setting up a switch using only the ROMMON commands is a bit daunting. If you're not sure if you can do it, you might have to just erase everything else in flash until there's only the IOS left.

    Free Microsoft Training: Microsoft Learn
    Free PowerShell Resources: Top PowerShell Blogs
    Free DevOps/Azure Resources: Visual Studio Dev Essentials

    Let it never be said that I didn't do the very least I could do.
  • Options
    SlowhandSlowhand Mod Posts: 5,161 Mod
    Actually, upon closer inspection, it looks like this part is what's tripping you up:
    SW2950#delete flash:vlan.dat
    Delete filename [vlan.dat]? y
    Delete flash:y? [confirm]y
    %Error deleting flash:y (No such file or directory)
    

    Don't type "y" after the "Delete filename" line, just hit enter. Notice that it's asking you if you want to delete the file named "y" on the next line.

    Free Microsoft Training: Microsoft Learn
    Free PowerShell Resources: Top PowerShell Blogs
    Free DevOps/Azure Resources: Visual Studio Dev Essentials

    Let it never be said that I didn't do the very least I could do.
  • Options
    ColbyGColbyG Member Posts: 1,264
    Slowhand wrote: »
    What I like to do is make sure I've got a backup copy of the IOS running on the device saved to a T.F.T.P. server or USB stick, then erase all the contents of the flash storage and then reload the IOS. (You have to go through the basic ROMMON setup afterwards, so make sure you know what IP address to give your device so you can properly retrieve your IOS image.)

    Be warned, though, setting up a switch using only the ROMMON commands is a bit daunting. If you're not sure if you can do it, you might have to just erase everything else in flash until there's only the IOS left.

    Why would you do this? That seems like a lot of hassle for no real benefit.
  • Options
    SlowhandSlowhand Mod Posts: 5,161 Mod
    ColbyNA wrote: »
    Why would you do this? That seems like a lot of hassle for no real benefit.

    I did it when I bought a bunch of 1721 routers and needed to blow them away and put new IOS images on them. After the first time, it got to be like clockwork and it was easier than trying to blow away all the extra stuff that had been saved in flash. Of course, in my original advice, I forgot to mention that you don't necessarily need to reload the machine if you blow away the flash storage, (I'm running on way too little sleep today,) you can just grab the IOS image while the switch is still running and then reload, getting a fresh image and config.

    Free Microsoft Training: Microsoft Learn
    Free PowerShell Resources: Top PowerShell Blogs
    Free DevOps/Azure Resources: Visual Studio Dev Essentials

    Let it never be said that I didn't do the very least I could do.
  • Options
    ColbyGColbyG Member Posts: 1,264
    What kind of extra stuff? Deleting stuff from flash is a lot easier than messing with ROMMON.
  • Options
    Forsaken_GAForsaken_GA Member Posts: 4,024
    ColbyNA wrote: »
    Why would you do this? That seems like a lot of hassle for no real benefit.

    It's actually not that hard if you already have the t.f.t.p server configured. Then you just configure a vlan with an IP in the same range as the t.f.t.p server, put the interface you're hooked into in that vlan if it's not already, verify connectivity, format flash, copy the IOS from the t.f.t.p server. It's something that's very easily scripted, and when you're deploying switches in bulk, a wonderful time saver
  • Options
    ColbyGColbyG Member Posts: 1,264
    It's actually not that hard if you already have the t.f.t.p server configured. Then you just configure a vlan with an IP in the same range as the t.f.t.p server, put the interface you're hooked into in that vlan if it's not already, verify connectivity, format flash, copy the IOS from the t.f.t.p server. It's something that's very easily scripted, and when you're deploying switches in bulk, a wonderful time saver

    Sounds like you're talking about doing it all from IOS. He was talking about deleting everything and booting into ROMMOM to grab the IOS. Definitely not easy and time-saving.
  • Options
    BadFishBadFish Member Posts: 8 ■□□□□□□□□□
    Slowhand wrote: »
    Don't type "y" after the "Delete filename" line, just hit enter. Notice that it's asking you if you want to delete the file named "y" on the next line.

    Thank you, I will try that, Wow I never even noticed that when I was trying to delete the Vlan.dat file.
  • Options
    SlowhandSlowhand Mod Posts: 5,161 Mod
    ColbyNA wrote: »
    Sounds like you're talking about doing it all from IOS. He was talking about deleting everything and booting into ROMMOM to grab the IOS. Definitely not easy and time-saving.

    No one says you have to follow that suggestion. You can do it from the IOS, you can reboot and get it through ROMMON, but it's not exactly a requirement either way. Just do what works best for you.

    Free Microsoft Training: Microsoft Learn
    Free PowerShell Resources: Top PowerShell Blogs
    Free DevOps/Azure Resources: Visual Studio Dev Essentials

    Let it never be said that I didn't do the very least I could do.
  • Options
    ColbyGColbyG Member Posts: 1,264
    Slowhand wrote: »
    No one says you have to follow that suggestion. You can do it from the IOS, you can reboot and get it through ROMMON, but it's not exactly a requirement either way. Just do what works best for you.

    I realize this. I've loaded/reloaded IOS more times than I can count, and the few times I had to do it from ROMMON I hated it. I was simply wondering why anyone would choose to do it that way when I can't see any benefit.
  • Options
    mikej412mikej412 Member Posts: 10,086 ■■■■■■■■■■
    ColbyNA wrote: »
    the few times I had to do it from ROMMON I hated it. I was simply wondering why anyone would choose to do it that way when I can't see any benefit.
    It's a good idea to try it in a practice/lab environment in case you ever need to do it in a production environment.

    Plus since it sucks so bad, someone who had practiced it is probably less likely to do something stupid in a production environment that would require an IOS recovery via XMODEM/ROMMON.
    :mike: Cisco Certifications -- Collect the Entire Set!
  • Options
    ColbyGColbyG Member Posts: 1,264
    Yea, definitely. I can see doing it once or twice for practice. But doing it regularly is just masochistic.
  • Options
    Forsaken_GAForsaken_GA Member Posts: 4,024
    ColbyNA wrote: »
    Sounds like you're talking about doing it all from IOS. He was talking about deleting everything and booting into ROMMOM to grab the IOS. Definitely not easy and time-saving.

    Oh, ok, I didn't read the entire thing, yeah, I'm talking about IOS.

    But honestly, functionally, the ROMMON restore is pretty much the same. Assign an IP, tell it the servers IP, tell it the filename, and go, and I think the ROMMON restore may actually be faster in some cases.

    If you want time-consuming and masochistic, restore an IOS through xmodem sometime
  • Options
    ColbyGColbyG Member Posts: 1,264
    I guess it might be faster for some people in ROMMON, but not me. I hate tftpdnld. Even if the switch doesn't already have an IP, I can still do it all faster in IOS.

    And xmodem, how I loathe thee. I've used it more times than I care to mention. My issue was with 3640s in my lab. I've never paid much attention to system requirements with my lab stuff. I've bricked my 3640s more than a few times, and mine don't have tftpdnld (never updated the bootstrap code or whatever). The first time I used xmodem I didn't even think to increase the console speed, haha. Ugh.
  • Options
    Forsaken_GAForsaken_GA Member Posts: 4,024
    Well, I've always found ROMMON to be faster if the switch has AAA setup (as virtually every switch I touch these days does), so it ends up being a bit faster to just kick the switch into ROMMON and then copy and paste my commands in. I also prefer doing it through IOS when possible, but ROMMON doesn't bother me
  • Options
    BadFishBadFish Member Posts: 8 ■□□□□□□□□□
    Thanks guys, that was the issue. I was answering y to the question of which file name. Once I stopped doing that it worked just fine.
  • Options
    SlowhandSlowhand Mod Posts: 5,161 Mod
    BadFish wrote: »
    Thanks guys, that was the issue. I was answering y to the question of which file name. Once I stopped doing that it worked just fine.

    I'm glad you got it working. :D

    And, as for the prior discussion, I think we can certainly agree on one thing, no matter what preferences we have for restoring/configuring a switch or router: using XMODEM sucks. icon_lol.gif

    Free Microsoft Training: Microsoft Learn
    Free PowerShell Resources: Top PowerShell Blogs
    Free DevOps/Azure Resources: Visual Studio Dev Essentials

    Let it never be said that I didn't do the very least I could do.
  • Options
    ColbyGColbyG Member Posts: 1,264
    Well, I've always found ROMMON to be faster if the switch has AAA setup (as virtually every switch I touch these days does), so it ends up being a bit faster to just kick the switch into ROMMON and then copy and paste my commands in. I also prefer doing it through IOS when possible, but ROMMON doesn't bother me

    Forgive me, I think something in my brain isn't making an obvious connection, but why would AAA make it slower? You mean the time it takes to login, or what?

    And yea, xmodem is the devil... until you need it, haha.
  • Options
    SlowhandSlowhand Mod Posts: 5,161 Mod
    ColbyNA wrote: »
    And yea, xmodem is the devil... until you need it, haha.

    It's a necessary evil in our lives. . . like doing laundry, paying bills, and pants.

    Free Microsoft Training: Microsoft Learn
    Free PowerShell Resources: Top PowerShell Blogs
    Free DevOps/Azure Resources: Visual Studio Dev Essentials

    Let it never be said that I didn't do the very least I could do.
  • Options
    Forsaken_GAForsaken_GA Member Posts: 4,024
    ColbyNA wrote: »
    Forgive me, I think something in my brain isn't making an obvious connection, but why would AAA make it slower? You mean the time it takes to login, or what?

    Yeah, especially if you're configured for a Radius or TACACS server, the little delay where it figures out it can't talk to an auth server and falls back to the local authentication database just annoys me. That, combined with the time to boot, will generally make the ROMMON method faster
  • Options
    ColbyGColbyG Member Posts: 1,264
    Ah, at my current job we wr erase our stuff when we take it out of production, so that's never been an issue for me. I don't think the few seconds it takes for the auth server to time out would make ROMMON faster though.
  • Options
    KaminskyKaminsky Member Posts: 1,235
    Playing in flash, rommon, tf tp ios upgrading, xmodem etc, rather than just IOS configs is really good learner. Gives a lot of confidence you arn't going to break the da mn thing as well. Editing these files to change the variables too. Think you should be comfortable in these areas as you are in IOS personally.

    Saying that, going back to a 2503 rommon is just horrible and confusing.
    Kam.
  • Options
    mikej412mikej412 Member Posts: 10,086 ■■■■■■■■■■
    Kaminsky wrote: »
    going back to a 2503 rommon is just horrible and confusing.
    The 2500 had the RXBoot mode -- mini IOS in ROM. Boot into the existing config and copy new IOS from your t-ftp server. If your t-ftp isn't on the local network, add a default gateway.
    :mike: Cisco Certifications -- Collect the Entire Set!
Sign In or Register to comment.