How to create an .img file from .iso on Ubuntu?

I would like to create an .img file containing Ubuntu 13.10. I know how to get the .iso, but instructions for how to 'convert' it to .img I only found under Mac (see, for example, here) -- however, I work on Ubuntu 13.10. Which are the steps necessary to create the .img file?

Background information: I would like to use the .img to run it with Complete Linux Installer on Android. Complete Linux Installer already offers .img files (see here), but they are too small. Ubuntu only "sees" the size of the .img file which is far too small to be productive -- which is why I would like to create a larger .img file. Using resize2fs myImage.img 4G, I tried to make the image larger, but Ubuntu run from such an image still believes the .img is small, so my hope is that by creating a larger .img right away, Ubuntu "sees" the larger space. I know I'm on thin ice here...


I would take a stab in the dark, but you are trying to make an img file from an iso, right? If that's the case then there isn't any difference between iso's and img's apart the extension:

There is no difference in the structure of ISO and IMG formats if the IMG file is uncompressed. It is possible for an IMG format file to be renamed with the ISO file extension and then opened in software that only recognizes the ISO file format. This is an effective way of accessing disc information in programs that do not handle the IMG format.

(source)

Wikipedia also seems to agree:

ISO images are another type of optical disc image files, which commonly use the .iso file extension, but sometimes use the .img file extension as well. They are similar to the raw optical disc images, but contain only one track with computer data obtained from an optical disc. They can not contain multiple tracks, nor audio or video tracks. They also do not contain the control headers and error correction fields of CD-ROM or DVD sectors that raw disc images usually store. Their internal format follows the structure of an optical disc file system, commonly ISO 9660 (for CDs) or UDF (for DVDs). The CUE/BIN and CCD/IMG formats, which usually contain raw disc images, can also store ISO images instead.

So, how to convert an iso to img? Just change the extension:

rename 's/\.iso(?=[^.iso]*$)/.img/g' *

Now, to create an img, you should use dd and save it into a file called img.


Disclamer: I do not state that below correctly answer the question, but google search found me that Q&A and I hope my answer will help to solve similar issues.

I've found an advice to convert iso to img to boot from USB. I was not able to boot from USB with written downloaded ISO. Some time later I found an advice to convert to img via:

geteltorito f1.iso > f1.img

And indeed I was able to boot from USB where I've written img file. The files were different:

$ file 6muj31uc.iso
6muj31uc.iso: ISO 9660 CD-ROM filesystem data '6muj31us' (bootable)
$ file 6muj31uc.img  
6muj31uc.img: DOS/MBR boot sector; partition 1 : ID=0x4, active, start-CHS (0x0,1,1), end-CHS (0xe,63,32), startsector 32, 30688 sectors

Boot image sounds like img file:

man geteltorito

geteltorito is a Perl script which extracts the initial/default El Torito boot image from a CD if one exists.