yashsingh1/xdaforums huggingface dataset:
[LG G6 ROMs, Kernels, Recoveries, & Other Developme] DonS:
I flashed from fastboot instead of TWRP and I get the same thing. I get prompted for a password to decrypt data. I flashed the old 3.1.1 TWRP and I don't get that error. If I go into backup with TWRP 3.2.1 data shows 0 MB. With 3.1.1 it shows the actual size.

I rebooted to the system and connected a USB cable and went into a ADB shell. the first command returns an error. I thought your first command had a typo and you mean unmount instead of umount. I'll paste the error below.

C:\ADB>adb shell

lucye:/ $ umount /dev/block/sda19

umount /dev/block/sda19

umount: bad /etc/fstab: No such file or directory

1|lucye:/ $ unmount /dev/block/sda19

unmount /dev/block/sda19

/system/bin/sh: unmount: not found

127|lucye:/ $
[LG G6 ROMs, Kernels, Recoveries, & Other Developme] zefie:
The error is because it's not mounted at all (since it sees 0 MB), so just skip to the second command.
[LG G6 ROMs, Kernels, Recoveries, & Other Developme] DonS:
Here is what I get when running the second command:

C:\ADB>adb shell

lucye:/ $ e2fsck -f /dev/block/sda19

e2fsck -f /dev/block/sda19

/system/bin/sh: e2fsck: can't execute: Permission denied

126|lucye:/ $

I have gone back to TWRP 3.1.1 and in the backup screen it does show the proper size for the data volume.
[LG G6 ROMs, Kernels, Recoveries, & Other Developme] zefie:
Run it in either TWRP, not under Android.
[LG G6 ROMs, Kernels, Recoveries, & Other Developme] DonS:
OK, here are the results from TWRP 3.1.1 terminal

umount /dev/block/sda19 returns an error

umount: can't umount /dev/block/sda19: invalid argument

e2fsck -f /dev/block/sda19 returns an error:

/dev/block/sda19 is in use.

e2fsck: cannot continue, aborting.
[LG G6 ROMs, Kernels, Recoveries, & Other Developme] zefie:
Invalid argument should not happen. Personally I'd make a back and reformat data. You say everything works but it's only a matter of time before the corruption catches you off guard. You could try the two commands on my TWRP, but if it's still saying invalid argument, back up and reformat. (With yes screen format option not just wipe data)
[LG G6 ROMs, Kernels, Recoveries, & Other Developme] MacLaughlin:
Thank you so much for your work. It is the only version which is working on mine.
[LG G6 ROMs, Kernels, Recoveries, & Other Developme] saenta:
[MENTION=759634]zefie[/MENTION] is it somehow possible to convert ext4 to f2fs without loosing data?

Thanks for your strike work! [emoji4]

Gesendet von meinem LG-H870 mit Tapatalk
[LG G6 ROMs, Kernels, Recoveries, & Other Developme] zefie:
Not conventionally. You could let TWRP back up sd-ext while ext4, and reformat it f2fs, but if you try to restore it in the TWRP GUI I think it'll format it back to the original format. That said, you could then manually extract the twrp backup files (they are just tar files, so something like tar -C /sd-ext -xf /path/to/sd-ext.ext4.win000 or whatever.) Extract them in numerical order.

If you are talking about built-in partitions like /data or /cache, don't do it, as ROMs have to be configured specifically to support f2fs, so it wouldn't work anyway.
[LG G6 ROMs, Kernels, Recoveries, & Other Developme] zefie:
bump for rel3

New Features:

Updated and Integrated Melina Kernel (rel7) into TWRP build system

Option to wipe LG lockscreen security settings when restoring data partition (workaround for known issue where sometimes you get locked out)
[LG G6 ROMs, Kernels, Recoveries, & Other Developme] the-extreme:
Hi,

Could anyone tell my why the "Smart Lock" option is missing after the restore of an backup?

Tried different things in security settings (pin/knock/pattern) but the option is completely missing......

