System files - Android Q&A, Help & Troubleshooting

Where are they located? like baseband, boot, system files. I can flash certain imgs but not others. I am using dell streak. It's broken and i can flash all images except system.img...
Mods please don't move this, it's an old device and I need some veterans on this forum. (dell streak board is dead).
Thanks

ineedhelpman said:
Where are they located? like baseband, boot, system files. I can flash certain imgs but not others. I am using dell streak. It's broken and i can flash all images except system.img...
Mods please don't move this, it's an old device and I need some veterans on this forum. (dell streak board is dead).
Thanks
Click to expand...
Click to collapse
System files can be found in the phones /system folder. Boot files can be found in the root directory ( / ) of the phones filesystem and will have names such as init.rc, etc. If your talking about dumping the boot.img file you will have to figure out what partition block the boot partition is by running the command from terminal emulator or ADB shell:
Code:
mount
Taking note what block the boot partition is then run the following command:
Code:
dd if=path/to/boot/partition of=mnt/sdcard/boot.img
This will dump your boot.img to your sd-card.
Baseband isn't something you can conventionally extract form the phone but similar to baseband is RIL which can be found in /system/lib with a name similar to dell-ril.so.
Sent from my SCH-I535 using xda premium

shimp208 said:
System files can be found in the phones /system folder. Boot files can be found in the root directory ( / ) of the phones filesystem and will have names such as init.rc, etc. If your talking about dumping the boot.img file you will have to figure out what partition block the boot partition is by running the command from terminal emulator or ADB shell:
Code:
mount
Taking note what block the boot partition is then run the following command:
Code:
dd if=path/to/boot/partition of=mnt/sdcard/boot.img
This will dump your boot.img to your sd-card.
Baseband isn't something you can conventionally extract form the phone but similar to baseband is RIL which can be found in /system/lib with a name similar to dell-ril.so.
Sent from my SCH-I535 using xda premium
Click to expand...
Click to collapse
Thanks for your help. But are the files located in the innersd card? or actual hardware? My phone still boots with no innersd card, so I suspect it's located in the hardware? Does ADB give me access to the actual hardware? (something like BIOS). Thanks a ton.

Yes ADB does give you access to the actual hardware or where the system is mounted
Sent from my Vivid 4G using Tapatalk 4 Beta

ineedhelpman said:
Thanks for your help. But are the files located in the innersd card? or actual hardware? My phone still boots with no innersd card, so I suspect it's located in the hardware? Does ADB give me access to the actual hardware? (something like BIOS). Thanks a ton.
Click to expand...
Click to collapse
The files in the /system directory are located on the internal sd-card as part of the /system partition, so is the RIL. The boot.img partition is a part of the tablets internal file system. All of the above mentioned things can be acessed with ADB which gives your access to your devices file system. The reason the device will still boot without a system.img existing is because the device will go into fastboot mode (More integrated with the devices hardware) which is the phone's bootloader mode (Similar to BIOS). Fastboot mode, and the bootloader is separate from the regular Android file system (Semi similar to interfacing with hardware, fastboot is a lower level interaction with the devices file system, the accessing files on your device through ADB) containing boot.img, recovery.img, system.img, cache. img, you can interface with fastboot through fastboot commands and booting your device into fastboot mode or from adb running the command:
Code:
adb reboot-bootloader
That being said if someone were to mess up the PBL (Primary Bootloader), and SBL (Secondary Bootloader) partition on their device then fastboot mode would very likely no longer be accessible.

shimp208 said:
The files in the /system directory are located on the internal sd-card as part of the /system partition, so is the RIL. The boot.img partition is a part of the tablets internal file system. All of the above mentioned things can be acessed with ADB which gives your access to your devices file system. The reason the device will still boot without a system.img existing is because the device will go into fastboot mode (More integrated with the devices hardware) which is the phone's bootloader mode (Similar to BIOS). Fastboot mode, and the bootloader is separate from the regular Android file system (Semi similar to interfacing with hardware, fastboot is a lower level interaction with the devices file system, the accessing files on your device through ADB) containing boot.img, recovery.img, system.img, cache. img, you can interface with fastboot through fastboot commands and booting your device into fastboot mode or from adb running the command:
Code:
adb reboot-bootloader
That being said if someone were to mess up the PBL (Primary Bootloader), and SBL (Secondary Bootloader) partition on their device then fastboot mode would very likely no longer be accessible.
Click to expand...
Click to collapse
Thanks. That means if I can boot into fastboot then my hardware has no problem? Then I am wondering why would some image fail to flash? Since system.img is flashed onto the innersd card, then I would expect no problem in flashing it onto a working sd card, no?

