Ideally you want an “external” microSD card for this.
This also assumes you have already filled out the LG form and received the unlock.bin file. If not, retrieve it from LG using the tricks in this thread.
You also will want the twrp-3.1.1-0-h930.img image or the US998 TWRP unofficial alpha based on it. (They're the same except for a properties file change.)
And you need the Android development tools installed. I'm assuming you've done that.
1. Back up everything. It’s all going away.
2. If running Android Studio or Helium Desktop, shut it down. Otherwise you may see adb version issues.
a. Side-note: Don’t trust Helium to let you restore your data. Look for “Helium ceases to recognize backups” at https://github.com/koush/support-wiki/wiki/Helium-Wiki - It’s simply the wrong tool for this job.
3. Before you begin, copy the following files to your External SD Card. Otherwise you’ll have to do it later or attempt an adb sideload:
4. Ensure you’re in developer mode. If Settings doesn’t have Developer Options, go to Settings – About Phone – Software Info, click Build number 7 times.
5. As per the LG page, http://developer.lge.com/resource/mobile/RetrieveBootloader.dev , ensure Developer Options “OEM Unlock” and “USB Debugging” are enabled.
6. Connect to USB and switch to Photo Transfer Mode. (If you’re a normal user, you probably default to USB. You need Photo.)
7. On your PC, copy the unlock.bin file LG emailed you into your Android development tools directory (in my screenshots, sdk\platform-tools), and run:
to ensure the device (and only the device) is listed. If it’s not listed, verify that Photo Transfer mode.
8. Reboot phone into Fastboot mode
adb reboot bootloader
You should hear the Windows sounds of USB devices going and coming. And the phone has an odd screen.
9. From the same directory (Android tools),
fastboot flash unlock unlock.bin
This takes only a few seconds to run.
10. Reboot with:
You will get entirely different start-up screens than normal. Including a warning that your device cannot be checked for corruption. (and a reference to http://g.co/ABH)
Your phone has now been hard reset.
11. Go through the initial phone setup options, to get to Android. Switch USB to Photo Transfer again.
12. You can verify that it’s unlocked either from the Developer Options – OEM Unlock is no longer available because it’s already unlocked, or by:
1. Switch back to developer mode, USB debugging. (OEM Unlock is now not selectable, because it's on permanently.)
2. Switch USB to Photo again; default is charging.
3. As before, on your PC from the Android tools directory,
adb reboot bootloader
4. Fastboot flash recovery twrp-3.1.1-0-h930.img
5. This part is tricky… read the whole thing before starting.
a. Turn OFF the phone, using the volume key to change from Restart at the top to “Power off”.6. Back up the system. This isn’t essential, but you’d be silly not to.
b. Disconnect the USB cable
c. Holding both the Volume-Down and Power button, turn phone on.
d. As soon as the LG logo appears, continue pressing “Down” but release and re-press Power. Continue holding both until a menu appears.
e. Select to erase all data. You will be asked this several times; keep saying “Yes”.
f. Eventually you will boot into TWRP.
a. In TWRP, set system writable7. Turn off data encryption and install stuff… all in TWRP:
b. Select “back up”. Note there’s no data, because that partition is encrypted.
c. Select the SD card (or USB; I use a micro SD card.)
d. Back it up. This will take around seven minutes.
a. Wipe Data – Factory ResetIf booting fails with an encryption error, did you format (b above) the partition? If not, reinstall TWRP (except you don't need to backup again) and do both the wipe and format.
b. Wipe Data – Format Partition
c. Install – set storage to the External SD
d. Install the Magisk zip
e. Install the no-verity-opt-encrypt-6.0.zip
f. Install the LG-rctd-disabler-1.0.zip; this reduces LG root checks, which may impede performance.
g. Reboot – to System
You will now have to set up the phone again, but should have root (via Magisk.)