如何在Linux上安装“.img”文件(从调制解调器固件中提取)?

我从DSL调制解调器的固件中提取了一个.img文件。 我想看看里面有什么 所以我试了一下:

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 

文件信息在这里:

 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输出:

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

unsquashsfs输出:

 ... 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 

我怎么安装它?

谢谢。

Solutions Collecting From Web of "如何在Linux上安装“.img”文件(从调制解调器固件中提取)?"

尝试使用-r标志(只读)

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

如果这不起作用尝试:

# unsquashfs

尝试这个:

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

你是否错过了上一次提供的相应的内核模块 – 一个额外的包?

假设你正在使用Ubuntu,请尝试

 $ apt-cache search squashfs 

看是否还有一个额外的软件包squashfs

 $ dpkg -l | grep squashfs 

看看是否已经安装了软件包(以ii开头的行)。