The tree of terrestrial life probably roots in non-photosynthetic microbes. Chemoautotrophs were the first primary producers, and the globally dominant niches in terms of primary productivity were determined by availability of carbon dioxide and hydrogen for methanogenesis and sulfite reduction. Methanogen niches were most abundant where CO2-rich ocean water flowed through serpentinite. Black smoker vents from basalt supplied comparable amount of H2. Hydrogen from arc volcanoes supported a significant methanogenic niche at the Earth's surface. SO2 from arc volcanoes reacted with organic matter and hydrogen, providing a significant surface niche. Methane ascended to the upper atmosphere where photolysis produced C-rich haze and CO, and H escaped into space. The CO and C-rich haze supported secondary surface niches. None of these ecologies were bountiful; less than 1% of the CO2 vented by ridge axes, arcs, and metamorphism became organic matter before it was buried in carbonate. In contrast, a photosynthetic biosphere leaves copious amounts of organic carbon, locally concentrated in sediments. Black shales are a classic geologic biosignature for photosynthesis that can survive subduction and high-grade metamorphism.