6

I've tried mounting them in Ubuntu, no luck, mount does not recognize the yaffs2 file system. I've tried yaffs2utils and ./unyaffs2 but it doesn't actually unpack the img files, I've posted an issue about this on the Google Code page here.

The img files were created by CWM Recovery as a backup, and I'm trying to dig into the file system to find old contacts, and if I could just get the .db files I think I got it from there (I'll just run sqlite3 and peek into the db and print the contacts on paper or something).

Any help appreciated!

4
  • I'm not sure if this will let you retrieve contacts but it's worth a shot: play.google.com/store/apps/… Commented Jun 23, 2012 at 15:22
  • Titanium Backup v5+ has the capability to extract from CWM backups as well :)
    – t0mm13b
    Commented Jun 23, 2012 at 15:25
  • I remember trying AppExtractor on the phone in question, it was unable to find any contacts so nothing was imported. If this was awfully important I'd try paying for TB but for now I'm just curious how to access the img files.
    – pzkpfw
    Commented Jun 23, 2012 at 17:16
  • Here's a very similar question which I've tried to answer: android.stackexchange.com/a/111010/109855
    – Jon Coombs
    Commented Jun 1, 2015 at 3:48

3 Answers 3

7

To unpack a YAFFS2 image, you can use the free unyaffs tool, which is available as pre-build ELF-binary (for Linux) from this page at code.google.com. This page also contains hints on how to obtain the source code, so you could build the binary yourself e.g. with gcc (gcc -o unyaffs unyaffs.c).

I use this tool myself, it works fine on Ubuntu 8.04 32bit as well as Ubuntu 12.04 64bit (with the ia32-libs package installed).

Place the binary e.g. in /usr/local/bin (which is in your $PATH), so you can access it from everywhere. Put the image file you want to extract in an empty directory (unyaffs always seems to extract files directly into the folder the image file is in), and then call unyaffs with the image file name as only parameter, e.g. unyaffs data.img. After that, you will find the contents of that file system/image unpacked, and can investigate them -- e.g.

  • SMS/MMS in data/com.android.providers.telephony/databases/mmssms.db
  • Multimedia Metadata in data/com.android.providers.media/databases/*.db
  • Calendar data in data/com.android.providers.calendar/databases/calendar.db

As I just investigated a MotoBlur image, contacts in my case have been stored to data/com.motorola.blur.providers.contacts/databases/contacts2.db -- they are probably in a different location in your case (a guess: data/com.android.providers.contacts/databases/*.db).

The sqlite3 command works on them, naturally. If you prefer a graphical frontend, I can recommend you the sqliteman package (comes with a binary of the same name, which accepts the database file as parameter).

0
2

You can install Titanium Backup and buy the Pro key.

It allows to extract app backups from saved CWM nandroid backups.

Usage: Launch Titanium Backup, Menu > More > "Extract from nandroid backup"

3
  • How old does the CWM nandroid backup have to be to be considered old? I'm pretty sure it was a fairly recent version of CWM that made this backup.
    – pzkpfw
    Commented Jun 23, 2012 at 17:15
  • sorry, bad wording. fixed.
    – ce4
    Commented Jun 23, 2012 at 17:21
  • Ok, I'll inform my friend that this is an option if he keeps nagging me about the lost contacts ;)
    – pzkpfw
    Commented Jun 23, 2012 at 17:28
0

What ROM was it in the backup?

If the filesystem was ext4 you could mount the img to loopback like this:

This is on Linux btw,

sudo mount -o loop,ro,noexec,noload system.img ~/mountedImageDir

Then go into that directory ~/mountedImageDir and you should be able to see the directory structure in there :)

5
  • 3
    He said it was yaffs2... Commented Jun 23, 2012 at 15:22
  • What version of CWM is the key question.
    – t0mm13b
    Commented Jun 23, 2012 at 15:24
  • The filesystem is not ext4 but yaffs2, and I already tried a "clean" mount with just -o loop, no luck. (I'm pretty sure it was the newest version of CWM, as it was only a week or so ago the backup was made) The ROM in the backup was some kind of stock Xperia Arc variant, before we installed CyanogenMod.
    – pzkpfw
    Commented Jun 23, 2012 at 17:13
  • you can also do this: tjworld.net/wiki/Linux/Kernel/SimulateNandMtdDevice
    – ce4
    Commented Jun 23, 2012 at 19:21
  • 1
    Even easier &free: play.google.com/store/apps/details?id=fr.wdscript.yaffsexplorer
    – ce4
    Commented Jun 23, 2012 at 23:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .