0

I'm trying to mount an img file but I can't seem to do it successfully.

When I fun the file command on that .img it returns the following:

$ file file.img 
file.img: data

When I try to use mount on it I get the following:

$ sudo mount file.img test/
mount: you must specify the filesystem type

When I try to tell to use "-t auto" I get the same output:

$ sudo mount -t auto file.img test
mount: you must specify the filesystem type

I don't really know how to extract the files from this img.

Edit 1:

Jofel the following is outputted

$ xxd -a N150R-V1.0.0.5_1.0.1.img | head
0000000: 6465 7669 6365 3a4e 3135 3052 0a76 6572  device:N150R.ver
0000010: 7369 6f6e 3a56 312e 302e 302e 355f 312e  sion:V1.0.0.5_1.
0000020: 302e 310a 7265 6769 6f6e 3a0a 0000 0000  0.1.region:.....
0000030: 0000 0000 0000 0000 0000 0000 0000 0000  ................
*
0000070: 0000 0000 0000 0000 0000 0000 0000 1232  ...............2
0000080: 3036 3132 d9cf 3fc1 5297 2c87 0033 eed0  0612..?.R.,..3..
0000090: 9f05 0000 9f05 0000 9b63 9e62 0505 0700  .........c.b....
00000a0: 4e31 3530 522d 5631 2e30 2e30 2e35 5f31  N150R-V1.0.0.5_1
00000b0: 2e30 2e31 0000 0000 0000 0000 0000 0000  .0.1............
Rui F Ribeiro
  • 56,709
  • 26
  • 150
  • 232
  • 2
    Does mount -o loop file.img test do the job? – Arkadiusz Drabczyk Nov 25 '14 at 22:51
  • The file does probably not contain a file system directly at the beginning. Can you post xxd -a file.img | head, please? – jofel Nov 25 '14 at 23:07
  • @ArkadiuszDrabczyk Unfortunately that did not work.

    Thanks :)

    – RNikoopour Nov 26 '14 at 00:14
  • @jofel I have updated the main post – RNikoopour Nov 26 '14 at 00:16
  • @RNikoopour, where did you get this file in the first place? I mean, what makes you believe it has a filesystem within it. Asking because knowing its origin/story may also help knowing what file system it is supposed to contain. In addition what is the OS you are using, Linux, MacOSX, ...? – Marcelo Nov 26 '14 at 00:32
  • @Marcelo It's the firmware for my wireless router. I wanted to peek inside and see what's going on beneath the hood. I'm using OS X and Ubuntu. – RNikoopour Nov 26 '14 at 05:12
  • @RNikoopour, This is not a FS image then. It certainly contains a FS inside, but this would require a reverse engineering in order to extract the FS portion of the firmware, which is most likely compressed. – Marcelo Nov 26 '14 at 10:20
  • For anyone looking for the answer in the case of a 'normal' img file see this related question: https://unix.stackexchange.com/questions/82314/how-to-find-the-type-of-img-file-and-mount-it – Pierz Nov 09 '17 at 13:16

1 Answers1

1

This file is not an image of a filesystem.

Given the file name, it's a firmware image for an On Networks N150R router, which if I parse the OpenWRT makefiles correctly is a rebranded Netgear WNR612V2.

Given that the file has fairly even byte counts for every byte value except 0, I expect that the file contains:

  • a small bit of Atheros code at the beginning, since this device has an AR71xx chip;
  • a compressed image that is loaded by said bit of code.
  • some padding consisting of null bytes.

The compressed image may or may not be a filesystem, that's more reverse engineering than I care to do. If you want to see what's inside, you'll need to do some reverse engineering (or search the web, quite probably someone's already done it).

  • Hey man,

    You are definitely correct. I will take a look around. I'm just getting into reverse engineering so I'm sorry if this was too complex of a question for this forum.

    Thanks, Dhb!

    – RNikoopour Nov 26 '14 at 05:10
  • @RNikoopour There's a Stack Exchange for that: [reverseengineering.se], if you need help along the way. – Gilles 'SO- stop being evil' Nov 26 '14 at 09:48