Peel, chop and fry onion in vegetable oil. Properly rinse the mushrooms, add to the onion and fry. Season with salt and pepper.
Peel, rinse, coarsely grate the potatoes, and then sprinkle with salt and pepper. Brush the baking pan with butter, and put a half of grated potatoes there.
Coarsely grate the cheese. Put the mushrooms onto the potatoes, coat them with 1-2 tbsp of sour cream and sprinkle with a half of grated cheese.
Put the second half of potatoes over cheese, then coat with the remaining sour cream and sprinkle with the second half of cheese. Heat oven to 180C.
Bake in oven until cooked through. Serve hot complimented with sour cream.