The world's oldest known rock structure represents early chunks of the Earth's crust made when molten lava rose from cracks in the seafloor. Discovered in western Greenland, these formations have been dated to 3.8 billion years ago.
Similarly ancient formations have been identified in Canada and Australia. The earliest recorded minerals, from Western Australia, are 4,400-million-year-old zircon crystals, making them the Earth's oldest dated material.
The three main ways rocks are formed:
Sedimentary rocks are formed through the gradual accumulation of sediments: for example, sand on a beach or mud on a river bed. As the sediments are buried they get compacted as more and more material is deposited on top.
Eventually the sediments will become so dense that they would essentially form a rock. This process is known as lithification.
Igneous rocks are rocks which have crystallized from a melt or magma. The melt is made up of various components of pre-existing rocks which have been subjected to melting either at subduction zones or within the Earth's mantle. The melt is hot and so passes upward through cooler country rock.
As it moves, it cools and various rock types will form through a process known as fractional crystallization. Igneous rocks can be seen at mid ocean ridges, areas of island arc volcanism or in intra-plate hotspots.
Metamorphic rocks are rocks which once existed as igneous or sedimentary rocks but have been subjected to varying degrees of pressure and heat within the Earth's crust.
The processes involved will change the composition and fabric of the rock and their original nature is often hard to distinguish. Metamorphic rocks are typically found in areas of mountain building.