Just attempting to boot TWRP corrupts my /e/ installation

I successfully installed /e/ following various guides on FP3 and /e/ sites.
After a botched attempt to make a backup using TWRP from & to internal storage (it was late, I was stupid) I simply repeated the steps to install /e/ and was back with a working system.

Now I wanted to test whether I can use TWRP to make a system image of my /e/ installation. I did the following

  1. Unlock the bootloader in fastboot mode
  2. fastboot boot twrp-3.4.0-0-FP3.img
  3. Phone attempts to boot into TWRP
  4. TWRP shows the splash screen
  5. TWRP briefly shows a screen from which only the word ā€œcorruptā€ stuck with me
  6. Phone reboots twice
  7. /e/ recovery screens asks me to ā€œtry againā€ or do a ā€œfactory resetā€

So it seems that just trying to boot TWRP somehow corrupts the installation.

Any suggestions on what to do?
e.g ideas on how I completely wipe phone memory to do a clean reinstall? After all, after the 1st installation, I was able to boot TWRP successfullyā€¦so I guess there are some leftovers from my botched backup attempt

From what I understood you must do a factory reset or fastboot -w after the unlock before you can successfully boot anything.
Or in other words: when one installs /e/ and skips the bootloader locking at the end, fastboot boot twrp-3.4.0-0-FP3.img would work fine.

4 Likes

Ahā€¦that might be the difference.
If I remember correctly, after the 1st /e/ installation, I never locked the bootloader because I immediately intended to boot TWRP for a test backup.
After the 2nd installation, I locked the bootloader, with the intention of unlocking it whenever I need to boot TWRP.

If this is true, my backup strategy is doomed to fail. I would have loved to install TWRP as recovery partition, but the FP3+ doesnā€™t seem able to handle that.

EDIT:
From Š‘Š»Š¾ŠŗŠøрŠ¾Š²ŠŗŠ°/рŠ°Š·Š±Š»Š¾ŠŗŠøрŠ¾Š²ŠŗŠ° Š·Š°Š³Ń€ŃƒŠ·Ń‡ŠøŠŗŠ°  |  Android Open Source Project

When the fastboot flashing unlock command is sent, the device should prompt users to warn them that they might encounter problems with unofficial images. After the user acknowledges the warning, the device should perform a factory data reset to prevent unauthorized data access. The bootloader should reset the device even if it canā€™t reformat it properly. Only after a reset can the persistent flag be set so that the device can be reflashed.

Not in that sense. Like @Ingo said, unlocking the bootloader will force a factory reset (and locking it does, too), but itā€™s no corruption, itā€™s a security feature.

I can confirm that booting TWRP works fine once you leave the bootloader unlocked. Whether you want to risk doing that is for you to assess yourself. With an unlocked bootloader, be sure to set up a screen lock to prevent access to your data in case of simple loss or theft of the phone.

Technically itā€™s possible to do that, the official TWRP page covers that, but without additional measures TWRP will not stay in place, /e/ will restore its own recovery with every OTA update.
And the Fairphone 3/3+ has no recovery partition, it is an A/B device like most nowadays phones, which has benefits for OTA updates, but makes keeping an alternative recovery on the phone complicated.

2 Likes

How does that prevent data loss? Anyone can just take out the battery, boot into fastboot, and pretty much do what they want.

My plan was to keep both bootloader and OEM locked normally, then unlock OEM within /e/ (requires unlocked OS), then unlock bootloader, then boot TWRP and backup/restore.

Any hints for an alternative backup option that allows me to create/restore a system image (in a fashion similar to a fastbooted TWRP)?

(EDIT: Iā€™ll also happily take a backup/restore system that saves/restores all apps and app data to/from SD card or local computer)

No they canā€™t, with simple loss or theft they have to factory reset, if you have set up a screen lock.

