How to mount an “.img” file (extracted from modem firmware) on Linux? [closed]

匿名 (未验证) 提交于 2019-12-03 02:59:02

问题:

I extracted an .img file from my DSL modem's firmware. I want to see what's inside. So I tried:

root@kursat-ubuntu:/tmp# mount rootfs.img /tmp/1 mount: /tmp/rootfs.img is not a block device (maybe try `-o loop'?) root@kursat-ubuntu:/tmp# mount -o loop rootfs.img /tmp/1 mount: wrong fs type, bad option, bad superblock on /dev/loop0,        missing codepage or helper program, or other error        In some cases useful info is found in syslog - try        dmesg | tail  or so root@kursat-ubuntu:/tmp# mount -o loop -t squashfs rootfs.img /tmp/1 mount: wrong fs type, bad option, bad superblock on /dev/loop0,        missing codepage or helper program, or other error        In some cases useful info is found in syslog - try        dmesg | tail  or so 

file informations is here:

root@kursat-ubuntu:/tmp# file rootfs.img  rootfs.img: Squashfs filesystem, big endian, version 2.0, 1369418 bytes, 382 inodes, blocksize: 65536 bytes, created: Tue May  3 13:44:22 2011 

dmesg output:

[ 7756.312067] SQUASHFS error: Can't find a SQUASHFS superblock on loop0 

unsquashsfs output:

...  Failed to write squashfs-root/lib/modules/2.6.8.1/extra/bcmprocfs.ko, skipping [==================================|                                                                             ] 118/377  31% gzip uncompress failed with error code -3  ...  Failed to write squashfs-root/webs/cgi-bin/login, skipping [========================================================================|                                       ] 247/377  65% gzip uncompress failed with error code -3  Failed to write squashfs-root/webs/top.html, skipping [==============================================================================|                                 ] 268/377  71% gzip uncompress failed with error code -3  ...  Failed to write squashfs-root/usr/bin/ledctl, skipping [==============================================================================================================| ] 376/377  99% gzip uncompress failed with error code -3  Failed to write squashfs-root/usr/sbin/brctl, skipping [===============================================================================================================|] 377/377 100% created 188 files created 46 directories created 52 symlinks created 95 devices created 1 fifos 

How can I mount it?

Thank you.

回答1:

try to use the -r flag (read-only)

# mount -r -o loop file.img /mnt

if that doesn't work try:

# unsquashfs



回答2:

try this:

root@kursat-ubuntu:/tmp# mount rootfs.img /tmp/1 -o loop 


回答3:

Are you missing the corresponding kernel module provided by―the last time I needed it―an extra package?

Assuming you're using Ubuntu, try

$ apt-cache search squashfs 

to see if there is still an extra package for squashfs and

$ dpkg -l | grep squashfs 

to see if there are already installed packages (lines beginning with ii).



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!