[Galaxy Note 4 Q&A, Help & Troubleshooting] ekeppel:
This is an old post, but I'm adding a solution that worked for me in case anyone else happens to need help in the future.

TL;DR: Restoring a TWRP backup to a different phone / motherboard than the backup was created on breaks the fingerprint sensor and causes systemwide lag. Restoring the EFS partition causes the problem, so to avoid it, just don't restore that partition to the new phone. If you already have and face this issue, rebuilding the EFS using root terminal commands (see below) and removing and old fingerprint security data will restore functionality and stop the lag.

I encountered similar issues when I lost the emmc on my Verizon Note 4 SM-N910V (Retail Edition, but Rooted / Bootloader Unlocked). I first attempted to replace the motherboard, which went well, but when I restored my TWRP backup made using the old motherboard to the new motherboard I ended up with terrible lag throughout the system, keyboard lag, scroll lag in the browser, etc.

In addition, my fingerprint sensor wouldn't work either. Under the hidden menu *#0#* diagnostics, it showed the fingerprint sensor version: null, and trying to open the fingerprint settings gave me the message: "An error has occurred with the fingerprint sensor. If this message appears repeatedly, restart your device." Of course rebooting did not fix the problem.

Assuming that I had bought a bad replacement motherboard, I purchased a second one, and had the same problem. Finally I gave up and bought another Note 4 on eBay. Guess what, when I restored my TWRP backup that new phone started showing the exact same symptoms! :(

After searching for answers to both the awful lag I was experiencing along with the fingerprint sensor issue, I began to think that the two were related. I tried many fixes, but none of them worked for me. Finally I decided to look into EFS corruption fixes and came across this post from J0eggernaut: https://xdaforums.com/showpost.php?p=67174836&postcount=2

I found that I didn't need to do everything outlined there so this is what I came up with. Hopefully it will help someone else:

1) Backup your current EFS just to be safe and have something to come back to in case something goes wrong. Search on XDA for various ways to do this. You can also just back it up in TWRP, which is what I did.

2) Take the phone out of factory mode. You need root access and root browser. Go to the EFS which is found at :

/efs/factoryapp/factorymode and edit the file in a text editor. Change the text from ON to OFF, then save it. Also go to /efs/factoryapp/keystry and do the same thing, setting it to OFF.

3) Reboot the phone

4) Using a root terminal (either an app, adb over USB, or the one in TWRP recovery) issue these commands:

mke2fs /dev/block/mmcblk0p13

mkdir /efs

mount -t ext4 /dev/block/mmcblk0p13 /efs

Note that this works on the N910G and N910V (Verizon). It probably works on other versions of the N910V as well, but do this at your own risk.

5) Finally, do a factory reset and then reboot

You should have your fingerprint sensor back along at this point, along with a lag-free system.

6) Reboot to TWRP recovery and restore your backup again, but only check 'System' and 'Data', leave all of the others unchecked, *especially EFS!* :)

7) Reboot and you should be back up and running.

8) Go into Settings > Fingerprint, and check to make sure that the sensor is working. If it is and you can add fingerprints, you're done. If not, continue to step 9...

In my case, I had changed out my motherboard, and it had been used previously, so there was fingerprint data already on it and I couldn't get in to remove it. Some searching led me to this post by Zacharee1: https://xdaforums.com/note-4-verizon/general/guide-reset-lock-fingerprint-data-cm13-t3378972 that got me headed in the right direction.

9) Using a root browser or root terminal, delete these two files if they exist:

/data/validity/template.db

/data/system/users/0/settings_fingerprint.xml

I also deleted the following files to be sure I got everything:

/data/system/locksettings.db

/data/system/locksettings.db-wal

/data/system/locksettings.db-shm

10) Reboot and enjoy the fruits of your labor :)

11) After you're satisfied that everything is working well, be sure to make a full TWRP backup. Be sure to include the EFS partition!

Well, that should do it. I was able to fix both my original phone with the new motherboard *and* the replacement phone that I borked as well using the above steps. Hopefully this proves useful to someone. If you find a method that is easier or that works better please let me know so that I can update this post.

:good: