crazo7924 / android_device_realme_RMX3241

TWRP sources for Realme 8 5G / Narzo 30 5G
Apache License 2.0
12 stars 7 forks source link

Can't backup partitions #9

Closed gabtzi closed 2 years ago

gabtzi commented 2 years ago

Not sure if this is the correct repo to add this issue, if not could you point me to the right one?

I'm trying to create a full backup after issuing

$ adb shell twrp decrypt "your password"

The decryption process worked succesfully.

When trying to create a backup it will throw this error

createTarFork() process ended with error: 255

Here's the trace in /tmp/recovery.log from before the error occured

  ==> set selinux context: u:object_r:mdlog_data_file:s0
I:addFile '/data/mdlog/bootupLog' including root: 1
  ==> set selinux context: u:object_r:mdlog_data_file:s0
I:addFile '/data/mdlog/mdlog1_config' including root: 1
  ==> set selinux context: u:object_r:mdlog_data_file:s0
I:addFile '/data/mdlog/mdlog1_recycle_size_config' including root: 1
  ==> set selinux context: u:object_r:mdlog_data_file:s0
I:addFile '/data/mdlog/mdlog1_customize_config' including root: 1
  ==> set selinux context: u:object_r:mdlog_data_file:s0
I:addFile '/data/mdlog/mdlog1_gps_loc_config' including root: 1
  ==> set selinux context: u:object_r:mdlog_data_file:s0
I:addFile '/data/mdlog/mdlog1_custom_autostart' including root: 1
  ==> set selinux context: u:object_r:mdlog_data_file:s0
I:addFile '/data/ramdump' including root: 1
  ==> set selinux context: u:object_r:debuglog_data_file:s0
found fscrypt policy '/data/ramdump' - '2DK' - 'eb46ecca34c766eafe92e636c42ad78e'
I:addFile '/data/oppo_log' including root: 1
  ==> set selinux context: u:object_r:oppo_log_data_file:s0
I:addFile '/data/oppo_log/anr_binder_info' including root: 1
  ==> set selinux context: u:object_r:oppo_log_data_file:s0
I:addFile '/data/.recycle' including root: 1
  ==> set selinux context: u:object_r:oppo_recycle_file:s0
found fscrypt policy '/data/.recycle' - '2CE0' - 'd68113237d9d07d90197751f06116d0f'
I:addFile '/data/oppo_lib' including root: 1
  ==> set selinux context: u:object_r:oppo_lib_file:s0
found fscrypt policy '/data/oppo_lib' - '2DK' - 'eb46ecca34c766eafe92e636c42ad78e'
I:addFile '/data/oppo_lib/sau_res' including root: 1
  ==> set selinux context: u:object_r:oppo_lib_file:s0
found fscrypt policy '/data/oppo_lib/sau_res' - '2DK' - 'eb46ecca34c766eafe92e636c42ad78e'
I:addFile '/data/cota' including root: 1
  ==> set selinux context: u:object_r:data_cota_file:s0
I:addFile '/data/mdl' including root: 1
  ==> set selinux context: u:object_r:mdlog_data_file:s0
found fscrypt policy '/data/mdl' - '2DK' - 'eb46ecca34c766eafe92e636c42ad78e'
I:addFile '/data/engineermode' including root: 1
  ==> set selinux context: u:object_r:data_engineer_file:s0
I:addFile '/data/engineercamera' including root: 1
  ==> set selinux context: u:object_r:data_engineer_file:s0
found fscrypt policy '/data/engineercamera' - '2DK' - 'eb46ecca34c766eafe92e636c42ad78e'
I:addFile '/data/theme_bak' including root: 1
  ==> set selinux context: u:object_r:oppo_theme_data_file:s0
found fscrypt policy '/data/theme_bak' - '2DK' - 'eb46ecca34c766eafe92e636c42ad78e'
I:addFile '/data/server_configurable_flags' including root: 1
  ==> set selinux context: u:object_r:server_configurable_flags_data_file:s0