The data partition is encrypted by default, and if you set up a screen lock, the unlock method for it serves as the unlock method needed on the phone to get access to the data partition.
Once set up, TWRP has to prompt for this, too, else it canā€™t access the data partition.

What they can do, if they want to target you specifically, is to take your phone from you unnoticed, install malware to do something once you unlock, and get the phone back to you unnoticed to let you unlock.
A risk you have to assess for yourself, as said.

Efforts are underway to integrate Seedvault into /e/, which should be able to backup Apps and App data, but as far as I understand it doesnā€™t work universally for every App, Apps have to support it.

3 Likes

Do you have a specific source for this? Or is it what you have read in different places?
I read on their Github page in a closed issue (here) that apps could disallow the backup of their data, but thatā€™s an AOSP feature and not only linked to SeedVault. The issue pointed here:

Or are you talking about something else?

1 Like

This. I didnā€™t dig too deep because Iā€™m using TWRP for backups.
Thanks for pointing to sources clarifying this.

1 Like

Ah thanks, that explains your position. How can I check whether the partition is actually encrypted?
In older versions of Android, I noticed that encrypted phones requested the PIN twice - once rather early in the boot process, and then at the end when the OS is fully booted to unlock the screen.
The FP3+ doesnā€™t do that (neither stock OS nor /e/), so I assumed I would have to enable encryption first.

Different, though related question: While by bootloader is unlocked, I get a special warning screen at the beginning of the boot process (ā€œPress Power to pause/resume bootā€).

If I click ā€œVol-ā€ in that screen (because I wanted fastboot mode), the phone goes dead - black screen, and no response to any key until I take out and re-insert the battery.
Do you know what/why that is?

If you trust the tech

  • Android will say in the settings that encryption is there from the first start on.
  • With a screen lock, TWRP would prompt you for unlocking and only then would be able to access the data partition.

If you donā€™t trust the tech, I guess you would need to copy the raw partition data to a computer and see whether you somehow get anything useful out of it.

Interpreting what I read here, decryption would even need a component in the phone, just knowing the unlock method and having the encrypted data somewhere else would not be enough ā€¦ but perhaps I interpret wrong ā€¦

https://community.e.foundation/t/is-my-phone-encrypted/22779


ā€¦ else the phone would shut down in 30 seconds?
The screen related to unlocking would just annoy you with a message and continue booting after a few seconds without any user interaction.
If you have the screen where you really have to press the power button to continue booting, the system didnā€™t like something you did, but you can get rid of that ā€¦

ā€¦ works once Android or TWRP are booted.


No, I donā€™t know about that. Would have to try that myself.

1 Like

TWRP seemed able to access what it calls ā€œinternal storageā€ without asking for a PIN, but then I didnā€™t verify whether it could actually see the files or just bit garbage there. Canā€™t boot TWRP again until I decide to do another factory resetā€¦

Yes, it continues booting if I donā€™t do anything. But it makes it kind of hard to reach Fastboot mode, since wrong timing with Vol- means I have to rip the battery out. Still, just an annoyance, true.

TWRP can still show Internal Storage in its storage choice, but it should give a size of 0 MB for it if thereā€™s no access to it.
And screen lock should be set up in Android, I never tried without that.

Hmmm ā€¦ I donā€™t see the difficulty. I just keep Volume - pressed while starting or rebooting the phone, until the phone vibrates and almost immediately presents Fastboot Mode.

When Android is booted and if you enabled ADB, you can also adb reboot bootloader.
Or you can enable Advanced restart in the Developer options, which will give you the bootloader as a target choice in the reboot menu in Android (which comes up when keeping the power button pressed).

1 Like

Thank you for your extensive replies.
The phone shows as ā€œencryptedā€, so TWRP was probably just doing what you described.

My main difficulty with the warning screen was after the automatic reboot after unlocking the bootloader (press+release power, abut 500 ms to press Vol- before the warning screen is displayed). But I see I wonā€™t be doing that much if I donā€™t want a factory-reset phoneā€¦

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.