Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content

TWRP backup of data partition fails

  • /e/ version: Latest as at 2020/06/14
  • Device model: Sony Xperia XZ1 Compact (lilac)
  • When it started to occur: When system flashed
  • Reproducible with the last /e/ version:
  • Reproducible with LineageOS: Don't know. Will try later

Summary

Using TWRP recovery, backup of data partition fails

  • The device is unusable
  • The bug is the source of a data loss or a big waste of time
  • The bug concerns a third party app
  • The bug concerns security
  • The bug concerns privacy

The problem

Steps to reproduce Boot into recovery Select Backup Choose data partition Set storage to SD card Start backup

What is the current behavior? Backup starts, progress indicator shows progress to about 45%, then fails with the following error message `CreateTarFor() process ended with error 255'

What is the expected correct behavior?

Data partition should be backed up successfully

Technical informations

Using TWRP 3.3.1-0-f45c3a81

Xperia ZX1 Compact (lily) using GSI for not yet supported treble phones [2020/06/14]

Data is encrypted

Relevant logs (adb logcat)

<snip>
Partition Logs:
/boot | /dev/block/sda38 | Size: 64MB
   Flags: Can_Be_Backed_Up IsPresent Can_Flash_Img SlotSelect 
   Primary_Block_Device: /dev/block/sda38
   Display_Name: Boot
   Storage_Name: boot
   Backup_Path: /boot
   Backup_Name: boot
   Backup_Display_Name: Boot
   Storage_Path: /boot
   Current_File_System: emmc
   Fstab_File_System: emmc
   Backup_Method: dd

/system | /dev/block/sda65 | Size: 4923MB Used: 1914MB Free: 3008MB Backup Size: 1914MB
   Flags: Can_Be_Mounted Can_Be_Wiped Can_Be_Backed_Up Wipe_Available_in_GUI IsPresent SlotSelect Mount_Read_Only 
   Primary_Block_Device: /dev/block/sda65
   Display_Name: System
   Storage_Name: System
   Backup_Path: /system
   Backup_Name: system
   Backup_Display_Name: System
   Storage_Path: /system
   Current_File_System: ext4
   Fstab_File_System: ext4
   Backup_Method: files

<snip>

/data | /dev/block/sda66 | Size: 22169MB Used: 2507MB Free: 19243MB Backup Size: 2507MB
   Flags: Can_Be_Mounted Can_Be_Wiped Can_Be_Backed_Up Wipe_During_Factory_Reset Wipe_Available_in_GUI IsPresent Can_Be_Encrypted Is_Encrypted Has_Data_Media Can_Encrypt_Backup Use_Userdata_Encryption Is_Storage Is_Settings_Storage 
   Symlink_Path: /data/media/0
   Symlink_Mount_Point: /sdcard
   Primary_Block_Device: /dev/block/sda66
   Display_Name: Data
   Storage_Name: Internal Storage
   Backup_Path: /data
   Backup_Name: data
   Backup_Display_Name: Data
   Storage_Path: /data/media/0
   Current_File_System: ext4
   Fstab_File_System: ext4
   Backup_Method: files
   MTP_Storage_ID: 65537

<snip>

I:Is encrypted, do decrypt page first
I:Switching packages (TWRP)
I:Set page: 'decrypt'
I:Set page: 'decrypt_pattern'
I:Set page: 'trydecrypt'
I:operation_start: 'Decrypt'

<snip>

Decrypted Successfully!
Data successfully decrypted
I:Backup folder set to '/data/media/0/TWRP/BACKUPS/BH905XY79E'
Updating partition details...
I:mount -o bind '/data/media/0' '/sdcard' process ended with RC=0
I:Data backup size is 2507MB, free: 19243MB.
I:Unable to mount '/usb-otg'
I:Actual block device: '', current file system: 'auto'
...done
I:mount -o bind '/data/media/0' '/sdcard' process ended with RC=0
/data | /dev/block/sda66 | Size: 22169MB Used: 2507MB Free: 19243MB Backup Size: 2507MB
   Flags: Can_Be_Mounted Can_Be_Wiped Can_Be_Backed_Up Wipe_During_Factory_Reset Wipe_Available_in_GUI IsPresent Can_Be_Encrypted Is_Encrypted Is_Decrypted Has_Data_Media Can_Encrypt_Backup Use_Userdata_Encryption Is_Storage Is_Settings_Storage 
   Symlink_Path: /data/media/0
   Symlink_Mount_Point: /sdcard
   Primary_Block_Device: /dev/block/sda66
   Display_Name: data
   Storage_Name: Internal Storage
   Backup_Path: /data
   Backup_Name: data
   Backup_Display_Name: Data
   Storage_Path: /data/media/0
   Current_File_System: ext4
   Fstab_File_System: ext4
   Backup_Method: files
   MTP_Storage_ID: 65537

I:Unmounting main partitions...
tw_get_context got selinux context: u:object_r:media_rw_data_file:s0
I:Got default contexts and file mode for storage files.
I:Decrypt adopted storage starting
I:PageManager::LoadFileToBuffer loading filename: '/data/system/storage.xml' directly
I:successfully loaded storage.xml
I:Set page: 'main'
I:Set page: 'clear_vars'
I:Set page: 'main2'
I:operation_end - status=0
I:Set page: 'main'
I:Set page: 'clear_vars'
I:Set page: 'main2'
SELinux contexts loaded from /file_contexts
Full SELinux support is present.
I:Switching packages (TWRP)
I:TWFunc::Fixup_Time: Pre-fix date and time: 1972-10-20--12-24-53
I:TWFunc::Fixup_Time: Setting time offset from file /sys/class/rtc/rtc0/since_epoch
I:TWFunc::Fixup_Time: will attempt to use the ats files now.
I:TWFunc::Fixup_Time: no ats files found, leaving untouched!
I:Copying file /cache/recovery/log to /cache/recovery/last_log
I:Attempt to load settings from settings file...
I:InfoManager loading from '/data/media/0/TWRP/.twrps'.
I:Backup folder set to '/sdcard1/TWRP/BACKUPS/BH905XY79E'
I:Copying file /etc/recovery.fstab to /cache/recovery/recovery.fstab
I:Version number saved to '/cache/recovery/.version'
I:Unable to mount '/usb-otg'
I:Actual block device: '', current file system: 'auto'
I:TWFunc::Set_Brightness: Setting brightness control to 1600
I:PageManager::LoadFileToBuffer loading filename: '/twres/languages/en.xml' directly
parsing languageFile
parsing languageFile done
I:Translating partition display names
I:Backup folder set to '/sdcard1/TWRP/BACKUPS/BH905XY79E'
I:Starting MTP
I:Cannot find file /sys/class/android_usb/android0/idVendor
I:Cannot find file /sys/class/android_usb/android0/idProduct
I:sending message to add 65537 '/data/media/0' 'Internal Storage'
I:Message sent, add storage ID: 65537 '/data/media/0'
I:sending message to add 65538 '/sdcard1' 'Micro SDcard'
I:Message sent, add storage ID: 65538 '/sdcard1'
MTP Enabled
I:[MTP] Starting MTP
I:Check_Lifetime_Writes result: '84273'
I:Switching packages (TWRP)
I:Set page: 'main'
I:Starting Adb Backup FIFO
I:Set page: 'clear_vars'
I:Set page: 'main2'
I:[MTP] created new mtpserver object
E:[MTP] Failed to start usb driver!I:[MTP] mtppipe add storage 65537 '/data/media/0'
I:[MTP] mtppipe add storage 65538 '/sdcard1'
I:Set page: 'backup'
I:Set overlay: 'select_storage'
I:Set overlay: ''
I:Set page: 'clear_vars'
I:Set page: 'backup'
I:Set page: 'backup_run'
I:operation_start: 'Nandroid'
Updating partition details...
I:Data backup size is 2507MB, free: 19243MB.
I:Unable to mount '/usb-otg'
I:Actual block device: '', current file system: 'auto'
...done
I:Backup Name is: '1972-10-20--07-25-16_lineage_treble_arm64_aeN-userdebug_9_PQ3A19'
I:Backup_Folder is: '/sdcard1/TWRP/BACKUPS/BH905XY79E/1972-10-20--07-25-16_lineage_treble_arm64_aeN-userdebug_9_PQ3A19'
I:Calculating backup details...
 * Total number of partitions to back up: 1
 * Total size of all data: 2507MB
 * Available space: 73031MB
[BACKUP STARTED]
 * Backup Folder: /sdcard1/TWRP/BACKUPS/BH905XY79E/1972-10-20--07-25-16_lineage_treble_arm64_aeN-userdebug_9_PQ3A19
Invalid encryption mode 'ice:aes-256-heh'
Backing up Data (excl. storage)...
Backups of Data do not include any files in internal storage such as pictures or downloads.
Invalid encryption mode 'ice:aes-256-heh'
Breaking backup file into multiple archives...
I:Creating backup...
I:Creating tar file '/sdcard1/TWRP/BACKUPS/BH905XY79E/1972-10-20--07-25-16_lineage_treble_arm64_aeN-userdebug_9_PQ3A19/data.ext4.win000'
I:addFile '/data/drm' including root: 1
  ==> set selinux context: u:object_r:drm_data_file:s0
found policy '/data/drm' - '1DK' - '74eb76520abc0d49'
I:addFile '/data/drm/fwdlock' including root: 1

<snip>
I:addFile '/data/system_ce/0/accounts_ce.db' including root: 1
  ==> set selinux context: u:object_r:system_data_file:s0
I:addFile '/data/system_ce/10' including root: 1
  ==> set selinux context: u:object_r:system_data_file:s0
failed to lookup tar policy for '/data/system_ce/10' - '61f8d274e51e08be'
I:Error adding file '/data/system_ce/10' to '/sdcard1/TWRP/BACKUPS/BH905XY79E/1972-10-20--07-25-16_lineage_treble_arm64_aeN-userdebug_9_PQ3A19/data.ext4.win000'
Error creating backup.
I:ERROR tarList for thread ID 0
Error creating backup.
I:InfoManager saving '/sdcard1/TWRP/BACKUPS/BH905XY79E/1972-10-20--07-25-16_lineage_treble_arm64_aeN-userdebug_9_PQ3A19/data.info'
createTarFork() process ended with ERROR: 255
Backup Failed. Cleaning Backup Folder.
I:Copying file /tmp/recovery.log to /sdcard1/TWRP/BACKUPS/BH905XY79E/1972-10-20--07-25-16_lineage_treble_arm64_aeN-userdebug_9_PQ3A19/recovery.log
I:Set page: 'action_complete'
I:operation_end - status=1

Relevant screenshots

Solutions

Workaround

Possible fixes