Place potatoes in a large saucepan and cover with cold water. Place on stove over medium-high heat. When water is boiling rapidly, turn off heat, cover pot, and let potatoes sit for 5 minutes. Carefully drain water and cool potatoes. You can refrigerate them, which will take a little while, or run them under cold water for 5-10 minutes (my preferred method).
Shred potatoes, set aside.
Heat large skillet over medium heat. Add chopped bacon. Cook for 2-3 minutes. Add onions. Cook until bacon is cooked and onions are browned, stirring occasionally, 5-6 minutes.
Add butter or margarine to skillet and let melt.
Add shredded potatoes and stir until onions and bacon are evenly distributed among the potatoes. Flatten with the back of the spatula and let sit until bottom is browned, 4-5 minutes.
Flip potatoes over. This does not need to be down perfectly. Cook another 4-5 minutes until potatoes are browned on both sides.
Add sour cream, cheese, and pepper. Stir until mixed. Flatten potatoes with spatula and cook a few minutes, until browned. Flip. Cook another few minutes. Serve warm.