Richland, Penn. • I’m great at feeding people, but I’ve never mastered portion control. I joke that it’s inherited, that I always make too much because written in my genome is the fear that there won’t be enough to go around. That’s never happened; I’ve always had the luxury of a full shopping cart.

Or rather, I did until mid-March, when I encountered empty supermarket shelves, just days after the World Health Organization declared the coronavirus a pandemic. The sight of those picked-over produce displays flooded me with visions of my nanny, who always made too much food, and who counted wealth in jars of pickled vegetables and preserved fruit, an ever-renewing stockpile that meant everything might go to hell, but at least we could eat.

Her name was Irene, and all those jokes about Italian grandmothers who want you to eat, eat, eat were written about her. In the hospital, in the last month of her life, I sat holding her hand while, in a rasp, she invited the young doctor who’d just inserted her chest tube to dinner. He was polite, laughing off the loopy, half-anesthetized old woman with a comment about his busy resident’s schedule, and she grabbed his wrist. I spoke for her, explaining that it was more command than invitation, really: She’d remember, and if he didn’t come, she’d die a tiny bit offended.

As most grandchildren do, I tended to see my grandmother as a relic of another time. We joked about her penny pinching, her reuse of plastic storage bags, her reluctance to throw away dinner scraps that could just as soon be made into soup. In her obituary, I wrote that she was “very territorial over her Tupperware.” But she knew what it meant to be without, and I think she just wanted to be prepared.

She’d lived through war years and lean times, a child of the Depression, raised in Camden, N.J. by Italian immigrant parents with 10 mouths to feed. Irene once told me that mussels reminded her of adolescence, when they were hauled, bushel after bushel, from the Delaware River, plentiful and cheap enough to feed her swarm of siblings.

She and her family worked on farms then, two dozen hands making a living picking whatever was in season and filling their bellies with the surplus. For as long as she lived she was a grower, with a greenhouse full of flowers to sell and a garden of good things to eat. Tomato plants always seemed eager to please her, straining with juicy, vermilion fruit. I swore the mint followed her around, springing up wherever she stood.

Every summer, Irene would summon my cousins and me to her kitchen in New Jersey to help her put up bushels of sweet, white South Jersey corn and pint after pint of blueberries. We canned peaches and pepper jelly, pickled cucumbers and eggplants, and ladled tomato sauce into jars until our wrists seized up. We’d cart everything into the cellar, where the long chest freezer hummed, and fill the floor-to-ceiling shelves with a colorful bounty of preserves that promised no one would ever leave her table hungry.

My cousin Christina bought the house after Irene died. Last year, she called to say she was using the final jar of tomato sauce, making chicken parmigiana for her sons. After we hung up, I cried for the loss of something a season of growth would not replace.

The day my supermarket ran out of romaine lettuce, I bought a 6-foot-by-8-foot plexiglass greenhouse. It took three days to clear the overgrowth and turn over the soil and heavy clay in my yard. I grated my arms to the elbow as I pruned thorny wild raspberries, and encouraged new growth that will produce fruit with abandon.

I covered my kitchen table with germinating seeds and infant plants: cabbages, cauliflower, snap peas, bush beans. In tiny plastic pots I sprouted three kinds of mint, golden sage and purple basil, and began to make plans. After Mother’s Day, I’ll put tomato plants in the ground. When the beans get leggy, I’ll give them a trellis to climb. I counted out my Mason jars, and wrote down every preserve and pickle recipe I could remember. In short order, I’ll be putting things up in my own pantry.

With every step, my anxiety dissipated, and I felt more prepared, and full of purpose. Every seed I pressed into the soil felt like an investment in a secure future. The coming weeks and months still loom with uncertainty and alarm, but however the world is fundamentally changed on the other side, I’ll have jars of roasted peppers, raspberry jelly and enough tomato sauce to share.

Months ago, while reporting a story about migrating bison in Yellowstone National Park, I spoke to a biologist who told me bison and people are the same. “We’re not like butterflies, or salmon, born with a map in our heads,” he said. “Mammals like us, we learn from our mothers, who learned from their mothers, all the way back.”

That’s ancestral memory, he explained, and it helps us survive. This is the secret my grandmother knew, that survival can be stored in a jar. Now, I’ll use it to busy my hands, ease my mind, preserve my memories and prepare for whatever comes next.

Kate Morgan is a journalist who writes about science and food.