found fscrypt policy '/data/server_configurable_flags' - '2DK' - 'eb46ecca34c766eafe92e636c42ad78e'
I:addFile '/data/logswitch' including root: 1
  ==> set selinux context: u:object_r:oppo_logswitch_file:s0
I:addFile '/data/logswitch/switch.xml' including root: 1
  ==> set selinux context: u:object_r:oppo_logswitch_file:s0
I:addFile '/data/nandswap' including root: 1
  ==> set selinux context: u:object_r:nandswap_file:s0
failed to lookup fscrypt tar policy for '/data/nandswap' - '0afa46dbdfdd2bdc483fd3e34281126a'
I:Closing tar
Splitting thread ID 0 into archive 12
I:addFile '/data/nandswap/f4CpECAAAAg1EFS9pbgx0vcxu5jUeSBD' including root: 1
  ==> set selinux context: u:object_r:nandswap_file:s0
I:Error adding file '/data/nandswap/f4CpECAAAAg1EFS9pbgx0vcxu5jUeSBD' to '/data/media/0/TWRP/BACKUPS/4LEUAY95PBGQZLUC/2021-11-22--05-28-02_RP1A200720011_release-keys/data.f2fs.win011'
Error creating backup.
I:ERROR tarList for thread ID 0
Error creating backup.
I:InfoManager saving '/data/media/0/TWRP/BACKUPS/4LEUAY95PBGQZLUC/2021-11-22--05-28-02_RP1A200720011_release-keys/data.info'
createTarFork() process ended with ERROR: 255
crazo7924 commented 2 years ago

Try deleting that nandswap folder. This is part of the RAM expansion feature. I have the 4/64 GB variant and it doesn't support that feature, so I can't reproduce it.

gabtzi commented 2 years ago

Thanks this error disappeared but led to another

Invalid encryption mode 'aes-256-xts:aes-256-cts:v2+inlinecrypt_optimized'
Backing up Protect S...
Invalid encryption mode 'aes-256-xts:aes-256-cts:v2+inlinecrypt_optimized'
I:Creating backup...
I:Creating tar file '/external_sd/TWRP/BACKUPS/4LEUAY95PBGQZLUC/2021-11-22--05-53-39_RP1A200720011_release-keys/protect_s.ext4.win'
I:addFile '/protect_s/md' including root: 0
  ==> set selinux context: u:object_r:protect_s_data_file:s0
I:addFile '/protect_s/md/LDPLB001' including root: 0
  ==> set selinux context: u:object_r:protect_s_data_file:s0
I:addFile '/protect_s/md/LD96_000' including root: 0
  ==> set selinux context: u:object_r:protect_s_data_file:s0
I:addFile '/protect_s/md/ER1D_002' including root: 0
  ==> set selinux context: u:object_r:protect_s_data_file:s0
I:addFile '/protect_s/md/MTCSB000' including root: 0
  ==> set selinux context: u:object_r:protect_s_data_file:s0
I:addFile '/protect_s/md/LD85_000' including root: 0
  ==> set selinux context: u:object_r:protect_s_data_file:s0
I:addFile '/protect_s/md/SL00_000' including root: 0
  ==> set selinux context: u:object_r:protect_s_data_file:s0
I:addFile '/protect_s/md/ST38_001' including root: 0
  ==> set selinux context: u:object_r:protect_s_data_file:s0
I:addFile '/protect_s/md/LD82_001' including root: 0
  ==> set selinux context: u:object_r:protect_s_data_file:s0
I:addFile '/protect_s/md/ST33B004' including root: 0
  ==> set selinux context: u:object_r:protect_s_data_file:s0
I:addFile '/protect_s/md/SL01_000' including root: 0
  ==> set selinux context: u:object_r:protect_s_data_file:s0
I:addFile '/protect_s/md/MC01_004' including root: 0
  ==> set selinux context: u:object_r:protect_s_data_file:s0
