You know that 1/6 of the cake is left, so 5/6 of the cake was eaten. We can set up a proportion with the information given:
2:1/6
x:5/6
Cross multiply to solve:
(2)(5/6)=(1/6)x
10/6=1/6x
x=10
10 pieces were eaten, plus the 2 pieces that are still left.
10+2=12 total pieces of cake