Sample Header Ad - 728x90

Access encrypted /data Partition over ADB and recovery (TWRP, LineageOS 16, Redmi Note 4)

5 votes
1 answer
8929 views
I have a Redmi Note 4 (mido) Android phone with a broken screen: the screen lights up, but otherwise it stays entirely "black". I already replaced the screen, but with no luck - the cause of the error must be somewhere else. The phone has data-encryption enabled with an unlock-pattern. Now I'm trying to access the data on the phone, but did not succeed so far. Here is what I've done so far: - Connected the phone to a PC over USB. - Started the phone in fastboot-mode by pressing and holding the buttons vol-down and power simultaneously. - Booted the latest version of TWRP for mido : fastboot boot twrp-3.3.1-0-mido.img. - Opened adb shell and presumably managed to decrypt the data (found instructions in the TWRP Commandline Guide ): TWRP decrypt: ~ # twrp decrypt 41236 Attempting to decrypt data partition via command line. Data successfully decrypted, new block device: '/dev/block/dm-0' Updating partition details... ...done Unable to mount storage ~ # Unfortunately, the block device /dev/block/dm-0 cannot be mounted. This is the result of fdisk: ~ # fdisk -l /dev/block/dm-0 Disk /dev/block/dm-0: 57.0 GB, 57033580032 bytes 255 heads, 63 sectors/track, 6933 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk /dev/block/dm-0 doesn't contain a valid partition table So I pulled an Image of the block device with adb pull /dev/block/dm-0. This image has a size of 57,033,580,032 bytes. I tried to mount this image in Ubuntu 20.04, but did not succeed: # file /media/sf_U_DRIVE/Note4Data/dm-0.img /media/sf_U_DRIVE/Note4Data/dm-0.img: data # fdisk -l /media/sf_U_DRIVE/Note4Data/dm-0.img Disk /media/sf_U_DRIVE/Note4Data/dm-0.img: 53,12 GiB, 57033580032 bytes, 111393711 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes # mount -o loop /media/sf_U_DRIVE/Note4Data/dm-0.img /mnt/Note4Data mount: /mnt/Note4Data: wrong fs type, bad option, bad superblock on /dev/loop3, missing codepage or helper program, or other error. # mount -t ext4 -o loop /media/sf_U_DRIVE/Note4Data/dm-0.img /mnt/Note4Data [ 6986.649794] EXT4-fs (loop3): VFS: Can't find ext4 filesystem mount: /mnt/Note4Data: wrong fs type, bad option, bad superblock on /dev/loop3, missing codepage or helper program, or other error. # mount -t f2fs -o loop /media/sf_U_DRIVE/Note4Data/dm-0.img /mnt/Note4Data [ 7004.610412] F2FS-fs (loop3): Can't find valid F2FS filesystem in 1th superblock [ 7004.615289] F2FS-fs (loop3): Can't find valid F2FS filesystem in 2th superblock mount: /mnt/Note4Data: wrong fs type, bad option, bad superblock on /dev/loop3, missing codepage or helper program, or other error. I wonder if I need to mount the image in another way (with offsets? with LVM?) or if the decryption did not work. TWRP creates a log file in **/tmp/recovery.log**. After running the twrp decrypt command, the following lines are added: I:Command 'decrypt 41236' received I:Set page: 'singleaction_page' I:operation_start: 'TWRP CLI Command' Attempting to decrypt data partition via command line. D:crypt_ftr->fs_size = 111393711 I:starting verify_hw_fde_passwd I:Using scrypt with keymaster for cryptfs KDF I:TWRP keymaster max API: 3 I:Signing safely-padded objectkeymaster module name is Keymaster QTI HAL keymaster version is 256 Found keymaster1 module, using keymaster1 API. I:Extra parameters for dm_crypt: fde_enabled ice I:target_type = req-cryptI:real_blk_name = /dev/block/mmcblk0p49, extra_params = fde_enabled iceE:test mount returned 0 I:Found no matching fstab entry for uevent device '/devices/virtual/block/dm-0' - add I:Found no matching fstab entry for uevent device '/devices/virtual/block/dm-0' - change Data successfully decrypted, new block device: '/dev/block/dm-0' I:Can't probe device /dev/block/dm-0 I:Unable to mount '/data' I:Actual block device: '/dev/block/dm-0', current file system: 'ext4' Updating partition details... I:Can't probe device /dev/block/dm-0 I:Unable to mount '/data' I:Actual block device: '/dev/block/dm-0', current file system: 'ext4' I:Unable to mount '/sdcard1' I:Actual block device: '', current file system: 'auto' I:Unable to mount '/usb-otg' I:Actual block device: '', current file system: 'auto' ...done I:Can't probe device /dev/block/dm-0 I:Unable to mount '/data' I:Actual block device: '/dev/block/dm-0', current file system: 'ext4' Unable to mount storage /data | /dev/block/dm-0 | Size: 0MB Used: 0MB Free: 0MB Backup Size: 0MB 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_Encr Symlink_Path: /data/media Symlink_Mount_Point: /sdcard Primary_Block_Device: /dev/block/mmcblk0p49 Decrypted_Block_Device: /dev/block/dm-0 Crypto_Key_Location: footer Length: -16384 Display_Name: data Storage_Name: Internal Storage Backup_Path: /data Backup_Name: data Backup_Display_Name: Data Storage_Path: /data/media Current_File_System: ext4 Fstab_File_System: ext4 Backup_Method: files MTP_Storage_ID: 65539 I:Unmounting main partitions... I:Done reading ORS command from command line I:operation_end - status=0 I:Set page: 'decrypt_pattern' 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:Can't probe device /dev/block/dm-0 I:Unable to mount '/data' I:Actual block device: '/dev/block/dm-0', current file system: 'ext4' I:Unable to mount settings storage during GUI startup. I:Copying file /cache/recovery/log to /cache/recovery/last_log I:Can't probe device /dev/block/dm-0 I:Unable to mount '/data' I:Actual block device: '/dev/block/dm-0', current file system: 'ext4' I:Can't probe device /dev/block/dm-0 I:Unable to mount '/data' I:Actual block device: '/dev/block/dm-0', current file system: 'ext4' Unable to mount /data/media/TWRP/.twrps I:Attempt to load settings from settings file... I:InfoManager file '/data/media/TWRP/.twrps' not found. I:Backup folder set to '/data/media/TWRP/BACKUPS/f707e0500604' I:Copying file /etc/recovery.fstab to /cache/recovery/recovery.fstab I:Version number saved to '/cache/recovery/.version' I:Can't probe device /dev/block/dm-0 I:Unable to mount '/data' I:Actual block device: '/dev/block/dm-0', current file system: 'ext4' I:Unable to mount '/sdcard1' I:Actual block device: '', current file system: 'auto' I:Unable to mount '/usb-otg' I:Actual block device: '', current file system: 'auto' I:TWFunc::Set_Brightness: Setting brightness control to 255 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 '/data/media/TWRP/BACKUPS/f707e0500604' I:Starting MTP I:[MTP] Starting MTP I:Can't probe device /dev/block/dm-0 I:Unable to mount '/data' I:Actual block device: '/dev/block/dm-0', current file system: 'ext4' MTP Enabled I:Check_Lifetime_Writes result: '648837' I:Switching packages (TWRP) I:Starting Adb Backup FIFO I:Set page: 'main' I:Set page: 'clear_vars' I:Set page: 'main2' I:[MTP] created new mtpserver object I:[MTP] MtpServer::run fd: 18 I:TWFunc::Set_Brightness: Setting brightness control to 5 I:TWFunc::Set_Brightness: Setting brightness control to 0 Any ideas what I should try next or where I could find helpful information?
Asked by x-ray (151 rep)
Apr 27, 2020, 06:41 PM
Last activity: Feb 24, 2025, 08:03 PM