2011-09-09 7 views
6

Ho estratto un file .img dal firmware del mio modem DSL. Voglio vedere cosa c'è dentro. Così ho provato:Come montare un file ".img" (estratto dal firmware del modem) su Linux?

[email protected]:/tmp# mount rootfs.img /tmp/1 
mount: /tmp/rootfs.img is not a block device (maybe try `-o loop'?) 
[email protected]:/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 
[email protected]:/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 

informazioni del file è qui: uscita

[email protected]:/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 

uscita 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 

Come posso montare?

Grazie.

+0

Questa domanda è stata chiusa perché non si adatta qui, forse si dovrebbe prendere la questione alla unix.stackexchange.com. –

+0

questa sarebbe la mia risposta http://unix.stackexchange.com/a/73905/3285 –

+0

forse è un'immagine di un disco piuttosto che di alcuni file. controlla la struttura con 'fdisk -l image.img' e cerca la dimensione del blocco, se invece ne ha una salta il settore di avvio e inizia dalla partizione che vuoi controllare' #mount -o loop, offset = BlockSize * Immagine StartOfSector. img/mnt/' –

risposta

4

tenta di utilizzare la bandiera -r (read-only)

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

se questo non funziona provare:

# unsquashfs

+0

grazie jgr, ma non posso montarlo anche in questo modo. ho errori da unsquashfs lo aggiungerò alla mia domanda – kursat

+0

sembra come unsqashfs ha dato alcuni risultati, ma anche errori, può il tuo file img essere corrotto? – jgr

2

Vi manca il corrispondente modulo del kernel fornito da — l'ultima volta che ne avevo bisogno — un pacchetto extra?

Supponendo che si sta utilizzando Ubuntu, cercano

$ apt-cache search squashfs 

per vedere se c'è ancora un pacchetto extra per squashfs e

$ dpkg -l | grep squashfs 

per vedere se ci sono pacchetti già installati (linee che iniziano con ii).

+0

no ho installato tutti i pacchetti, ho fatto quello che dici ma non ho ottenuto nulla. "# mount rootfs.img 1/squashfs -t -o loop mount: tipo fs errato, opzione cattivo, cattivo superblocco su/dev/loop0, mancante programma codepage o aiutante, o altro errore In alcuni casi, informazioni utili si trova in syslog - prova dmesg | tail o così " grazie comunque. – kursat

3

provare questo:

[email protected]:/tmp# mount rootfs.img /tmp/1 -o loop 
+1

Ha un '.img' non un' .iso'. –

+2

+1 Notare che il montaggio di file img funziona senza ciclo -o. – Secko

Problemi correlati