After a crash inspection program, federal regulators said Thursday that they had found numerous unsafe practices at about 30 compounding pharmacies, the same type of facility responsible for the tainted drug that caused a deadly meningitis outbreak last year.

Among the problems found were unidentified black particles floating in vials of supposedly sterile medicines, rust and mold in clean rooms where such drugs are made, improper air flow, and clothing that left workers’ skin exposed.

Howard Sklamberg, director of the office of compliance for the drug division of the Food and Drug Administration, said such unsafe practices could cause contamination of drugs. He said the number of problems found at the compounding pharmacies, which were in 18 states, was higher than what is typically seen at conventional pharmaceutical manufacturers.

F.D.A. officials also said the agency had to get a warrant from federal court to inspect one of the 30 compounding pharmacies. Four other operations resisted being inspected but gave in without a court order, agency officials said.