8

I'm a Windows/Mac/Ubuntu and Android user, so I know what I'm talking about, when I say: How do I open binary image files? (.img) They just won't open, on any OS…

I'm an Android dev… I'm currently working on a ROM, (I also program, using Windows) but I need to extract files, from .img files. I've converted them to .ext4.img but they just aren't recognized by Linux (Definitly not by Android), by Mac OS or Windows. In other words, I can't open, extract or mount them.

Can anyone help me? I'm kinda confused…

2

5 Answers 5

8

Update: See stackoverflow.com - Mount Android emulator images


Short Answer is, there are 3 types:

  • Regular filesystem images, that can be mounted with -o loop option
  • YAFFS2 filesystem images, which currently cannot be mounted in Ubuntu and have to be unpacked
  • EXT4 filesystem images that have been further processed by the Android toolchain and need to be converted to regular images with simg2img from the Android toolchain.

So, you have a binary image extracted from an Android device, is that correct?

What does the file command say about the file? Something like this?

$ file system.img 
system.img: VMS Alpha executable

That system image is extracted via nandroid from a Samsung Galaxy i7500. Most of those old Android devices used yaffs as a file system. Knowing what you are dealing with greatly helps. (i.e. Which device are we talking about? Where is that image from?)

Converting images into other file systems will only produce garbage at best if you do not have installed support for the file system in question. Unfortunately there is no package for Ubuntu. But that question has already been asked and answered: Create yaffs2 file system on Ubuntu Server 11.10

There is also the possibility that this image is encrypted. But why would someone give you an encrypted image?

Since this is mostly about Android and you call yourself an Android Developer, please read the Android documentation, again. It's supposed to be all in there. If not ask your question at android.stackexchange.com, XDA-Developers, RootzWiki and the like. And please do not put a ROM on the net for hundreds of people to use unless you REALLY know what you are doing and you read the documentation. Doing it for fame is dangerous and bad for the users!

1

for windows just mount the image through any virtual device program( like daemon tools) and for linux, mount the .img file like you mount other iso files:

# mkdir -p /mnt/disk
# mount -o loop disk.img /mnt/disk
# cd /mnt/disk
# ls -l

does that help you?

2
  • else you can use the normal iso mount software like gisomount for ubuntu
    – ashutosh
    May 1, 2012 at 13:26
  • The commands will work if the right file system is installed. He needs to find out which file system the image contains. It is not ISO 9660 or UDF so tools for mounting images of optical media are not supposed to work.
    – LiveWireBT
    May 1, 2012 at 15:39
0

MTK Extractor can extract boot.img, system.img, system.new.dat, recovery.img files and perhaps other *.img. It can also repack them back again.

For me it extracted a boot.img file that 7-zip couldn't read well but not broken or incomplete firmware images.

-1

It's a linux image file. You can open it in windows with ext2explore which you can download here.

-2

You could you either use the Furius ISO Mount or the AcetoneISO to mount .img files, just search them on the ubuntu software centre and install them.

Furius ISO Mount AcetoneISO

1
  • 1
    Both tools are intended to be used for ISO 9660 or UDF images. Optical media so to say. While some software creates .img files of optimcal media and vice versa, .img files can contain everything that can be dumped via dd command. dd if=/dev/urandom of=urandom.img bs=100M count=1 would for instance just create a file with 100 MB of random data.
    – LiveWireBT
    May 1, 2012 at 15:49

You must log in to answer this question.

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