Read android partition file image under linux

I try to read a backup file of my android userdata parition from my phone, did using adb pull command.
under the phone the partition is type f2fs but i don’t find the way to mount the .img file and read the data

@dahikino f2fs is blacklisted/unsupported, to override see;
https://en.opensuse.org/SDB:FilesystemBlacklisting

Thanks for your answer,

but my need is not for permanent purpose, juste the time to read the the partition file, so there is a way to unblacklist only f2fs ? i saw there is the f2fs-tools module available on zypper !

@dahikino yes, it tells you how in the link I posted… modprobe f2fs if only want temporarily just use n in your response…

After unblacklist f2fs via : sudo modprobe f2fs

sudo mount -o loop -t f2fs xiaomi_mi10tpro_userdata.img /mnt/xiaomi_mi10tpro_userdata

generate a error : wrong file system type, wrong option, wrong superblock on /dev/loop38, missing code page or auxiliary program, or other error.

have you a idea what is wrong ?

First, please always copy/paste the whole command and output sequence ito the post. And use the </> button for that. People here do not like stories, but real; computer facts.

I do not think your mount statement is in line with what I see in

man 8 mount


I am not sure what you want to show with the above.

First, please do not use screenshots when not really needed. But copy/paste from your terminal emulator direct in your post and use the </> button from the composer tool bar. That looks like (just a stupid example):

henk@boven:~> mount /test
mount: /test: can't find in /etc/fstab.
henk@boven:~>

Second. I see you use a non-English language system. This is the English language part of the forums. So please, precede all command with LANG=C. See the difference:

boven:~ # ls aap
ls: kan geen toegang krijgen tot 'aap': Bestand of map bestaat niet
boven:~ # LANG=C ls aap
ls: cannot access 'aap': No such file or directory
boven:~ # 

Then trying to find out what your file is, we can maybe use file:

file ........../userdata.img

ok, thanks a lot to help me to better use the forum : ok_hand:

i’m not able to identiy if it is a problem of file sytem type or if it is because encryption.

❯ LANG=C sudo mount -o loop -t f2fs  userdata.img /mnt/xiaomi_mi10tpro_userdata 
[sudo] password for root: 
mount: /mnt/xiaomi_mi10tpro_userdata: wrong fs type, bad option, bad superblock on /dev/loop38, missing codepage or helper program, or other error.
       dmesg(1) may have more information after failed mount system call.
❯ file userdata.img
userdata.img: data

❯ LANG=C sudo fdisk -l userdata.img
Disk userdata.img: 226.28 GiB, 242964354560 bytes, 474539755 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

Well, file does not help very much.

I am not sure why you do fdisk -l. It is NOT a disk, it is a file
system.

Indeed, I am also not sure if the file userdata.img is a correct file system (you did not explain how you made it). But did you follow the suggestion in looking at dmesg. Nowadays you better use journalctl instead of dmesg:
Just before you do a mount enter on another terminal (as root):

journalctl -f

then do the mount at the first terminal and look at the messages at the other. You can then stop the message flow with Ctrl-C.

Thanks for the replay !

i did use the command :

 6037  adb pull /dev/block/bootdevice/by-name/userdata xiaomi_mi10tpro_userdata.img

and i did use the tool on github :
too to make a dump (dd command is used into)

in both case, the two dump give me the same result.

