I am trying to mount a file image, like this

mount -o loop /tmp/apps.img /media/apps

But I get the following:

mount: you must specify the filesystem type

I try ext3:

mount -o loop /tmp/apps.img /media/apps -t ext3

dmesg says:

error: can't find ext3 filesystem on dev loop6.

I've also tried ext2, vfat etc. How can I detect the filesystem type of apps.img?

  • Could you try mount -o loop /tmp/apps.img /media/apps -t auto or does auto not work for filesystem images? – Mokubai Mar 11 '11 at 13:39
  • Is the image an image of a partition or an entire disk? – Majenko Mar 11 '11 at 13:55
  • @Matt: I don't know, this is linux embeded device firmware files, like : 100AEO6C0-1001H-apps.img, 100AEO6C0-1001H-loader.img, 100AEO6C0-1001H-rootfs1.img, 100AEO6C0-1001H-splash.img, 100AEO6C0-1001H-kernel.img – halorty Mar 16 '11 at 12:07
  • @Mokubai , I tried, It doesn't work. – halorty Mar 16 '11 at 12:08

I would use the file command combined with dd.

Full disk with MBR (change file.img to your file name):

$ dd if=file.img | file -
/dev/stdin: x86 boot sector; partition 1: ID=0x7, [.........snip.........]

So it is a full disk image and you want info on the first partition?

$ seq 100 | while read i ; do dd if=file.img bs=512 skip=$i | file - ; done | grep -v '/dev/stdin: data'
....garbage lines with perhaps useful informations,
if it's the case, give more info here.....

Perhaps it is compressed.

$ dd if=file.img | file -
/dev/stdin: gzip compressed data, from Unix, last modified: Wed Feb 23 19:26:14 2011

No problem, uncompress it on the fly:

$ dd if=file.img | gunzip | file -
/dev/stdin: ASCII cpio archive (SVR4 with no CRC)
  • I try $ dd if=file.img | file - output is: /dev/stdin: data – halorty Mar 16 '11 at 6:29
  • /dev/stdin: SysEx File - /dev/stdin: SysEx File - /dev/stdin: DOS executable (COM) /dev/stdin: DBase 3 data file /dev/stdin: DBase 3 data file with memo(s) /dev/stdin: MPEG-4 LOAS, 4 or more streams, 8 or more streams /dev/stdin: DBase 3 data file with memo(s) – halorty Mar 16 '11 at 12:02
  • @halorty: mostly unusable garbage... let's try dd if=file.img | strings | head -20 and see if there are readable things. – shellholic Mar 16 '11 at 14:10
  • I try, output : Linux-, 1.00(AEO.6), kernel and messy strings. – halorty Mar 17 '11 at 7:01

blkid -o value -s TYPE /tmp/apps.img


While the @shellholic answer has merit, the easier tool is "disktype" from: http://disktype.sourceforge.net/

Here's an example:

> sudo disktype /mnt/data0/xxxx.img 

--- /mnt/data0/xxxx.img
Regular file, size 30 GiB (32212254720 bytes)
DOS/MBR partition map
Partition 1: 29.99 GiB (32201938944 bytes, 62894412 sectors from 63, bootable)
  Type 0x07 (HPFS/NTFS)
  Windows NTLDR boot loader
  NTFS file system
    Volume size 29.99 GiB (32201938432 bytes, 62894411 sectors)

The programs "blkid" and "file" can detect filesystem type in some simple cases, but "disktype" is easier and more comprehensive. Depending on your distribution, you may need to compile it yourself with "make".

  • perfect! I also needed to knew what were the partitions! – rodvlopes Jul 31 '14 at 0:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.