NOTICE: I am not responsible for what happens to your tablet! Make sure you use the correct files for your tablet model. This has been successfully tested on my P3113. THIS WILL VOID YOUR WARRANTY AND IF ANYTHING GOES WRONG COULD BRICK YOUR TAB!!! Proceed at your own risk!
Prerequisites: Admin account on Linux computer and tablet charged to 80% or higher
1. Download and install Heimdall and Heimdall Frontend from http://glassechidna.com.au/heimdall/
2. Download 51-android.rules and 70-android.rules from Files to Root ***.zip at the bottom of this post. Make sure you use the correct file for your tablet model.
3. Copy the .rules files into /etc/udev/rules.d and set as executable. Reboot computer
4. Copy the ***.pit from Files to Root ***.zip at the bottom of this post to the directory of your choice. Again, make sure you use the correct file for your tablet model.
5. Download SuperSU zip and this TWRP file for P311X or this TWRP file for P3100 (click names for links.) This version of TWRP will be able to flash KitKat and Lollipop ROMs. Decompress the TWRP tar.md5 file to get a recovery.img file and copy the SuperSU zip to your tablet.
6. Enable USB Debugging on your tablet and reboot into download mode (power off then hold in power and volume down)
7. Open Heimdall Frontend (make sure you run as admin) and click utilities then detect device. It should say "Device Detected"
8. Go into the flash section. In pit section, select the previously downloaded p311x.pit file. DO NOT check repartition.
9. In partition files section, click "Add." Select RECOVERY from the dropdown and select the recovery.img that you decompressed from the tar.md5 file.
10. Double check everything to make sure it is correct. Check the "No Reboot" box and click "Start."
11. If everything went well, you should get to 100%. Wait 10 seconds and disconnect the tablet from the computer. Reboot into recovery by holding down power and volume up.
12. Select "Install" and navigate to the SuperSU zip file. Flash the file and then click "Wipe Cache/Dalvik." Once that is done, select "Back" and "Reboot System"
You have now rooted your Tab 2 P31XX! If you have any question or need screenshots for something, feel free to post in the thread.
If I missed anything, please let me know!