Subway trains started rolling just days after superstorm Sandy, even though the historic storm inundated all seven subway tunnels under the East River. If not for the hyped threat of Hurricane Irene the year before, which forced the agency into storm prep mode, Sandy could have been much worse for the region’s transit system.

“We had done a couple of table top exercises, in anticipation for Irene and what would happen if it didn’t move off the coast. But what we had prepared for turned out to be Sandy,” said Chairman Joseph Lhota, who was also leading the agency during the 2012 storm. “So we had a road map as to how to deal with that kind of storm already. We were lucky in that regard.

“We knew it was going to be bad, and because we started the preparedness early ... the MTA was ready to do what it needed to do. We started planning much in advance.”

On the Thursday before the storm, the MTA began to buckle down. At 7 p.m., Sunday, Oct. 28, the day before Sandy hit, the agency ordered the start of a system-wide shutdown of the subway, with all service ceasing by 3 a.m. Trains and buses had to be moved to higher ground to avoid damage.

“New Jersey Transit lost a lot of locomotives because they didn’t put their rolling stock onto high ground,” Lhota said. “We sealed as much as we possibly could, and at the same time we wanted to get the rolling stock up to higher ground in the event of a surge of water.

“At the LIRR there were all kinds of preparations,” he continued. “The wind was projected to be 70 miles per hour and at 70 mph those wooden crossing gates will snap. So we took them off or tied them down and when you do that, service is obviously out at that point.”

Lhota spent the day of the storm moving between midtown and downtown. He visited a soon-to-be inundated South Ferry station with then-president of New York City Transit Tom Prendergast at around 7:30 p.m, then bumped into Gov. Andrew Cuomo near the pitch-black Hugh L. Carey Tunnel.

“I wanted to go over to the Brooklyn Battery Tunnel, because we [had] gotten word from Bridge and Tunnel police that the tunnel was being flooded,” Lohta said. “The water coming in was just extraordinary. At this point the power [had] gone out, there were no lights and it was very dark.”

Cuomo asked how the MTA planned to get the water out of the tunnel. Lhota didn’t let on that he, the chairman of the MTA, wasn’t really sure.

“I told him we’d get the water out,” he said, “Don’t ask me how — at the time I didn’t know; I just said that.”

Lhota returned to headquarters at 347 Madison Ave. to field late-night updates before going to sleep at 3 a.m. He stayed in midtown and woke up four hours later.

“That’s when we were able to assess the damage,” Lhota said. “We had preexisting conference calls. I’m not exactly sure when — maybe 7:30 a.m. Maybe 7 a.m. We had three calls a day with all operating heads so that everybody heard what everybody else said on where the subways were, where we stood with the railroads and the bridges and tunnels.”

By Saturday, Nov. 3, six days after the storm hit, 80 percent of the subway system was back in operation, including the East River’s Joralemon Tunnel, which serves the 4 and 5 trains. The MTA published subway maps in the days following the storm to track progress and keep riders informed.

“The communications parts of this were extremely important,” Lhota said. “We did special Sandy storm maps that showed what lines came back and more importantly what stations were open and what stations were closed. The map would be changed as soon as it changed at the station. One day we had six different maps.

“I’d like to get those maps we had and collect them all to make a poster,” Lhota said. “But I think they’re gone by now.”