I did check the option to wipe LG Lockscreen security settings because i couldn't get into the restored backup.

Thanks in advance!
[LG G6 ROMs, Kernels, Recoveries, & Other Developme] zefie:
The "Wipe LG Lockscreen" option is there when restoring data, because if you do not use it, the lock code gets changed to something we don't know, and you will not be able to unlock the device.

When we wipe the LG Lockscreen, we delete 3 files which should let you in with just a Swipe to Unlock.

From there, you should be able to go back into settings and set your lock screen back up.

You say an entire option is missing after restore. Try rebooting after setting up the lock screen again in the Security Settings.
[LG G6 ROMs, Kernels, Recoveries, & Other Developme] the-extreme:
Okay, first thing is clear as a whissle.......

I thought it would be something like that, just wanted to be sure i did'nt do anything "foolish" :D

But i realy did'nt have the "Smart Lock" option in the security settings.

Did a full reboot, tried different settings but the option still was'nt there.

I did a fresh install and now it's back......

I don't know what, but something went wrong :(

Nevertheless, thanks for your answer Zefie!
[LG G6 ROMs, Kernels, Recoveries, & Other Developme] xmxm:
o2 still causing issues for me. Uncompressed backup/restore seems to be working fine. Compressed ones were hanging on backup in o1 and now hanging on restores in o2. I've tried multiple different backups - all compressed ones now hang at restore around 1550MB mark. I even tried 2 different microSD cards to rule out that aspect.

Anything that I can do to get logs/troubleshoot it?
[LG G6 ROMs, Kernels, Recoveries, & Other Developme] basicreece:
Can someone clear this up for me please, im on Oreo with TWRP 3.1.1. I used to use this TWRP version as its tons better!

If im to flash Zelfie version will I need to format/wipe my device?

Confused as previously I just flash the newest recovery and im all set. But the OP states different?!
[LG G6 ROMs, Kernels, Recoveries, & Other Developme] micgeb:
No
[LG G6 ROMs, Kernels, Recoveries, & Other Developme] ZinX09:
I'm a bit tired of the lg stock experience so I am going to try RR but is the Melina recovery compatible with RR, or does it not matter.

Thank you in advance.
[LG G6 ROMs, Kernels, Recoveries, & Other Developme] Tool Belt:
As long as you have an unlocked US997 or H870, follow the instructions in that and this thread go ahead and prosper. I am finding rooted O to be fine.
[LG G6 ROMs, Kernels, Recoveries, & Other Developme] ZinX09:
Ok thanks, gonna try this tomorrow.
[LG G6 ROMs, Kernels, Recoveries, & Other Developme] zefie:
There seems to be an issue with the tar command in v3.2.1 upstream.

Use non-melina 3.1.1 for backups now I guess.
[LG G6 ROMs, Kernels, Recoveries, & Other Developme] zefie:
So I have been looking into why tar is so unstable in my TWRP. Melina kernel is not the cause, because I spliced Melina kernel into the famous 3.1.1 TWRP image and tar worked fine.

However, even running tar on the cli with Melina TWRP 3.2.1, I had it exit with errors. Compressed and even uncompressed, it seems it crashes at a certain point in the file, specifically after a large number of files (about 17000 for me).

I am build rel_o3 soon but I do not honestly think it will fix the issue. I believe the issue is the busybox binary, as even TeamWin has had issues. We have been using the busybox they updated to already tho.

However other changes were synced from upstream, so we'll have to see. Stay tuned.
[LG G6 ROMs, Kernels, Recoveries, & Other Developme] zefie:
Update:

(warning: barely awake ramble typing again)

I have been looking into this alot and, I really don't know why the hell its doing it, but I traced the tar restore problem back to Melina Kernel itself.

