I have looked through a lot of posts on here, but cannot find any specific answer for this question.
Now, it's been pretty fairly established that due to having his memory wiped, C-3PO would not recognize Anakin/Darth Vader. However, it seems that R2D2 either never had his memory wiped - which explains his quirky behavior - or only had certain parts reprogrammed.
Does R2-D2 know that Anakin is Vader, either from scanning him or simply because he's been told? It seems that if anyone aside from Obi Wan would know him, it would be him.