Gary's post has helpful advice. Many years ago I checked with a couple of surveyors and a firefighter when upgrading our 34 footer. We have two 2.5" smaller extinguishers, one in a bracket under a seat hatch in the cockpit, and one mounted low on a bulkhead in the head compartment. One 5# in the forepeak sleeping area, and one 5# in the aft cabin, reachable from the galley area. The idea is avoid being trapped in any area by smoke or flames, and having an opportunity to "fight your way out" and/or attack the fire.
Our boat also has the OEM Halon automatic discharge system in the engine compartment and the lighted indicator to show if that bottle has been activated. We have kept this system certified; nowadays they withdraw the halon, weigh it, and refill the extinguisher... and tag it again... and charge me several $.
Like having multiple ways to dewater a boat, you should have ample means to fight a fire.
My spouse and I have both taken a half day fire education and active extinguisher practice session at a local (airport) training facility. This was arranged for group up to 25 or 30 at a time, by our YC. Everyone (!) got to correctly attack and extinguish a live (propane fueled) fire with a dry powder extinguisher. Nervous Fun, it was....
(Really makes you aware of how vulnerable you would be on board a boat with a... fire.)
FWIW, we have found that local fire fighters are eager to train the boating public and help to keep them safe; they much prefer training boaters over having to try to save them.
One other thing to reiterate again, as the saying goes: you will be amazed at how short a time the contents of an extinguisher will last! After that demo, you will no longer be content with having only the minimum number of them on board!
Back to the question: we have teak (ply) bulkheads, about a half inch thick. I drill a screw hole for a thru attachment, and add a small piece of trim on the other side to cover the nut, or put an ss crown nut on an ss washer to dress up the fastening.