Preheat oven to 480F. Oil the pan (a 20 inch diameter was used for this recipe). Leave in the oven to warm up.
Peel onions and potatoes, then grate together. Squeeze the mixture in batches to release as much starch as possible. Add salt, pepper, flour and water. Stir vigorously until integrated. Transfer to the hot pan and even out on all sides.
Bake for 30-35 minutes, turning the pan around every 15 minutes.
Take the pie out and spread melted butter over it. Leave to cool for a few minutes. Meanwhile, mix sour cream and garlic until smooth.
Break the pie apart into smaller pieces, and layer into a serving bowl. Top with sour cream and garlic.
The water/flour formula is such that if there is too much water you add a little more flour. If there is too much flour you add a little more water. Go slowly and you'll find the right thickness.