févr. 23 16:45:06 localhost.localdomain sudo[13395]:    david : TTY=pts/2 ; PWD=/BACKUP2/BACKUP/Android/MI10T/platform-tools/dump ; USER=root ; COMMAND=/usr/bin/journalctl -f
févr. 23 16:45:06 localhost.localdomain sudo[13395]: pam_kwallet5(sudo:setcred): pam_kwallet5: pam_sm_setcred
févr. 23 16:45:06 localhost.localdomain sudo[13395]: pam_unix(sudo:session): session opened for user root(uid=0) by david(uid=1000)
févr. 23 16:45:06 localhost.localdomain sudo[13395]: pam_kwallet5(sudo:session): pam_kwallet5: pam_sm_open_session
févr. 23 16:45:06 localhost.localdomain sudo[13395]: pam_kwallet5(sudo:session): pam_kwallet5: we were already executed
févr. 23 16:45:11 localhost.localdomain sudo[13401]:    david : TTY=pts/1 ; PWD=/BACKUP2/BACKUP/Android/MI10T/platform-tools/dump ; USER=root ; COMMAND=/usr/bin/mount -o loop -t f2fs userdata.img /mnt/xiaomi_mi10tpro_userdata
févr. 23 16:45:11 localhost.localdomain sudo[13401]: pam_kwallet5(sudo:setcred): pam_kwallet5: pam_sm_setcred
févr. 23 16:45:11 localhost.localdomain sudo[13401]: pam_unix(sudo:session): session opened for user root(uid=0) by david(uid=1000)
févr. 23 16:45:11 localhost.localdomain sudo[13401]: pam_kwallet5(sudo:session): pam_kwallet5: pam_sm_open_session
févr. 23 16:45:11 localhost.localdomain sudo[13401]: pam_kwallet5(sudo:session): pam_kwallet5: we were already executed
févr. 23 16:45:11 localhost.localdomain sudo[13401]: pam_unix(sudo:session): session closed for user root
févr. 23 16:45:11 localhost.localdomain sudo[13401]: pam_kwallet5(sudo:session): pam_kwallet5: pam_sm_close_session
févr. 23 16:45:11 localhost.localdomain sudo[13401]: pam_kwallet5(sudo:setcred): pam_kwallet5: pam_sm_setcred
févr. 23 16:45:11 localhost.localdomain kernel: loop38: detected capacity change from 0 to 474539755
févr. 23 16:45:11 localhost.localdomain kernel: F2FS-fs (loop38): Magic Mismatch, valid(0xf2f52010) - read(0x8e47b1c4)
févr. 23 16:45:11 localhost.localdomain kernel: F2FS-fs (loop38): Can't find valid F2FS filesystem in 1th superblock
févr. 23 16:45:11 localhost.localdomain kernel: F2FS-fs (loop38): Magic Mismatch, valid(0xf2f52010) - read(0x78bd7672)
févr. 23 16:45:11 localhost.localdomain kernel: F2FS-fs (loop38): Can't find valid F2FS filesystem in 2th superblock
févr. 23 16:45:11 localhost.localdomain systemd-udevd[1015]: Configuration file /etc/udev/rules.d/55-brother-brscan4-libsane-type1.rules is marked executable. Please remove executable permission bits. Proceeding anyway.
févr. 23 16:45:11 localhost.localdomain systemd-udevd[1015]: /etc/udev/rules.d/55-brother-brscan4-libsane-type1.rules:9 Invalid key 'SYSFS'.
févr. 23 16:45:11 localhost.localdomain systemd-udevd[1015]: /etc/udev/rules.d/55-brother-libsane-type1-inst.rules:14 Invalid key 'SYSFS'.
févr. 23 16:45:11 localhost.localdomain systemd-udevd[1015]: /etc/udev/rules.d/99-megasync-udev.rules:1 The line has no effect, ignoring.
févr. 23 16:45:11 localhost.localdomain udisksd[2884]: Error getting 'loop38' information: Failed to get status of the device loop38: No such device or address (g-bd-loop-error-quark, 2)
févr. 23 16:45:11 localhost.localdomain udisksd[2884]: Error getting 'loop38' information: Failed to get status of the device loop38: No such device or address (g-bd-loop-error-quark, 2)
févr. 23 16:45:11 localhost.localdomain udisksd[2884]: Error getting 'loop38' information: Failed to get status of the device loop38: No such device or address (g-bd-loop-error-quark, 2)

Sorry, but I have no idea about the Android part.

The messages seem to confirm that the file is not an image of an f2fs file system. Both the superblock and the alternative superblock do not contain the required information.

Maybe other (with more Android knowledge) can tune in here.

If you want to know how to access Android userdata partition content you need to ask on Android support channels (and I am pretty sure you need to ask on support channels specific to your hardware). My best guess is that this partition is encrypted. How to decrypt in this case (or even simply find out whether it is encrypted) is again out of scope for this forum, unless you are lucky and someone here has also experience with it.

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