I:addFile '/protect_s/md/LD40_001' including root: 0
  ==> set selinux context: u:object_r:protect_s_data_file:s0
I:addFile '/protect_s/md/MTFW_000' including root: 0
  ==> set selinux context: u:object_r:protect_s_data_file:s0
I:addFile '/protect_s/md/LD83_001' including root: 0
  ==> set selinux context: u:object_r:protect_s_data_file:s0
I:addFile '/protect_s/md/ST34B001' including root: 0
  ==> set selinux context: u:object_r:protect_s_data_file:s0
I:addFile '/protect_s/md/ST36_002' including root: 0
  ==> set selinux context: u:object_r:protect_s_data_file:s0
I:addFile '/protect_s/md/MC00_005' including root: 0
  ==> set selinux context: u:object_r:protect_s_data_file:s0
I:addFile '/protect_s/md/LD81_001' including root: 0
  ==> set selinux context: u:object_r:protect_s_data_file:s0
I:addFile '/protect_s/md/MC06_006' including root: 0
  ==> set selinux context: u:object_r:protect_s_data_file:s0
I:addFile '/protect_s/md/ST37_000' including root: 0
  ==> set selinux context: u:object_r:protect_s_data_file:s0
I:addFile '/protect_s/md/MC05_003' including root: 0
  ==> set selinux context: u:object_r:protect_s_data_file:s0
I:addFile '/protect_s/md/LD97_000' including root: 0
  ==> set selinux context: u:object_r:protect_s_data_file:s0
I:Closing tar
I:Thread id 0 tarList done, 0 archives.
I:Thread ID 0 finished successfully.
I:InfoManager saving '/external_sd/TWRP/BACKUPS/4LEUAY95PBGQZLUC/2021-11-22--05-53-39_RP1A200720011_release-keys/protect_s.info'
I:createTarFork() process ended with RC=0
 * Generating digest...
I:SHA2 Digest: 2852fc10ea1d9ee1d96566c1f3ee924c33990f2f753e1131b48dfd5092080bd8  protect_s.ext4.win
I:digest_filename: /external_sd/TWRP/BACKUPS/4LEUAY95PBGQZLUC/2021-11-22--05-53-39_RP1A200720011_release-keys/protect_s.ext4.win.sha2
 * Digest Created.
I:Partition Backup time: 0
Backing up Super (system vendor product odm)...
I:Reading '/dev/block/by-name/super', writing '/external_sd/TWRP/BACKUPS/4LEUAY95PBGQZLUC/2021-11-22--05-53-39_RP1A200720011_release-keys/super.emmc.win'
I:Error writing destination fd (Operation not permitted)
Backup Failed. Cleaning Backup Folder.
I:Set page: 'action_complete'
crazo7924 commented 2 years ago

Could be a filesystem issue. FAT32 allows upto 4GB per file. Reformatting to exFAT might work. You could also backup to internal storage...

gabtzi commented 2 years ago

Thank you again :) I have small question. After executing

fastboot flash recovery twrp

The twrp recovery loaded fine.

However after a few reboots, the stock recovery loaded again.

Isn't the flash permanent?

crazo7924 commented 2 years ago

It could be due a shell script living inside the stock /vendor which restores stock recovery. I don't exactly remember but it happened when I didn't flash a disabled vbmeta.img or magisk patched boot image

gabtzi commented 2 years ago

I see, I tried to install magisk to automatically handle the boot image but it caused a bootloop so uninstalled it and rebooted. It was then that twrp got removed

crazo7924 commented 2 years ago

Use canary magisk to patch for the meanwhile

gabtzi commented 2 years ago

Unfortunately it didn't work either. I'll try to see if the logs have anything useful

crazo7924 commented 2 years ago

I'm closing this issue as the problem in the title is resolved.

gabtzi commented 2 years ago

Sure yes, I think this issue is magisk related now and no longer twrp related. Thank you very much for your help so far.