Adapted from Cook's Country Best Lost Suppers The link above gives information about this dish and an alternate way to make it.
4 lbs russet potatoes, scrubbed
2 tablespoons vegetable oil
1 lb white mushrooms, sliced thin
1 onion, minced
2 tablespoons all-purpose flour
11/2 cups whole milk
1 teaspoon minced fresh thyme
1/2 teaspoon pepper
11/2 cups shredded sharp cheddar cheese
8 tablespoons (1 stick) unsalted butter
1 pound ham (leftover or from a ham steak), cut into 2-inch matchsticks
1 cup sour cream
1 1/2 cups cornflakes crushed fine (measure after crushing)
1. Adjust oven rack to middle position and heat the oven to 350 degrees. Grease a 13 x 9 inch baking dish. Set aside.
2. Bring the potatoes and 4 quarts of water to a simmer in a large pot (use 6 quart pot) and cook until just shy of tender (a paring knife should glide through the flesh with slight resistance), 10-20 minutes, depending on the size of the potatoes. Drain the potatoes and set aside. When the potatoes are cool enough to handle, peel them and then grate the flesh lengthwise on the large holes of a box grater. Note: the potatoes will be kind of glue-like. (Also, you might be able to do this in a food processor fitted with a large-hole grater.) Return the grated potatoes to the pot.
3. Melt 2 tablespoon of butter and combine with crushed cornflakes. Set aside.
4. While the potatoes cook, heat the oil in a large skillet over medium heat until shimmering. Add the mushrooms and 3/4 teaspoon salt and cook until mushrooms have released their juices and are brown around the edges, 7-10 minutes (don't cook away all the liquid). Add the onion and cook, stirring occasionally, until softened, 5 to 7 minutes. Stir in the flour and cook for 1 minute.
5. Whisk in the milk, thyme, and pepper, bring to simmer, and cook, stirring frequently until thickened slightly, about 1 minutes. Stir in the cheese and 6 tablespoons of butter and cook until melted, about 1 minute.
6. Off the heat, stir in the ham and sour cream. Pour the mixture over the potatoes and toss to combine. Sprinkle the cornflake topping evenly over the top of potato mixture.
7. Place the baking dish on a foil-lined rimmed baking sheet and bake until potatoes are bubbling and the top is golden brown (mine didn't actually bubble), 25-35 minutes, but watch the topping so that it doesn't burn. Cool for 10 minutes before serving.