Sauté onion in butter until soft, add flour and whisk for 2 minutes. Whisk in milk and cook until thick and bubbly. Remove from heat and add 1 cup of cheese, stirring until melted, season with salt and pepper.
Layer half of potatoes in a baking dish and sprinkle with salt and pepper. Cover with half of sauce.
Layer remaining potato slices on top of sauce and season. Top with remaining sauce and sprinkle with remaining 1/2 cup cheese.
Bake covered for 30 minutes or until potatoes are tender.