A century from Alviro Petersen saw South Africa close day one of the second test against England on 262 for 5.