Does anyone know how to create a 1:1 disk image of an Android phone? I am taking a forensics course and our final project involves creating tools to recover information from a suspect's Android based phone, however to do this we need to be able to create a 1:1 image of the phone's disk for baseline comparisons. Also would the image be loadable into AVD?
Take a look at nandroid — it will take a full image of each of an Android phone's partitions and return them to you as yaffs2 image files.
I haven't tried it personally, but you should be able to drop these directly into an AVD directory. I can imagine you may have some issues with the hardware suddenly "changing" between a physical device and emulator, but it's worth a try...
Check nandroid.
I have backed up my SDcard and mount it on AVD, but I am not completely sure you can mount the internal mem that nandroid backs up.
Related
I'm running out of internal storage space on my Genymotion emulator.
Strange thing is when looking at properties of this emulator in virtual box I see that it has 16gb external memory.
How can I increase the storage size so that I can install more apps without deleting existing ones.
Shortly, you can increase internal space. But it much more complicated than just resize virtual disk of your VM.
First of all, you increase the size of android_data_disk.vmdk. Here you need copying it several times to convert to vdi format (only vdi size can be changed) and vice versa to get large enough vmdk disk.
After that, you should use another VM to get access to a filesystem on vmdk and resize it. The easiest way is using Ubuntu.
Finally, you can replace android_data_disk.vmdk in your Android VM onto one which you resize.
I am the author of the original tutorial on the Reddit. Full tutorial too long to be placed here, because it contains a lot of screenshots. I leave the link onto this tutorial. Genymotion increase internal storage space
I have been trying to boot an emulator with user data from a real device. When we create an Android emulator, by default it uses the userdata.img file from AVD location. In my case, C:\Users\User.Android\avd\emulator.avd\userdata.img
I want to load my userdata such as pictures, music from my real phone into an emulator. I created a dd image of data partition(I named it userdata.img) from a real device and replaced the original userdata.img file from my emulator.avd location. I also made sure that there is enough disk space while creating this emulator(The size of the image taken from real device is 800MB and DISK SIZE given to emulator is 1000MB).
When I launch the emulator with these modifications, it is not loading with newly added image(It keeps loading for hours and hours but not reaching the home screen). Please guide what are the other steps I need to consider to load it.
Real device is SONY C1505 model running JellyBean(Android 4.1.1). Emulator is also created using JellyBean(Android 4.1).
It could be that the data partition doesn't have enough space - try running the emulator yourself with the option -partition-size 1024
You could also use -show-kernel to see kernel logs to identify the problem
I am learning from the online tutorial to create a new Android Virtual Device. There isn't much written for the settings of the AVD.
Question 1) If I set the SD Card size to (say 2GB), does it literally "eats up" my computer's Harddisk space of 2GB by creating an image file of 2GB?
Question 2) If it does takes up my computer's HD space, in future when I create multiple AVDs, it will requires a lot of HD space am I right?
EDIT: So when I delete the created AVDs, does it free up my HD space immediately, or do I need to do a series of thing to do a "clean" AVD deletion?
Sorry for the addition question. Thank you for all your replies. I will undoubtedly vote up all your constructive solutions by tomorrow.
Yes, the harddisk space is immediately allocated.
# First, I created a new AVD device called 2gb-sdcard and an AVD
# device called no-sdcard (which uses the minimum size of 10MB)
# Both are same device type, SDK, skin, etc.
#
$ cd ~/.android/avd/2gb-sdcard.avd
$ du -h
2.4G .
$ cd ~/.android/avd/no-sdcard.avd
$ du -h
410M .
I checked the same even in Windows. I've Win7-64 and Confirm that the SDCard sizes mentioned for individual AVDs does occupy the hard disk space.
For e.g. I've created AVD NexusS_AVD19 with 100MB SD Card size and I've shown in the screen shot, the memory occupation.
Similarly I've created other AVDs with 1GB and 2GB SDCard sizes and similar details were available when I go to the respective path like : for e.g: C:\Users\RAMA\.android\avd\2GBSDcard.avd
and C:\Users\RAMA\.android\avd\1GBSDcard.avd...i could see the occupation.
In case, if you want single SDCard Image to be used for all the AVDs available to use your memory efficiently / smartly, please follow this link which guides you the steps to go through to achieve this with single SDCard Image
how-to-create-a-new-virtual-sd-card-in-emulator-in-android
Emulator uses .iso disk images to emulate SD card. So SD card consumes that space which you specified.
But in case you need a lot of emulators you can use for all of them a single image. Check this Loading an SD card image
Android 4.2 added multi user support for tablets. Now when you request a path to save files on external storage via a method like Environment.getExternalStorageDirectory() or Context.getExternalFilesDir(null) you get a value like: /storage/emulated/#/Android/data/your.package.name/ The # being a number depending on what user you are currently logged in as.
This works fine but I have noticed that DDMS's File Explorer and also the Android File Transfer are not able to see these files.
DDMS's File Explorer cannot see anything past storage/emulated/ except an empty legacy folder. File Transfer can see the /Android/data/ folder but for an app running as debug, its files are not visible (but they do exist).
Is there any way to get DDMS or File Transfer to work with these devices? (Hopefully without having to root the device...)
Thanks
Aha!
Try /mnt/shell/emulated/N, for various values of N like 0. That seems to map properly on my Nexus 10 and my Galaxy Nexus in DDMS. I cannot comment on the File Transfer tool, though.
BTW, the numbers are not sequential for the users. So on my N10, the original user is 0, the second user is 10.
As Jelly Bean 4.2 supports multi-user profiles, the sd-card browsing has been changed a bit.
You must have ADT v 21 or higher to browse emulated sd-card.
/mnt/shell/emulated/0 is for default user. See the image attached for more detail.
Enlarge Image
I'm trying to re-partition an SDCard on Android, with root access.
I have the 512 byte MBR file, and it shows up as this:
Pos MBRndx Type/Name Size Active Hide Start Sector Sectors
--- ------ ---------- ---- ------ ---- ------------ ------------
0 0 0C-FAT32X 5.9G No No 64 12,124,096
1 1 0C-FAT32X 1.9G No No 12,124,160 3,932,160
What I'm trying to do is resize the 5.9GB partition into 3GB, and then make an EXT partition with the remaining space. I can think of two ways to do this, but I'm a bit stumped in doing either of them:
1) Cross-compile GNU parted, and run it on Android to modify the filesystem in place. This would be my preferred method, but I've been trying to statically compile parted using scratchbox and haven't had much luck, and I haven't been able to dynamically compile for Android in scratchbox either.
2) Directly modify the 512 byte MBR using some utility on my computer, and then dd the file on Android. I have a tool to view the MBR (mbrwiz), but I don't know how to edit it.
Does anybody have any suggestions for either, or possibly a third route?
Maybe I'm not seeing the problem, but it does not look like you want to automate this or make a program with that functionality. So, why not take the SD card out of the Android device and partition it in a card reader on your desktop machine? You could even do a full backup beforehand and avoid losing any data with the partitioning.
You could use fdisk instead of parted, as we used for years before the later tool came about.
Many of the android community roms include a busybox-based fdisk, which with care you could probably install without replacing the actual rom (which may not yet have a fully functional galaxy version)
Not sure how this helps the kernel changing it back problem. You could have a look in /init.rc and see if there's something you can comment out there (you would need to extract, modify, and reflash the ramdisk to make a change to that, splitting and recombining it from the kernel if they did it the same way as the htc phones)
It may also be possible to partition it with external tools when it's in usb mount mode - if the usb storage gadget just treats it as a sea of blocks, presumably you could put a partition table on it?