ineedhelpman said:
Thanks. That means if I can boot into fastboot then my hardware has no problem? Then I am wondering why would some image fail to flash? Since system.img is flashed onto the innersd card, then I would expect no problem in flashing it onto a working sd card, no?
Click to expand...
Click to collapse
If you can get into fastboot mode then your device shouldn't have a hardware problem (But it is still possible for there to be a hardware problem with other parts of your phone). What system.img file are you trying to flash? Additionally system.img is flashed to the phones internal sd-card (NAND storage) on the phones internal file system not the phones external sd-card.

shimp208 said:
If you can get into fastboot mode then your device shouldn't have a hardware problem (But it is still possible for there to be a hardware problem with other parts of your phone). What system.img file are you trying to flash? Additionally system.img is flashed to the phones internal sd-card (NAND storage) on the phones internal file system not the phones external sd-card.
Click to expand...
Click to collapse
I am trying to flash the stock system.img that came with the recovery tool (I'm using dell streak). It fails if I manually flash it, and it fails with the tool. I assume that fastboot and qdl automatically directs it to its right place? I mean I just use "fastboot -i 0x413c (that's the vendor id) system system.img" and it fails. Everytime I test I use a fresh copy of the internal sd, so it should be just as it was out of the factory. Does flashing on a blank fat32 sd card work?

can you tell the exact error message it is printing when it fails?
what does your bootloader say when in fastboot mode?
it should say something like "FASTBOOT USB" and there should be some text above this line.
can you tell us this text?
flashing images over fastboot flashes always to internal flash memory not to sdcards, thats important to know.
so you cannot format your sdcard with fat32 and expect your fastboot command to write anything to it.

In addition to what eightysoft said make sure your also running the latest version of fastboot which should be version 1.0.3.1. Plus try running the fastboot flash command without supplying the vendor id (Make sure you have disconnect any other Android devices from your computer when doing this first).

Related

fastboot data partition

hey,
Long story short, I royally screwed things up on my I/O tab. So now I'm trying to restore a nandroid backup via fastboot. The only problem is that I don't know the name of that data parition. I've tried
Code:
fastboot flash userdata data.img
and
Code:
fastboot flash data data.img
is there any way I can see the partition table in fastboot? I should be able to get adb if I need it as well.
Thanks,
Sam
maybe I don't have the name wrong. maybe it's just the fact that /data keeps getting mounted as read only for no apparent reason..

BCB, BootCnt, and the bootdata partition

