try sudo su. And sudo gainroot only works when your phone is in RD mode.
1. I installed the rootsh application on the N900