TWRP for Fairphone 3

So, I’m on A0111 and rooted with Magisk. How does the update process look like for me? Can I just flash the A0111 image to restore stock boot, update, and then re-do the Magisk root procedure? Or do I have to be more careful and do something else before?

You should be able to directly do the OTA update. And you can even keep Magisk by just uninstalling it (restoring images, not full uninstall), then install the update normally but DO NOT REBOOT, then on Magisk, select “install in inactive slot (after OTA)”. This should work if you did not modify the system partition (mount read only).

Hey, thank you very much for your response. Sadly, I didn’t keep my system partition read only when rooting, so I guess flashing the stock sytem image is unavoidable for me.

This .zip is not directly flashable in TWRP, right? But can I unzip it and use its contents with the restore-option?

No, you can unzip it and flash the partitions with fastboot.
Here’s a script you can use or have a look at to see how it’s done …

Thank you very much, everything worked fine and I now have an even better understanding on how to flash around the FP3. Looking into that script was interesting, I didn’t realize that the FP3 has two slots for a bootloader.

I also stumpled upon the createTarFork() ERROR 255. These are the last lines of recovery.log:

I:addFile '/data/vendor_ce/0' including root: 1
  ==> set selinux context: u:object_r:vendor_data_file:s0
failed to lookup tar policy for '/data/vendor_ce/0' - 'b375d30057e757ba'
I:Error adding file '/data/vendor_ce/0' to '/external_sd/TWRP/BACKUPS/A209GQ1S0202/1970-05-19--13-05-18_89012A010520191217/data.ext4.win001'
Error creating backup.
I:ERROR tarList for thread ID 0
Error creating backup.
I:InfoManager saving '/external_sd/TWRP/BACKUPS/A209GQ1S0202/1970-05-19--13-05-18_89012A010520191217/data.info'
createTarFork() process ended with ERROR: 255
Backup Failed. Cleaning Backup Folder.

I’m on an unlocked FP3, Build No. 8901.2.A.0105.20191217. I have removed many Google Apps as of here. I have played around with the multi user feature, but have removed all additional users. When I started TWRP using fastboot boot <twrp.img>, I mounted system read-only.

What do you make of it?

PS.: I am going to PM you my recovery.log

what filesystem is your external sd card formatted with?

How do I find out? Can I find out using adb? Or do I have to take it out and insert the microSD card into a computer?

It’s probably easiest to check on a PC. But should also be possible using adb, although I can’t currently tell you how.
The reason I am asking is, because my guess would be that your SD-card is fat32 formatted.
And fat32 doesn’t support files larger than 4GiB, which is why backup is failing.
So you’ll have to reformat the card using exfat

1 Like

I can’t check for myself right now, but you could have a look at the Addendum at the end of this post and see whether TWRP reports the file system for the SD card that way.
(Just don’t proceed with the formatting there :wink: .)

1 Like

Hi there,

i flashed A.110, then i installed twrp.zip and magisk.zip. After erasing userdata with fastboot -w everything works fine so far… but if i relock the bootloader i always get an error message

Your device is corrupt. It can’t be
trusted and will not boot

This is caused by the modified boot.img:

2 Likes

Direct hit! And thanks to @AnotherElk for the TWRP trick. My file system is vfat. I’ll format my microSD card and try again. :slight_smile:

Edit: And “Backup completed in 836 seconds”. :tada:

Edit2: Bummer, exFAT is not recognized in /e/… :roll_eyes:

1 Like

Is TWRP backup for FP3 different from TWRP backup for FP2 (as TWRP for FP2 split backup files into pieces of max 1.5GB)? :thinking:

1 Like

Does /e/ say that … or does it “only” want to format the card it sees for the first time?
If the latter … /e/ wanted to format my card, too, and my card was not exFAT formatted. I think the Fairphone 3 stock OS wanted to do that, too, but I don’t know if I remember that correctly, I didn’t take notes then.

Explicitly missing exFAT support would surprise me, as I found LineageOS on the Fairphone 2 would support exFAT.

But it’s of little use if Android insisted on formatting and wouldn’t let you choose the file system.

Be aware: I ran into createTarFork() ERROR 255 on restore as well. On both, a backup on internal storage (ext4) and as well as on a backup directly stored over usb to my harddrive via adb backup --twrp. There is an unresolved bug in TWRP that can more or less randomly lead to corrupted backups without the exact cause being known. Do not rely on TWRP as your sole backup solution!

If you want to restore the data partition on a Fairphone 3 with TWRP, before restoring make sure that encryption would be set up the same way as when the backup was made.

I have successfully restored the complete state of the phone following these steps …

  • Install the OS build that matches the data partition to restore.
    (I needed to match the build this way, else restoring the data partition would fail.)
  • Boot the installed OS, set up the screen lock (= the decryption method) in the same way it was set up when the backup of the data partition was made.
    (Else restoring the data partition would fail.)
  • Restore the data partition with TWRP.
  • Copy the whole Internal Storage back to the phone (since TWRP doesn’t include Internal Storage in a backup, so I always use other means to backup Internal Storage).
1 Like

Interesting, I assume this an issue with the way TWRP performs the restore? Because in theory, the backup data should contain everything that’s required to restore the previous encryption state, no?

I also observed that the TWRP factory reset did not work properly (system would still not boot after wiping). The only way to get the phone into a bootable state for me was to use the factory reset feature of the default recovery partition.

1 Like