Why? I have no idea, but after further attempts, I found there is a built-in tar system for TWRP, but also tried switching from Busybox tar to Toybox tar, and even compling a static build of gnu tar. Nothing helped because there seems to be something going on at the kernel level. To confirm this, I tried the spliced Melina 3.1.1 (which wasn't actually Melina kernel when I thought I tried it the first time, I flashed the unmodified image on accident during that test), and sadly, yes, it failed to restore.

Creating backups with all current versions of Melina TWRP seems alright, but restoring will not work until I pinpoint this issue. You should be able to restore on an unmodified 3.1.1 for now.

Obviously I am not happy about this. I do not understand why Melina works flawlessly in the OS, but not in TWRP. Since Melina is based on the LGE kernel (and the kernel in 3.1.1 is the LineageOS-hacked kernel), I feel there is something in the LGE kernel that either 1) is fighting TWRP (not likely) or 2) is misconfigured (most likely).

I have been busy IRL but I will look into this more when I get a chance and will definitely figure out a way to make it work, even if we have to remove Melina kernel (tho that kinda messes up the naming eh?).

Stay tuned.

P.S. If you are using Melina Kernel for your main kernel, I would not let this announcement worry you, since Melina Kernel is for stock ROMs, I believe the ROM is doing the proper configuration to prevent the issues. And no issues exist in the OS environment that I have seen. If I had to speculate, I probably need to check out more of the init.rc files and properly set up some variables, maybe the Low Memory Killer or something.

I would however, suggest not to use Melina TWRP until rel_o3, which has no ETA.
[LG G6 ROMs, Kernels, Recoveries, & Other Developme] zefie:
Sorry for double/triple posting so soon but I need attention to this:

Short version: Have you ever successfully restored a backup on a G6, and if so, do you recall which TWRP image you used, and what you backed up? (stock or aosp rom)

Long version:

The problem isn't Melina Kernel. While I was able to restore a backup with 3.1.1 once, I forgot it did not have the "Wipe LG Lockscreen" option, so had to restore again, and have not been able to, even on 3.1.1.

So this is not the kernel, but something else entirely. Will continue to look into this with your help.
[LG G6 ROMs, Kernels, Recoveries, & Other Developme] Arak0n:
I'm using (I think) official 3.2.1-0 .. it was part of westwood24's Stock rom zip. I backed up my stock system.

I restored a backup twice without issues. It was not compressed.
[LG G6 ROMs, Kernels, Recoveries, & Other Developme] mprovi_15:
I think I did one backup and restored with the official twrp 3.1.1 but I couldn't enter into the phone because the Knock code was changed and couldn't enter into the phone and I had to do a factory reset.
[LG G6 ROMs, Kernels, Recoveries, & Other Developme] xmxm:
I was able to do restores using twrp-3.1.1-0-h870.img yesterday. With your restores, I think that I had more success with uncompressed backups (both backups and restores) rather than with compressed ones. If I remember correctly, I did not have problems with smaller partitions (boot/recovery), only with partitions greater than ~1600MB.
[LG G6 ROMs, Kernels, Recoveries, & Other Developme] zefie:
I never had a backup creation fail, compressed or uncompressed, except once, but that was a filesystem error on my sdcard at the time (when I could still use SDcards), and reformatting the card fixed it. Even 20gb+ compressed backups could be created, but nothing can restore it, even 3.1.1.

I had a small 6gb data backup that restored the first time on 3.1.1 but would not restore after.

I thought maybe it was a thermal issue, so I put the phone on my air conditioner and watched the CPU temp drop to under 27C, then it still failed (3.1.1 non-Melina).

The idea of a misconfiguration is not out of the question (after all, Lineage Kernel is just a more wildly hacked LGE kernel than Melina). It is possible we are not initializing the kernel correctly (via writing to /sys in init.rc), which causes large operations to crash.

Yet then again, why can we flash a 6gb system.img from my v20a zip and westwood zips without it crashing? What is every variation of tar (twrp, busybox, toybox) doing so different that crashes it?

