• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[RECOVERY][UNOFFICIAL][US997/H870][rel_o2/rel_t2][2018-06-08] Melina TWRP v3.2.1

Search This thread

zefie

Senior Member
Dec 30, 2007
454
603
Upstate NY
the.midnightchannel.net
This recovery has been superseded by Eliminater74's TWRP.
This post and its files remain for archival purposes.


-- Old OP --

Note: I no longer own this device. To help test, join my Testing Discord (Please read the rules presented when you join.)

Note: There is a known bug with restoring backups. If you need to use the backup/restore features, please do not use Melina TWRP until rel_o3 is released, which has no eta.

The following releases are unofficial and will always be due to dirty edits.

However, it offers the following features over the official release:

Oreo Only Features:
  • Integrated Melina Kernel (rel_o2) into TWRP build system (rel_o2 or newer)
  • Oreo kernel (nougat kernel cannot mount unencrypted /data for some reason) (rel_o1 or newer)
  • Disabled encryption (rel_o1 or newer) (Note: LGE uses forceencryption now, and also has a script to replace your custom recovery with their own. Please flash my anti-root removal tool, which will remove rctd, forceencrypt, and the anti-custom-recovery script)

Nougat/Oreo Features:
  • Integrated Melina Kernel (rel_nr2) into TWRP build system (rel_t2 or newer)
  • Integrated uber-toolchain 6.x for kernel compilation into TWRP build system (rel_t2 or newer)
  • Stability and performance increases over rel3 (rel_t1 or newer)
  • /vendor partition support (if you have not repartitioned, which at the time of this release, 99% of you haven't, then you may get an error in TWRP regarding mounting storage. This is safe to ignore) (rel_t1 or newer)
  • /misc bootloop fix (rel_t1 or newer)
  • Date and time fix (msm8996 workaround) (mixed reports, but works for me on US997 with Stock and Fulmics ROMs, see this post for more information)
  • Option to wipe LG lockscreen security settings when restoring data partition (workaround for known issue where sometimes you get locked out of restored stock ROMs)
  • NTFS support (untested, should allow NTFS USB-OTG for restoring backups and flashing zips, read-only)
  • SD-Ext support (including backing up and restoring, both ext4 and F2FS supported thanks to Melina)
  • Purple theme, because purple is cool
Based on J0SH1X's work.

Downloads (bold is current):



Usage:
Unzip file and flash recovery.img

Please keep in mind I only have the US997 so help test this for H870!

Current Known issues:
  • Restoring backups does not work, due to tar process terminating with error 255.
  • You must format data when coming from a stock ROM due to LG using forceencrypt.
Fixed issues:
  • Disabled encryption (fixed in rel_o1)
  • E:Unhandled flag: 'removeable' (fixed in rel_t2)
  • Slow SDCard Performance (fixed in rel_t1)
  • MTP reliability (fixed in rel_t1)

GPL (dev info):
Read the readme on the github.

If my releases help you, please leave a thanks. If you are able, please consider a tip (check the small link in my sig).
 
Last edited:

DonS

Senior Member
Mar 28, 2005
195
15
Prompt for password to decrypt data

I installed the 3.2.1 version by flashing the img from the older 3.1.1 version.

When I rebooted to recovery, it prompted me for a password to decrypt the data. I don't remember encrypting the data and I do not know the password. I was able to tap cancel and get to the main TWRP screen.

Should I be worried about this?
 

zefie

Senior Member
Dec 30, 2007
454
603
Upstate NY
the.midnightchannel.net
I installed the 3.2.1 version by flashing the img from the older 3.1.1 version.

When I rebooted to recovery, it prompted me for a password to decrypt the data. I don't remember encrypting the data and I do not know the password. I was able to tap cancel and get to the main TWRP screen.

Should I be worried about this?

That is strange, I don't use encryption and never had that. I guess if the data was accessible after hitting cancel, I wouldn't worry about it. Which device?
 
  • Like
Reactions: peedoff1

DonS

Senior Member
Mar 28, 2005
195
15
I have the US997 version.

I didn't try flashing anything from TWRP, I just booted to make sure it showed the new version number. I rebooted to the system and everything is working fine.
 

zefie

Senior Member
Dec 30, 2007
454
603
Upstate NY
the.midnightchannel.net
I have the US997 version.

I didn't try flashing anything from TWRP, I just booted to make sure it showed the new version number. I rebooted to the system and everything is working fine.

Try flashing the img through fastboot as per normal rather than through TWRP, then when you reboot into recovery, regardless if you get the message or not, go to the backup menu and be sure Data has more than (0 MB) next to it on the list.

Oh, also, the old 3.1.1 (the one I didn't make) had an issue where if you used "Format Data" (with yes option) it actually created a corrupt file system, so that could be it as well. To fix that, execute the following under adb shell:

  • umount /dev/block/sda19
  • e2fsck -f /dev/block/sda19
    (Select y for yes to repair if prompted)

Then reboot recovery and try again. You shouldn't lose data using these commands. However, if it does find and repair errors, it is not out of the question, but is something you'll want to address.
 
Last edited:
  • Like
Reactions: peedoff1

Killua96

Senior Member
Apr 5, 2012
1,545
477
Castelvetro di Modena
@zefie flashed the H870 build (flashed the img trough official TWRP), no password, data in backup is 8893MB, time is working fine, if you have other things to check just tell me.
BTW no purple theme, don't know why
 
Last edited:
  • Like
Reactions: basicreece

zefie

Senior Member
Dec 30, 2007
454
603
Upstate NY
the.midnightchannel.net
@zefie flashed the H870 build (flashed the img trough official TWRP), no password, data in backup is 8893MB, time is working fine, if you have other things to check just tell me.
BTW no purple theme, don't know why

Probably just the header, is the slider purple?

Edit: nevermind, I know why, didn't define my theme in the h870 config. Rebuilding.

Edit 2: Fix should be up. Also updated US997 since this is Melina rel6 now (previous release used a pre-release version of rel6)
 
Last edited:

dave_id

Senior Member
Apr 6, 2012
204
13
paris
hello and thank you for this
anyway, I wanted to flash it under twrp as an image
it asks me :
"select partition to flash image"
-boot
-recovery
-system image
-modem
-persist

also is it ok to flash this with Fulmics ROM?
 

DonS

Senior Member
Mar 28, 2005
195
15
Try flashing the img through fastboot as per normal rather than through TWRP, then when you reboot into recovery, regardless if you get the message or not, go to the backup menu and be sure Data has more than (0 MB) next to it on the list.

Oh, also, the old 3.1.1 (the one I didn't make) had an issue where if you used "Format Data" (with yes option) it actually created a corrupt file system, so that could be it as well. To fix that, execute the following under adb shell:

  • umount /dev/block/sda19
  • e2fsck -f /dev/block/sda19
    (Select y for yes to repair if prompted)

Then reboot recovery and try again. You shouldn't lose data using these commands. However, if it does find and repair errors, it is not out of the question, but is something you'll want to address.

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:/ $
 

zefie

Senior Member
Dec 30, 2007
454
603
Upstate NY
the.midnightchannel.net
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:/ $

The error is because it's not mounted at all (since it sees 0 MB), so just skip to the second command.
 

DonS

Senior Member
Mar 28, 2005
195
15
The error is because it's not mounted at all (since it sees 0 MB), so just skip to the second command.

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.
 

DonS

Senior Member
Mar 28, 2005
195
15
Run it in either TWRP, not under Android.

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.
 

zefie

Senior Member
Dec 30, 2007
454
603
Upstate NY
the.midnightchannel.net
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.

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)
 

zefie

Senior Member
Dec 30, 2007
454
603
Upstate NY
the.midnightchannel.net
@zefie 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

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.
 
  • Like
Reactions: saenta

Top Liked Posts

  • There are no posts matching your filters.
  • 48
    This recovery has been superseded by Eliminater74's TWRP.
    This post and its files remain for archival purposes.


    -- Old OP --

    Note: I no longer own this device. To help test, join my Testing Discord (Please read the rules presented when you join.)

    Note: There is a known bug with restoring backups. If you need to use the backup/restore features, please do not use Melina TWRP until rel_o3 is released, which has no eta.

    The following releases are unofficial and will always be due to dirty edits.

    However, it offers the following features over the official release:

    Oreo Only Features:
    • Integrated Melina Kernel (rel_o2) into TWRP build system (rel_o2 or newer)
    • Oreo kernel (nougat kernel cannot mount unencrypted /data for some reason) (rel_o1 or newer)
    • Disabled encryption (rel_o1 or newer) (Note: LGE uses forceencryption now, and also has a script to replace your custom recovery with their own. Please flash my anti-root removal tool, which will remove rctd, forceencrypt, and the anti-custom-recovery script)

    Nougat/Oreo Features:
    • Integrated Melina Kernel (rel_nr2) into TWRP build system (rel_t2 or newer)
    • Integrated uber-toolchain 6.x for kernel compilation into TWRP build system (rel_t2 or newer)
    • Stability and performance increases over rel3 (rel_t1 or newer)
    • /vendor partition support (if you have not repartitioned, which at the time of this release, 99% of you haven't, then you may get an error in TWRP regarding mounting storage. This is safe to ignore) (rel_t1 or newer)
    • /misc bootloop fix (rel_t1 or newer)
    • Date and time fix (msm8996 workaround) (mixed reports, but works for me on US997 with Stock and Fulmics ROMs, see this post for more information)
    • Option to wipe LG lockscreen security settings when restoring data partition (workaround for known issue where sometimes you get locked out of restored stock ROMs)
    • NTFS support (untested, should allow NTFS USB-OTG for restoring backups and flashing zips, read-only)
    • SD-Ext support (including backing up and restoring, both ext4 and F2FS supported thanks to Melina)
    • Purple theme, because purple is cool
    Based on J0SH1X's work.

    Downloads (bold is current):



    Usage:
    Unzip file and flash recovery.img

    Please keep in mind I only have the US997 so help test this for H870!

    Current Known issues:
    • Restoring backups does not work, due to tar process terminating with error 255.
    • You must format data when coming from a stock ROM due to LG using forceencrypt.
    Fixed issues:
    • Disabled encryption (fixed in rel_o1)
    • E:Unhandled flag: 'removeable' (fixed in rel_t2)
    • Slow SDCard Performance (fixed in rel_t1)
    • MTP reliability (fixed in rel_t1)

    GPL (dev info):
    Read the readme on the github.

    If my releases help you, please leave a thanks. If you are able, please consider a tip (check the small link in my sig).
    15
    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.
    12
    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.
    12
    LG has pushed v20a for the US997, my FOTA is installing as we speak, and a test build of melina is already waiting. Then I will start addressing TWRP.

    In the meantime, if you are hyped, or any of my releases have helped, consider that tiny tip/dono link in my sig. :)
    11
    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.