Preheat the oven to 240°C/475°F/Gas 9. Season the lamb with freshly ground pepper and roast in a medium roasting tray in the preheated oven for 15 minutes. Lower the heat to 180°C/350°F/Gas 4. Remove the lamb from the tray and pour off the excess fat.
While the lamb is roasting, heat the oil in a pan, add the onions and cover and cook for 5 minutes till soft. Remove the cover from the pan, add the garlic and rosemary and cook for a further 5 minutes. Remove the onions from the pan.
Lay a layer of potatoes into the roasting tray and lightly season with black pepper. Lay 1/3 of the cooked onions onto the potatoes, repeat this process until you have three or four layers of potatoes and onions.
Bring the lamb stock to the boil and pour over the potatoes, press down with a spoon till the potatoes are all submerged.
Place the lamb on top and return to the preheated oven and continue to cook for 3 hours.
The lamb should be meltingly tender and the potatoes and onions should have absorbed the stock and lamb juices.