Castle Rock is a volcanic plug in the middle of Edinburgh upon which Edinburgh Castle sits. The rock is estimated to have formed some 350 million years ago during the early Carboniferous period. It is the remains of a volcanic pipe which cut through the surrounding sedimentary rock, before cooling to form very hard dolerite, a coarser-grained equivalent of basalt. Subsequent glacial erosion was resisted more by the dolerite, which protected the softer rock to the east, leaving a crag and tail formation.
The summit of the castle rock is 130m above sea level, with rocky cliffs to the south, west and north, rearing up to 80m from the surrounding landscape. This means that the only readily accessible route to the castle lies to the east, where the ridge slopes more gently. The defensive advantage of such a site is clear, but the geology of the rock also presents difficulties, since basalt is an extremely poor aquifer. Providing water to the Upper Ward of the castle was problematic, and despite the sinking of a 28m deep well, the water supply often ran out during drought or siege, for example during the Lang Siege of 1573.