Messi, who had done likewise in the 4-0 first leg win after coming off the bench in the Nou Camp, got both goals as he showed he is fully recovered from the hamstring injury which had kept him out for two months.
But there was some bad news for Barcelona as midfielder Neymar suffered a right ankle tendon injury.
Messi fired just wide as Barcelona carved out the first chance in the fourth minute.
But Getafe should have taken the lead when Juan Rodriguez volleyed straight at Juan Manuel Pinto, who blocked his close-range effort.
Neymar appeared to hurt his right ankle when he attempted to cross the ball in the 23rd minute and had to be replaced by Alexis Sanchez.
Messi broke the deadlock shortly before half-time, marking his first start since his return from injury with a goal in the 44th minute as he got a touch to Cristian Tello's cross to divert the ball in.
Messi added his second just after the hour when he ran through the Getafe defence before slotting home from an acute angle.
He was denied a hat-trick when he tricked his way through again but saw his close-range shot saved by Jordi Codina with an outstretched leg which sent the ball over the bar.
Real Sociedad also reached the quarter-finals with a goal from Javier Ros as they won 1-0 away to Villarreal.
After the first leg had finished 0-0, Sociedad went through 1-0 on aggregate as Villarreal's Jeremy Perbet missed a late penalty.