I know TWRP's tar has hacks to support selinux, but thats irrelevant since even other tars crash.
[LG G6 ROMs, Kernels, Recoveries, & Other Developme] xmxm:
I am not able to reproduce failure during backup, but I am able to reproduce failure during restore - I have 2 sets of backups, compressed and uncompressed and TWRP-3.2.1 fails to restore even system partition, while TWRP-3.1.1 works fine. I am afraid to try to restore data partition, since TWRP-3.1.1 does not seem to be able to access it, so if TWRP-3.2.1 messes it, I would have no recourse. At any rate, the problem manifests itself even on system partition, always around same position ~1536MB, this partition does not have too many files and CPU temperature during restore (30-33 degrees Celsuis) is lower than it was during backup (38-40 degrees), so I do not think it is about overheating.

The only thing interesting that I've found is that 1536MB is around the size of individual file, system.ext4.win000, so I wonder if there is any issue as it switches from win000 file to win001 part. Is there anything specific you would like me to check? I wonder if I can combine all 3 parts into a single system.ext4 file, since it still should be under 4GB.

---------- Post added at 09:41 PM ---------- Previous post was at 09:00 PM ----------

I think that I might be finding something - I've tried to merge all 3 system.ext.win00X files together into a single file and to perform a restore from it using TWRP-3.2.1 The restore process did not hang/crash, although it still finished at 1536MB (and resulting in incomplete restore). I wonder if I've merged files incorrectly - maybe I should set up a linux VM, untar everything into a folder and re-tar everything, but I have a higher confidence now that the problem is happening during tar file switch.
[LG G6 ROMs, Kernels, Recoveries, & Other Developme] zefie:
They are not split files, they are seperate tars, so you can't just concat them together. You'd have to extract them in numerical order and re-tar them. So really, you only restored system.ext4.win000 with that concat'd blob.

I'm not sure the issue is related to splitting, I've had the restore fail at 50MB, as well as 99% of 7gb (in 3.1.1). I'm leaning more towards memory issues. I will say that Melina TWRP seems to accelerate the restore error vs 3.1.1, but both have the problem, in the end.

EDIT: Problem may be upstream with TWRP after all:

https://github.com/TeamWin/Team-Win-Recovery-Project/issues/964

Issue stems back to 2017, but there are recent comments from users of other devices with the same issue.
[LG G6 ROMs, Kernels, Recoveries, & Other Developme] xmxm:
Please correct me if I am wrong, but it seems that this bug is talking towards tar being damaged while being CREATED. If you take your backups that fail on the phone to desktop, are you able to untar them there? If so, the problem might be in restoring the tar, rather than creating it.

I was able to unpack backups that I've created on my workstation without errors.
[LG G6 ROMs, Kernels, Recoveries, & Other Developme] zefie:
Correct, and it is plausible that we have the same issue, but why would my backup restore fully once, then not? Why do they crash at inconsistent areas?

Your specific issue may be this (did you create it on 3.1.1 or Melina?), since you said yours fails at the same spot every time, but I don't think the overall issue is this.

There is no way it is "sometimes" skipping the invalid data, and "sometimes" crashing over it.

I have not had time lately to work on this or test anything, but highly doubting my data would have a problem extracting on PC.
[LG G6 ROMs, Kernels, Recoveries, & Other Developme] jimbomodder:
I'm on 3.2.1-0 rel T2 and used compression on ext sdcard and never have any issues restoring backups or creating them. I'm on H870 running aicp as a DD ROM
[LG G6 ROMs, Kernels, Recoveries, & Other Developme] zefie:
Ahhh, more entropy in this already random issue. This is turning out to be a pain to track down.

EDIT: When I was looking into the kernel, I noticed LG has code for serial debugging over the headphone jack. As crazy as this sounds, this is a thing because adapters like this exist. It would likely help this issue, but moreover it would help issues with Lineage Kernels or really any kernel issues at all. Problem is I cannot afford it, and I don't want to beg for donations, nor expect you guys (and gals) to pay for it. There is also another issue with just going out and dropping $50 on this cable, just because the code is there does not mean our phones have the hardware functionality, so it is also possible that purchasing this cable would be for naught.
[LG G6 ROMs, Kernels, Recoveries, & Other Developme] x86cpu:
Using: rel_o2 OReo US997 .. TWRP fails to mount /data when encrypted. Using default password (so, no secure boot).

