We were always afraid of seamounts on submarines. There's absolutely nothing you can do.
This is something only submarines worry about. Most shallow places in the world are extensively charted. This is for ships entering and leaving who would prefer not to run aground. Since many smaller ships hug the coast, almost all coastal areas are charted to a pretty good degree. Small bodies of water like the Meditteranean (especially those of military interest) are extensively charted. This is essential for operations like anti-submarine warfare (knowing where the submarine can and can't be and how sound will travel). For years, collecting this data required oceanographic survey ships with very precise geolocation gear. Most ships were happy to know within a mile or two where they were when on the open ocean -- great for them, bad for charts. For areas of the world that aren't very exciting, this led to long gaps in coverage. We used charts that had data from the 1920s on several occasions.
Since GPS, this has changed. Theoretically, almost any ship can produce useful depth data. Most ships carry a fathometer which measures depth. This is very useful close to land such as on the continental shelf, since you will see a steady decrease in depth. If it doesn't match the chart, turn around until you can investigate (the normal situation is that you're not where you think you are). But the oceans are still a big place. Where the water is very deep, you may receive no warning -- just an underwater mountain lying in wait. Hawaii is like that -- the water depth is thousands of feet just 100 yards offshore. Fortunately, you can see Hawaii so its on all the maps. As are almost all areas 150 feet or less (threat to large surface ships). If a ship encountered one of those areas by surprise, it would likely stop, take some better measurements, perhaps roughly map it out, and report it to the government. Its a clear and present danger. But if the mountain ends 300 or 400 feet below the surface, taking a half hour for a rough mapping is an expensive luxury with little apparent benefit.
I've seen a seamount. I only remember once. The water suddenly went from 10,000 feet to 3,000 feet and went deep again just as fast. It was a curiosity to be reported but nothing more.
The law of large numbers (the Atlantic and Pacific oceans are very big places, with most travel on a few known routes) was in our favor until last weekend. Its hard to see what could have been done to prevent the USS San Francisco's grounding. They were lucky that they didn't lose the submarine. Though preparation, skill, and courage often make their own luck, as apparently occurred in this case. By all accounts, great credit should be given to the crew for saving their submarine and bringing it home.