Maybe some of you guys have figured this out already but it's probably important to note for people developing custom recovery or boot ROMs.
There is a partition on the internal flash named "bootdata" that stores a files named BCB and BootCnt. The secure bootloader updates BootCnt on every non-sdcard boot and if it gets too high it will automatically boot into the recovery partition instead of the boot partition. So, if you're making any custom ROM to be run from the internal flash then you'll want to reset that file in a boot script somewhere. The shell command "dd if=/dev/zero of=/bootdata/BootCnt bs=1 count=4" would do it (Assuming you've mounted the bootdata partition )
The BCB file is similar in that if the secure bootloader boots into the recovery partition for any reason, it will write to that file and will always boot into the recovery partition until that file is cleared. The shell command to clear that file is "dd if=/dev/zero of=/bootdata/BCB bs=1 count=1088"
The bootdata partition just contains a standard vfat filesystem so you just mount it normally.
And for the love of your god do not delete those files! If you do then booting from internal memory will continue to boot into the recovery partition until they are replaced. You would be able to boot from an SD card to replace them though.
bauwks said:
Maybe some of you guys have figured this out already but it's probably important to note for people developing custom recovery or boot ROMs.
There is a partition on the internal flash named "bootdata" that stores a files named BCB and BootCnt. The secure bootloader updates BootCnt on every non-sdcard boot and if it gets too high it will automatically boot into the recovery partition instead of the boot partition. So, if you're making any custom ROM to be run from the internal flash then you'll want to reset that file in a boot script somewhere. The shell command "dd if=/dev/zero of=/bootdata/BootCnt bs=1 count=4" would do it (Assuming you've mounted the bootdata partition )
The BCB file is similar in that if the secure bootloader boots into the recovery partition for any reason, it will write to that file and will always boot into the recovery partition until that file is cleared. The shell command to clear that file is "dd if=/dev/zero of=/bootdata/BCB bs=1 count=1088"
The bootdata partition just contains a standard vfat filesystem so you just mount it normally.
And for the love of your god do not delete those files! If you do then booting from internal memory will continue to boot into the recovery partition until they are replaced. You would be able to boot from an SD card to replace them though.
Click to expand...
Click to collapse
Yup. On the NookColor these had the same functions. Lived on /rom instead of /bootdata however.
Note: My CWM image doesn't probably handle BCB or bootcnt yet (I do in my CM9 image but that is another thing )
nemith said:
Yup. On the NookColor these had the same functions. Lived on /rom instead of /bootdata however.
Note: My CWM image doesn't probably handle BCB or bootcnt yet (I do in my CM9 image but that is another thing )
Click to expand...
Click to collapse
My Ubuntu image does not mount this partition.
bauwks said:
Maybe some of you guys have figured this out already but it's probably important to note for people developing custom recovery or boot ROMs.
And for the love of your god do not delete those files! If you do then booting from internal memory will continue to boot into the recovery partition until they are replaced. You would be able to boot from an SD card to replace them though.
Click to expand...
Click to collapse
Yep-- this is all taken care of in cm9
Update: I don't think you mentioned, but for completeness, there's also the serial file in /rom at devconf/DeviceId that will trigger a rom reformat if it goes missing. there are also some edge conditions that will trigger recovery/flashing such as the presence of certain update.zip files on SD. Also SD boots are treated differently by default, don't increase the boot count, etc. In short, this is very similar to how NookColor works with the added disadvantage of having to deal with, rather than simply ignore or remove, these various "go to recovery' conditions.
I can verify that Bauwks script works and allows internal booting without a bootloop.
Nemith, if you find the time can you add something like this to your CWM recovery.img? I think just adding the /bootdata mount and dd calls to the init.rc file should work. I was going to build my own CWM .img but figured you already had the source code handy.
I'de like to dabble in a CM7 port soon, while CM9 and Ubuntu ports are in-work
Thanks for all your hard work guys!
CWM recovery bootloop
bauwks said:
And for the love of your god do not delete those files! If you do then booting from internal memory will continue to boot into the recovery partition until they are replaced. You would be able to boot from an SD card to replace them though.
Click to expand...
Click to collapse
I flashed cm9 alpha 0.2 on my nook tablet using the nook tablet recovery apk. It booted into cyanoboot, however it had an error message that said disc majic error. I noticed I had put the wrong boot image on my sd card from the alpha 0.1. I rebooted 8 times and booted into cwm. Now in cwm I flashed a backup of my tablet. I then made the common mistake of clicking reboot recovery. Then trying to fix the bootloop into cwm recovery while unaware of the sevarity of what I was doing I went into mounts and storage and formated each bootdata, cache, data, emmc, rom, and system. I just restored my backup again and now I know what I need to do. My stock Nook recovery was overwriten when I clicked reboot recovery. Also I formated my rom folder and that might have contained my serial number and info.
I basicaly deleted my partions. while stuck in the cwm boot loop. Can you please send me or send me the link to a step by step way that I can get my nook tablet 16gb stuck in the cwm boot loop back to normal.
I tried using fastboot but I dont know the commands to open it. Also I dont know how to use adb either. I have a 2gig, and a 256 mb micro sd. I have a windows pc. Can you show me step by step how to restore those partions, how to do it on adb or fastboot, or the update zip method. I need help as soon as possible. Thanks.
Its similar to this
This seems like the only place folks are looking at bcb in much detail, so I thought I'd post an observation: on the simple touch, if you boot from noogie after issuing an "erase and deregister" command from the OS, the bcb file contains command strings.
I don't know what reads the strings, but after erase and deregister, bcb seems to be used to tell the device to run recovery:
recovery --wipe_data
is an ascii string from bcb on a deregistered and not yet rebooted glowworm - I put the noogie disk in, did the erase and deregister, then dumped the partitions once it came back up.
the command flags available in recovery as of cupcake are documented at
http://www.netmite.com/android/mydroid/cupcake/bootable/recovery/recovery.c
Just wanted to bump this so more people know about it, because I didn't and I reformat my /bootdata.
Can anyone make an image of it for restore purposes?
An image of /factory would be nice as well But less important as we're all (likely) using CM.
edit
Actually disregard this.. I have the nook hd+, but the /bootdata format info will probably be handy for any nook device.
Don't format bootdata or factory!
roustabout said:
This seems like the only place folks are looking at bcb in much detail, so I thought I'd post an observation: on the simple touch, if you boot from noogie after issuing an "erase and deregister" command from the OS, the bcb file contains command strings.
I don't know what reads the strings, but after erase and deregister, bcb seems to be used to tell the device to run recovery:
recovery --wipe_data
is an ascii string from bcb on a deregistered and not yet rebooted glowworm - I put the noogie disk in, did the erase and deregister, then dumped the partitions once it came back up.
the command flags available in recovery as of cupcake are documented at
http://www.netmite.com/android/mydroid/cupcake/bootable/recovery/recovery.c
Click to expand...
Click to collapse
pbassjunk said:
Just wanted to bump this so more people know about it, because I didn't and I reformat my /bootdata.
Can anyone make an image of it for restore purposes?
Click to expand...
Click to collapse
To fix the Recovery Boot Loop caused by invalid/missing BCB and BootCnt in /bootdata, flash Succulent's flashable_fix_bootloop.zip posted at his blog http://iamafanof.wordpress.com/2013...-1-jellybean-sdcard-img-for-nook-tablet-0110/ (see under heading "I am stuck in a recovery boot loop?").
An image of /factory would be nice as well But less important as we're all (likely) using CM.
Click to expand...
Click to collapse
/factory contains a backup copy of stock ROM as well as a backup copy of the device data in /rom partition (romdata.zip), the latter includes data that is unique to each Nook (such as MAC address, security certificate, etc.) and hence is not replaceable with a copy from another Nook.
...
Don't format bootdata or factory!
Click to expand...
Click to collapse
Nor /romdata. See http://forum.xda-developers.com/showpost.php?p=37515697&postcount=31 for more info.
I created a flashable zip as well, which should reset that partition to a stock (zero-count) state. Hopefully it's not unique per device (I don't think it is, as I've used this successfully on two distinct devices.)
Is a fix being baked into any official roms, CM and the like? I don't mind the workaround via scripting, but the two I bought and modded I gave as gifts, so when they break (they both have) I definitely hear about it and receive the units back again for fixing.
ZIP is attached. Please let me know if it works or doesn't work for you, should you end up using it.
weasel5i2 said:
I created a flashable zip as well, which should reset that partition to a stock (zero-count) state. Hopefully it's not unique per device (I don't think it is, as I've used this successfully on two distinct devices.)
Is a fix being baked into any official roms, CM and the like? I don't mind the workaround via scripting, but the two I bought and modded I gave as gifts, so when they break (they both have) I definitely hear about it and receive the units back again for fixing.
ZIP is attached. Please let me know if it works or doesn't work for you, should you end up using it.
Click to expand...
Click to collapse
Having trouble with the /bootdata/BCB/ and my nook hd+ booting into recovery. Am I just supposed to flash the fix to the SD card boot partition?
tinkering said:
Having trouble with the /bootdata/BCB/ and my nook hd+ booting into recovery. Am I just supposed to flash the fix to the SD card boot partition?
Click to expand...
Click to collapse
You might want to see leapinlar's tip #10 in his post http://forum.xda-developers.com/showpost.php?p=35811322&postcount=1 for the Nook HD/HD+.
digixmax said:
You might want to see leapinlar's tip #10 in his post http://forum.xda-developers.com/showpost.php?p=35811322&postcount=1 for the Nook HD/HD+.
Click to expand...
Click to collapse
Thanks for the link to leapinlar's post. That helps me to understand the problem and fix a bit better. I didn't see the zip that seemed to fit my situation on his post. I did a SD install non-rooted and I see only only emmc fixes on his post. I tried your fix with these steps and I must have done something wrong. Maybe you could point me in the right direction.
DL, unzip, write image to sd using PC(could only write the .img, don't know what to do with the folder) , put SD into nook HD+, try to boot= no boot
Does the device have to be rooted to flash the repair zip? I don't think I am utilizing the fix properly.
tinkering said:
...
DL, unzip, write image to sd using PC(could only write the .img, don't know what to do with the folder) , put SD into nook HD+, try to boot= no boot
Does the device have to be rooted to flash the repair zip? I don't think I am utilizing the fix properly.
Click to expand...
Click to collapse
No, the device does not have to be rooted to get flashed.
If this is your first time trying to boot off SD, it's possible that your HD+ is one of the units that have difficulty booting off SD card -- see http://forum.xda-developers.com/showthread.php?t=2288688.
Is your device still on stock ROM and stock Recovery?
digixmax said:
No, the device does not have to be rooted to get flashed.
If this is your first time trying to boot off SD, it's possible that your HD+ is one of the units that have difficulty booting off SD card -- see http://forum.xda-developers.com/showthread.php?t=2288688.
Is your device still on stock ROM and stock Recovery?
Click to expand...
Click to collapse
Sorry, I probably should have updated my last post. I was attempting to flash the repair incorrectly. Unfortunately, I have a new problem and have moved my question to the "[Q][Panic] HD+ won't boot, can access CWM SD but can't mount sdcard or emmc" thread.
The device would boot from SD. Was running CM10.2 and CWM recovery. The trouble I am having now is that I can't flash anything from the SD in CWM recovery because it wont mount the SD. (See details in thread referenced above.)
Thanks

[Q] Getting data off the phone

So my phone is in a bootloop. I flashed CWM recovery via Odin to try to mount the internal storage since i have some things i need to recover before flashing new rom. in CWM under "mounts and storage" i tried everything, but nothing would show up in a computer. Also, mounting system says "Error mounting system" and adb devices doesn't recognize my device now with CWM. it did with stock recovery though, when put in adb mode
edit: flashed original revocery, got adb working, found some adbfileexplorer.jar file from the forums, that shows my device and some files/folders, eg /efs, /preload , cache etc. so they are not the files i'm looking for.
And when writing adb shell in cmd, i get "- exec '/system/bin/sh' failed: No such file or directory (2) -" error
Try philz recovery and aroma file manager to access the data partition.
A sudden boot loop in normal use usually means one or more of the partitions are corrupt, so you may not be able to access data.
boomboomer said:
Try philz recovery and aroma file manager to access the data partition.
A sudden boot loop in normal use usually means one or more of the partitions are corrupt, so you may not be able to access data.
Click to expand...
Click to collapse
Ok well now i got to use adb and via command "adb pull /" i pulled everything there was (This is the right command to do it, right?)
but only two folders, sys and tmp were pulled, none of which contain any relevant data, it would appear

Access User Data in Recovery Backup

Hi,
I have a Wiko Lenny 3 phone and need to recover the pictures. The unlock code is lost, the touchscreen doesn't work anymore. My ideas so far:
1. I used the "Backup user data" feature of the stock recovery to a SD card.
Since I cannot upload an image until I have 10 posts, the recovery is like
"
Android Recovery
alps/full_v3702/v3702
6.0/MRA58K/1453981211
user/release-keys
Volume down to move highlight;
enter Volume up key to select.
----------------------------------------
Reboot system now
Reboot to bootloader
Apply update from ADB
Apply update from SD card
Wipe data/factory reset
Wipe cache partition
Backup user data ---> this is what I used
Restore user data
Root integrity check
Mount /system
View recovery logs
Power off
----------------------------------------
SD card free space: 29564MB
User data allocated: 11893MB
backup file: userdata_20190929_172118.backup
Backup user data complete.
"
But how to access the data? Tutorials which I found didn't help (merging the files in Linux, remove 512 Bytes and rename to zip to be able to extract "some" data: it isn't recognized as zip file). Is it possible to restore this user data to a virtual device somehow to access the data?
2. Removing the code: Following a German instruction (I'm not allowed to link it, sorry).
ADB doesn't recognize the device. Probably because USB debugging is turned off and I cannot turn it on without unlocking the device.
I don't do this very often, so my knowledge about ADB and Android is limited.
Does someone have a helping hint? Thank you in advance!
Regards
Martin
Martin_2 said:
Hi,
I have a Wiko Lenny 3 phone and need to recover the pictures. The unlock code is lost, the touchscreen doesn't work anymore. My ideas so far:
1. I used the "Backup user data" feature of the stock recovery to a SD card.
Since I cannot upload an image until I have 10 posts, the recovery is like
"
Android Recovery
alps/full_v3702/v3702
6.0/MRA58K/1453981211
user/release-keys
Volume down to move highlight;
enter Volume up key to select.
----------------------------------------
Reboot system now
Reboot to bootloader
Apply update from ADB
Apply update from SD card
Wipe data/factory reset
Wipe cache partition
Backup user data ---> this is what I used
Restore user data
Root integrity check
Mount /system
View recovery logs
Power off
----------------------------------------
SD card free space: 29564MB
User data allocated: 11893MB
backup file: userdata_20190929_172118.backup
Backup user data complete.
"
But how to access the data? Tutorials which I found didn't help (merging the files in Linux, remove 512 Bytes and rename to zip to be able to extract "some" data: it isn't recognized as zip file). Is it possible to restore this user data to a virtual device somehow to access the data?
2. Removing the code: Following a German instruction (I'm not allowed to link it, sorry).
ADB doesn't recognize the device. Probably because USB debugging is turned off and I cannot turn it on without unlocking the device.
I don't do this very often, so my knowledge about ADB and Android is limited.
Does someone have a helping hint? Thank you in advance!
Regards
Martin
Click to expand...
Click to collapse
Martín only way you could access them pictures is if you had twrp
([emoji3590]09-09-18[emoji3590])
Thanks. Is it possible to flash TWRP without losing data and without access via ADB?
Martin_2 said:
Thanks. Is it possible to flash TWRP without losing data and without access via ADB?
Click to expand...
Click to collapse
If your phone has twrp available and it's a Samsung you can flash it and you won't be able to do a twrp backup without formatting data to have data partition mountable in twrp to flash decrypt zip to do a backup however you don't need to format to be able to mount system partition once system is mounted you can use the twrp file explorer to delete files to delete your screen lock so you can enter the phone
([emoji3590]09-09-18[emoji3590])
PoochyX said:
If your phone has twrp available and it's a Samsung you can flash it and you won't be able to do a twrp backup without formatting data to have data partition mountable in twrp to flash decrypt zip to do a backup however you don't need to format to be able to mount system partition once system is mounted you can use the twrp file explorer to delete files to delete your screen lock so you can enter the phone
([emoji3590]09-09-18[emoji3590])
Click to expand...
Click to collapse
It's a Wiko Lenny 3, no Samsung. Sorry, I don't get it without punctuation.
Do I get it right, that
- If TWRP is available for my phone I can flash it, but I need to format all my data (no option)
- I can flash a "decrypt zip" to do a backup (what is it, where do I get it?)
- I can mount the system partition and can use the TWRP file explorer to delete files (how can I mount it?)
Thanks.
Problem solved, I could access all the data in the backup from the stock recovery!
This is how it worked:
In short: Make a backup of all user files in the stock recovery to a MicroSD card, put it to a Linux desktop, merge the backup files by skipping the first 512 bytes of each file, copy the merged file to Windows, extract it with 7zip.
In long:
1. I put an empty 32GB FAT32 formatted MicroSD card in the MicroSD slot of the Wiko Lenny 3
2. I used "Backup user data" from the Stock Recovery (see my first post). It took a few minutes until ~12GB of user data were written to the card. The stock recovery told me when it was done.
3. I copied all files (6 files, userdata_20190929_172118.backup to userdata_20190929_172118.backup5) to a Linux environment (Linux Mint 19.2)
4. The rest is explained in this video: https://www.youtube.com/watch?v=cY4cKKimEFU. If it is offline, I will explain here.
Do not use something like "cat userdata_yyyymmdd_HHMMSS.backup* > userdata_yyyymmdd_HHMMSS.backup" to merge all files into one because it will add the unnessesary 512 bytes header of all .backup files to the merged file. Instead copy all content except the first 512 bytes to another file and append the content from the other files to it, also by skipping the first 512 bytes.
5. This command will copy the content of the first file "userdata_20190929_172118.backup" to a new file "img.ext4":
Code:
dd if=userdata_20190929_172118.backup skip=512 bs=128k iflag=nocache,skip_bytes oflag=nocache,append conv=notrunc of=img.ext4
6. Repeat using the same command to append the content of all other files to the file "img.ext4" by skipping the first 512 bytes. Be sure to increase the number of the source file extention in the command. Next one therefore is:
Code:
dd if=userdata_20190929_172118.backup1 skip=512 bs=128k iflag=nocache,skip_bytes oflag=nocache,append conv=notrunc of=img.ext4
7. Repeat with all files
8. Copy the file "img.ext4" to a NTFS formatted USB stick or an external hard drive and go on with a Windows environment. The reason is that Linux will prevent opening some important folders
9. Install 7zip
10. Extract the file "img.ext4" with 7zip. If you are searching for pictures, you will find them in the subfolder "\media\0\DCIM\Camera"
Martin_2 said:
Problem solved, I could access all the data in the backup from the stock recovery!
This is how it worked:
In short: Make a backup of all user files in the stock recovery to a MicroSD card, put it to a Linux desktop, merge the backup files by skipping the first 512 bytes of each file, copy the merged file to Windows, extract it with 7zip.
In long:
1. I put an empty 32GB FAT32 formatted MicroSD card in the MicroSD slot of the Wiko Lenny 3
2. I used "Backup user data" from the Stock Recovery (see my first post). It took a few minutes until ~12GB of user data were written to the card. The stock recovery told me when it was done.
3. I copied all files (6 files, userdata_20190929_172118.backup to userdata_20190929_172118.backup5) to a Linux environment (Linux Mint 19.2)
4. The rest is explained in this video:
. If it is offline, I will explain here.
Do not use something like "cat userdata_yyyymmdd_HHMMSS.backup* > userdata_yyyymmdd_HHMMSS.backup" to merge all files into one because it will add the unnessesary 512 bytes header of all .backup files to the merged file. Instead copy all content except the first 512 bytes to another file and append the content from the other files to it, also by skipping the first 512 bytes.
5. This command will copy the content of the first file "userdata_20190929_172118.backup" to a new file "img.ext4":
Code:
dd if=userdata_20190929_172118.backup skip=512 bs=128k iflag=nocache,skip_bytes oflag=nocache,append conv=notrunc of=img.ext4
6. Repeat using the same command to append the content of all other files to the file "img.ext4" by skipping the first 512 bytes. Be sure to increase the number of the source file extention in the command. Next one therefore is:
Code:
dd if=userdata_20190929_172118.backup1 skip=512 bs=128k iflag=nocache,skip_bytes oflag=nocache,append conv=notrunc of=img.ext4
7. Repeat with all files
8. Copy the file "img.ext4" to a NTFS formatted USB stick or an external hard drive and go on with a Windows environment. The reason is that Linux will prevent opening some important folders
9. Install 7zip
10. Extract the file "img.ext4" with 7zip. If you are searching for pictures, you will find them in the subfolder "\media\0\DCIM\Camera"
Click to expand...
Click to collapse
I have the exact same problem with an older 2017 ALCATEL Pixi Unite A466BG. The code is lost and there's some photos we need off of it. I followed these instructions but when I got the img.ext4 file on Windows and tried extracting it with 7zip, I got an error that "ext4" is not an archive file.
I was hoping to see if anyone else had ideas of possibly why 7zip wasn't recognizing it? I had 3 backup files to merge (backup, backup1, backup2).

Mount device as an external disk via UMS?

Hi there,
Would it be possible to mount Android device as an external disk via UMS on Windows system?
If so, how to achieve it?
If not, is there an alternative solution?
The objective is to be able to scan Android device in Windows.
Currently,
1. the device does not appear as an external drive (but as a portable / removable device) in "File Manager" on Windows;
2. Via UMS Enabler, only external SD card is mounted as an external drive, not the device.
Thanks in advance.
no, we can't mount (unrooted) android phone. UMS was replaced with MTP, only emulated storage (and MicroSD Card) is accessable via USB. Note MTP does not provide any device (can't open files) it's only transfer protocol to copy files from/to PC (such as adb file transfer).
to suggest alternative solution - what is the real problem/reason behind?
aIecxs said:
no, we can't mount (unrooted) android phone. UMS was replaced with MTP, only emulated storage (and MicroSD Card) is accessable via USB. Note MTP does not provide any device (can't open files) it's only transfer protocol to copy files from/to PC (such as adb file transfer).
to suggest alternative solution - what is the real problem/reason behind?
Click to expand...
Click to collapse
Thanks for your reply.
The final objective is to recover data from Android device.
The idea is to follow the steps below:
Step 1: create img file by identifying and extracting the userdata partition adb pull /dev/block/mmcblk0p57 57.img (assuming that mmcblk0p57 is userdata partition) ;
Step 2: scan the img file by software (eg. Recuva) to recover data.
However, the image file created (57.img) is under the format of NDIF disk image, Recuva is unable to find anything in it.
Apparently, Recuva can only recover files from NTFS, FAT, and exFAT-formatted drives.
So, I am trying to
- convert NDIF to a format readable by Recuva;
- look for some other softwares able to scan NDIF;
- if possible, mount Android device as a scannable drive to softwares as Recuva.
it's nearly impossible to recover data. on locked bootloader, you don't have any access to block partition, all you can see is some part of storage files provided by FUSE or SDCardFS via MTP.
assuming you find working exploit to gain root access (such as mtk-su) it is possible to dump decrypted userdata partition without the need of unlocking bootloader.
common root method (like Magisk) may have worked on locked bootloader up to Android 7 for some devices, but rooting Android 8 requires avb/dm-verity disabled which requires unlocked bootloader.
unlocking bootloader forces factory reset, makes it impossible to recover any data.
offline dump of partition via low level access is always possible, but useless for data recovery as the userdata partition is encrypted.
if we are talking about recovery of deleted files, it's pointless, even on unencrypted device.
see my answer in other thread
https://forum.xda-developers.com/t/...droid-without-usb-debug-pc-connection.4132813
This is no help to you, but as a point of information.
I've written recoveries that mount the entire flash over UMS.
On a Windows box you could save/restore the whole thing as a raw backup.
Since you're running in recovery no partitions are being used.
Windows doesn't understand ext2-ext4 (directly) so that's not much use.
Also, all the data will be encrypted anyway.
(This is for the 2021 Nook Glow.)
as your device is very old there is a slim chance to by-pass dm-verity with Magisk and root device on locked bootloader. it might even possible to install TWRP in case recovery partition is not protected by dm-verity (might brick device)
according to fstab.qcom device uses (FDE) full-disk encryption therefore /dev/block/mmcblk0p57 would be only garbage.
so only chance for recovery attempts is let android (or TWRP) decrypt userdata partition (cannot be done offline) and get dump of decrypted block device dm-0 for examination on PC.
you need flash tool that is capable of read back partitions off device (for backup purposes) I recommend edl.py for linux, and find method for enter EDL mode (such as deep flash cable or test point method)
once you managed that step, use older MagiskManager-v7.3.4.apk and root boot.img with both options preserve force encryption + dm-verity enabled.
if you flash that magisk_patched.img back into boot partition from EDL mode it may by-pass bootloader signature verification and dm-verity. or it will brick device (you can unbrick from EDL mode)
aIecxs said:
it's nearly impossible to recover data. on locked bootloader, you don't have any access to block partition, all you can see is some part of storage files provided by FUSE or SDCardFS via MTP.
assuming you find working exploit to gain root access (such as mtk-su) it is possible to dump decrypted userdata partition without the need of unlocking bootloader.
common root method (like Magisk) may have worked on locked bootloader up to Android 7 for some devices, but rooting Android 8 requires avb/dm-verity disabled which requires unlocked bootloader.
unlocking bootloader forces factory reset, makes it impossible to recover any data.
offline dump of partition via low level access is always possible, but useless for data recovery as the userdata partition is encrypted.
if we are talking about recovery of deleted files, it's pointless, even on unencrypted device.
see my answer in other thread
https://forum.xda-developers.com/t/...droid-without-usb-debug-pc-connection.4132813
Click to expand...
Click to collapse
Actually the "old" Oneplus 2 was rooted but the bootloader remains unlocked...
aIecxs said:
according to fstab.qcom device uses (FDE) full-disk encryption therefore /dev/block/mmcblk0p57 would be only garbage.
Click to expand...
Click to collapse
In other thread you stated device is not encrypted.
https://forum.xda-developers.com/t/recuva-to-recover-data-from-userdata-partition.4528803
Therefore all you have to do is read /dev/block/mmcblk0p43 userdata block partition off device and run photorec or extundelete on partition image.
aIecxs said:
you need flash tool that is capable of read back partitions off device (for backup purposes) I recommend edl.py for linux, and find method for enter EDL mode (such as deep flash cable or test point method)
Click to expand...
Click to collapse
wenyendev said:
Would it be possible to mount Android device as an external disk via UMS on Windows system?
If so, how to achieve it?
Click to expand...
Click to collapse
Windows cannot mount ext4 partition, Linux can (and WSL Windows Subsystem Linux).
However, according to @mirfatif's great answer UMS requires custom kernel (and therefore unlocked bootloader)
https://android.stackexchange.com/a/205559
aIecxs said:
Windows cannot mount ext4 partition, Linux can (and WSL Windows Subsystem Linux).
However, according to @mirfatif's great answer UMS requires custom kernel (and therefore unlocked bootloader)
https://android.stackexchange.com/a/205559
Click to expand...
Click to collapse
Do you mean that if I connect Android device to Linux system, it would appear instantly as a readable (probably writable drive) like C disk on Windows system?
No. one have to compile own custom kernel from source code.

Categories

Resources