I:Setting up '/data' as data/media emulated storage.
I:Can't probe device /dev/block/sda19
I:Unable to mount '/data'
I:Actual block device: '/dev/block/sda19', current file system: 'ext4'
I:Can't probe device /dev/block/sda19
Failed to mount '/data' (Unknown error 150)
I:Actual block device: '/dev/block/sda19', current file system: 'ext4'

From a logcat, you might be missing the vold decryption:

02-28 08:23:11.106 0 0 I [ 1.919591 / 02-28 08:23:05.769][2] init: Added '/init.recovery.vold_decrypt.rc' to import list
02-28 08:23:11.106 0 0 E [ 1.920197 / 02-28 08:23:05.779][2] init: Unable to open '/init.recovery.vold_decrypt.rc': No such file or directory
02-28 08:23:11.106 0 0 E [ 1.920211 / 02-28 08:23:05.779][2] init: /init.rc: 4: Could not import file '/init.recovery.vold_decrypt.rc': No such file or directory

Running lineage-15.1-20180620-UNOFFICIAL-us997

I can provide more, if needed.
[LG G6 ROMs, Kernels, Recoveries, & Other Developme] zefie:
Encryption is disabled because it doesn't work and causes more problems when it tries (such as 10-30 second boot delay).

Edit: If your lineage supports encryption maybe I can get it to work in TWRP, but is it the same as LG's or did you guys go your own route? We don't need two types of encryption, it will just confuse people.
[LG G6 ROMs, Kernels, Recoveries, & Other Developme] x86cpu:
Not sure, I know the V20's are working (G5 is not either). https://xdaforums.com/v20/development/recovery-twrp-3-2-1-0-t3720239 I believe he checks a couple of ways. This is the lineage that will become official, almost everything is in working order. (TWRP is not a requirement though), but it would be nice.
[LG G6 ROMs, Kernels, Recoveries, & Other Developme] Phoenix591:
[MENTION=759634]zefie[/MENTION]

The stock LG encryption is different than the lineage encryption (at least on the V20, each cant read /data encrypted by the other) but I got TWRP to read encryption from whichever rom is installed by setting it to use system vold in Boardconfig. Besides that and enabling the firmware partition in fstab there wasn't anything fancy I did to get it working. Afterwards since there was talk of adding a vendor partition to the V20 I made my own script to start qseecomd (not sure if the stock twrp script would have worked with either scenario or not).

https://github.com/Phoenix591/android_device_lge_us996
[LG G6 ROMs, Kernels, Recoveries, & Other Developme] zefie:
Hmmm... I tried the system vold thing before without luck but perhaps I did it wrong. Will look into it when I get a chance. If my sister doesn't take the phone. (She is in town for a week and her phone is acting up so I offered her the G6, but she is an iPhone user, so I'm not sure if she'll want to keep it. If she does, I won't be able to dev anymore for the G6, but if she doesn't, when they go back home I will have time to code again. I'll make an announcement if she keeps it and I stop deving for this device)
[LG G6 ROMs, Kernels, Recoveries, & Other Developme] Tool Belt:
I really think she should continue in the iWorld...........
[LG G6 ROMs, Kernels, Recoveries, & Other Developme] AlDollaz:
+2

Thanks for this, [MENTION=759634]zefie[/MENTION]. It's the only TWRP that works with Oreo. Hopefully you keep developing for the G6. I just bought the US997 and I'd hate for all development to cease right when I bought the thing lol :)

