다음 mount
명령으로 내가 뭘 잘못했는지 이해하려고합니다 .
여기에서 다음 파일을 가져옵니다.
그런 다음 md5sum
업스트림 페이지별로 올바른지 확인했습니다 .
$ md5sum nand_2016_06_02.img
3ad5e53c7ee89322ff8132f800dc5ad3 nand_2016_06_02.img
다음은 file
말할 내용입니다.
$ file nand_2016_06_02.img
nand_2016_06_02.img: x86 boot sector; partition 1: ID=0x83, starthead 68, startsector 4096, 3321856 sectors, extended partition table (last)\011, code offset 0x0
이제이 이미지의 첫 번째 파티션의 시작을 확인하겠습니다.
$ /sbin/fdisk -l nand_2016_06_02.img
Disk nand_2016_06_02.img: 1.6 GiB, 1702887424 bytes, 3325952 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x0212268d
Device Boot Start End Sectors Size Id Type
nand_2016_06_02.img1 4096 3325951 3321856 1.6G 83 Linux
제 경우에는 단위 크기가 512 이고 시작 이 4096 입니다. 즉, 오프셋이 2097152 바이트에 있음을 의미 합니다. 이 경우 다음은 작동하지만 작동하지 않습니다.
$ mkdir /tmp/img
$ sudo mount -o loop,offset=2097152 nand_2016_06_02.img /tmp/img/
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.
그리고 dmesg는 다음을 보여줍니다.
$ dmesg | tail
[ 1632.732163] loop: module loaded
[ 1854.815436] EXT4-fs (loop0): mounting ext2 file system using the ext4 subsystem
[ 1854.815452] EXT4-fs (loop0): bad geometry: block count 967424 exceeds size of device (415232 blocks)
여기에 나열된 솔루션 중 어느 것도 나를 위해 일 하지 않았습니다 .
내가 무엇을 놓쳤습니까?
내가 시도한 다른 실험 :
$ dd bs=2097152 skip=1 if=nand_2016_06_02.img of=trunc.img
결과 :
$ file trunc.img
trunc.img: Linux rev 1.0 ext2 filesystem data (mounted or unclean), UUID=960b67cf-ee8f-4f0d-b6b0-2ffac7b91c1a (large files)
같은 이야기도 마찬가지입니다.
$ sudo mount -o loop trunc.img /tmp/img/
mount: wrong fs type, bad option, bad superblock on /dev/loop2,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so.
먼저 resize2fs
실행해야하므로 사용할 수 없습니다 e2fsck
.
$ /sbin/e2fsck -f trunc.img
e2fsck 1.42.9 (28-Dec-2013)
The filesystem size (according to the superblock) is 967424 blocks
The physical size of the device is 415232 blocks
Either the superblock or the partition table is likely to be corrupt!
Abort<y>? yes
관심있는 파일 시스템을 추출한 후 (를 사용하여 dd
) 파일 크기 (967424 * 4096 = 3962568704)를 조정하면됩니다.
$ truncate -s 3962568704 trunc.img
그리고 간단히 :
$ sudo mount -o loop trunc.img /tmp/img/
$ sudo find /tmp/img/
/tmp/img/
/tmp/img/u-boot-spl.bin
/tmp/img/u-boot.img
/tmp/img/root.ubifs.9
/tmp/img/root.ubifs.4
/tmp/img/root.ubifs.5
/tmp/img/root.ubifs.7
/tmp/img/root.ubifs.2
/tmp/img/root.ubifs.6
/tmp/img/lost+found
/tmp/img/root.ubifs.3
/tmp/img/boot.ubifs
/tmp/img/root.ubifs.0
/tmp/img/root.ubifs.1
/tmp/img/root.ubifs.8
또 다른 간단한 해결책은 원본 img 파일에서 직접 자르는 것입니다.
$ truncate -s 3964665856 nand_2016_06_02.img
$ sudo mount -o loop,offset=2097152 nand_2016_06_02.img /tmp/img/
여기서 3962568704 + 2097152 = 3964665856
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다