Don't know what percentage of hull volume of an inert gas you'd need to purge the oxygen and snuff a fire, but wouldn't the nitrogen, a staple of our atmosphere, be sufficient as a fire suppressant?
It would if it's stored separately for such a purpose. I don't know how an air recycling system would work engineering-wise. If room air was simply drawn in and processed - the CO2 and other undesired content filtered out and O2 added - then you wouldn't have separate nitrogen available for fire fighting.
Fire consumes oxygen pretty quickly. Certainly the most immediate strategy would be to shut down air flow and seal the affected section. In the case of a small isolated fire, that leaves the occupants time to get out. In the case of a large-scale fire, that deprives the fire of fresh oxygen - to the detriment of occupants, but it's easier to rescue and revive unconscious occupants (if you're fast) then to treat large-scale 3rd-degree burns. That's adequate for most fires.
The partitions in ships would likely be fire-rated. "Fire-rated" means that the partition walls, doors, floor and the ceiling would be designed to resist fire and to remain air-tight, preventing transmission of smoke to adjacent areas. It's easier to make something air-tight than to make it vacuum-resistant: it doesn't have to resist pressure differentials, it just has to prevent the transmission of smoke and flame. If it does that well, then the fire can be contained to one room. This is pretty much a must, or a fire in the kitchen could suffocate everyone in the section. "Fire-rated" in the modern world usually calculated in terms of how long a given wall type will resist intense fire, with more resistant walls required for rooms more likely to suffer intense fires.
Note that fire-rated doors do not have to be perfectly airtight. If they stop, say, 95% of airflow, that will still significantly suppress the rate at which fire can burn, allowing responders time to react and occupants in adjacent rooms time to evacuate. Thus you'll have a door (probably a sliding door in this context) that sits reasonably tightly within its frame, but it doesn't have to make a perfect seal. It WILL have to have some sort of automatic system for closing in the event the fire alarms trigger - not locking, but closing, so that folk aren't trapped but a door that's left open by some fleeing soul does not become an invitation for the fire to spread.
In areas most likely to suffer large-scale fires - the kitchen, for example - the room would likely have its own nitrogen purge equipment, and it'll be placed close to the most likely ignition points so that the fire is smothered off or at least partially supressed as quickly as possible while giving people time to evacuate the room. In a modern commercial kitchen, that equipment is located directly over the stovetops, designed to sent down jets of gas that push oxygen away from the fire at rates calculated not to splash oils in pans and such.
This brings a point of tech. Ships are not typically constructed with airlocks between internal compartments; warships maybe, but not civilians, at least not from the published deckplans. To access a compartment without allowing too much oxygen in - something which can cause a fire to flash up suddenly, injuring rescuers - a ship could use heavy fire-resistant floor-to-ceiling curtains, stowed in the walls or ceiling a couple or three feet back from an iris port or hatch and deployed when needed. This would create an "air-lock" effect so long as pressure between the two compartments was fairly equal. One item of emergency equipment might be a curtain with magnetic edges that could be slapped over a partition door so that rescuers could likewise enter an affected room without admitting too much air from the hall.