Actually, in episode IV he gets blasted by a TIE fighter. It's possible that his memory was wiped, or at least partially so, during repairs after that incident.
There a a lot of reasons why R2 never told Luke. Primarily, Luke never asked R2 who his father was. Also, R2 never saw Anakin put the life support on. Last time R2 saw Anakin, he had just choked out Padme, then Obi-wan and Anakin started fighting. Also, noone ever called anakin Darth Vader directly in front of R2. There's a good chance that R2 didn't know. Just some things to think about.