Heat the oven to 375°F and butter a 9-by-13-inch baking dish with 1 teaspoon of the butter.
Melt the remaining butter in a saucepan over medium heat, whisk in the flour and cook for 1 minute.
Whisk in the milk gradually, then add the mustard, salt and pepper and simmer for 4 to 5 minutes, until the sauce coats a spoon.
Layer half the potatoes, onion and ham in the dish, pour over half the sauce, and repeat the layers.
Cover the dish tightly with foil and bake for 60 minutes.
Uncover and bake for 20 to 30 minutes more, until browned at the edges and a knife slips easily through the center potatoes.
Rest for 15 minutes so the sauce settles before cutting into the casserole.