P.S. I will gladly donate to keep development going :D
[LG G6 ROMs, Kernels, Recoveries, & Other Developme] zefie:
Well, I'm still not sure yet but its likely the G6 will leave with them. She'll probably keep her iPhone but her husband uses Android and his phone looks like a bullet hit it. Anyway, I will continue to develop for the G6 the best I can. At the very least I will work on fixing up Melina TWRP so that it can support backups and encryption without issues. However, I will be needing testers that are willing to flash test builds often (never a brick, can always KDZ out, but data loss is a possibility).

I probably won't have time to work on development until after the July 4th holiday.

If you are interested in helping test, please join my Testing Discord (Testers and those interested in development progress only. No support for public releases will be given on this server! For support, please continue to use the XDA threads or XDA Discord.)

Both us997 and h870 welcome.
[LG G6 ROMs, Kernels, Recoveries, & Other Developme] AlDollaz:
Thank you for all you do, [MENTION=759634]zefie[/MENTION]. It's most appreciated :)

Tip sent :D
[LG G6 ROMs, Kernels, Recoveries, & Other Developme] x86cpu:
I have a us997 that i use for LineageOS development, so I can gladly test builds and get back using fastboot. I've already lost data numerous times, so I'm ok if that happens.
[LG G6 ROMs, Kernels, Recoveries, & Other Developme] zefie:
Cool. Testing & Build Releases will take place on the Discord so be sure to join it. :)
[LG G6 ROMs, Kernels, Recoveries, & Other Developme] Rom:
Hello, i would like to help the devlopment of this twrp.

As i write on Discord that there isn't any .zip or .img beta file avalaible, nothing here too, where i could find it to start my tests ?

On last stable version for H870, the hours is fixed, except for when i backup my phone, the years is incorrect, it give "2065" as years..

Also the backup of "System Image" partition is impossible.

I put here the twrp log include kernel details.

If you provide a dl link i could make the test again :)
[LG G6 ROMs, Kernels, Recoveries, & Other Developme] zefie:
As stated on here and on the Discord development will not continue until after July 4th, or later.

Please read the rules/instructions in the welcome channel. It is imperative that my testers have basic instruction following abilities :)
[LG G6 ROMs, Kernels, Recoveries, & Other Developme] dimitrissot:
Hi to all. I am using the latest Melina twrp (rel o2) with LG G6 (h870) STOCK OREO ROM. just restored my ROM without any issues. Backup was made with a previous release.
[LG G6 ROMs, Kernels, Recoveries, & Other Developme] zefie:
I will check the creation routine when I get a chance. Though its still weird since I was able to restore a Melina-created backup (o2) with no problem on 3.1.1. Something is definitely strange with the tar routines so I will check it out when I have time.

By any chance if you remember or still have the backup, is your backup compressed or uncompressed?
[LG G6 ROMs, Kernels, Recoveries, & Other Developme] dimitrissot:
Yes I always make my backups uncompressed
[LG G6 ROMs, Kernels, Recoveries, & Other Developme] xmxm:
With TWRP 3.2.2-0 Released (https://twrp.me/site/update/2018/07/01/twrp-3.2.2-0-released.html) and release notes mentioning adb fixes, would it be possible to implement this for LG G6?

Thanks,

Maxim
[LG G6 ROMs, Kernels, Recoveries, & Other Developme] zefie:
Yes, the next build will be synced up to 3.2.2.
[LG G6 ROMs, Kernels, Recoveries, & Other Developme] NellL33:
Error 7 when trying to flash a zip

So I got the H870 and I tried to flash two different ROMs (AospE v.6.5 & RROS v.6.0) with this recovery but it won't work. I keep getting this message:

Also tried various other twrp versions. Same output. I feel like I'm missing something rather simple...

Any ideas?
[LG G6 ROMs, Kernels, Recoveries, & Other Developme] Dottorfox:
hi zefie do you have a configuration to recommend for the rom aosp with your kernel?
[LG G6 ROMs, Kernels, Recoveries, & Other Developme] Sobek5150:
Any word on if the tar issue was addressed or will backups still be susceptible to this on restore?