![잘못된 형상: 블록 수 967424가 장치 크기(415232 블록)를 초과합니다.](https://linux55.com/image/110833/%EC%9E%98%EB%AA%BB%EB%90%9C%20%ED%98%95%EC%83%81%3A%20%EB%B8%94%EB%A1%9D%20%EC%88%98%20967424%EA%B0%80%20%EC%9E%A5%EC%B9%98%20%ED%81%AC%EA%B8%B0(415232%20%EB%B8%94%EB%A1%9D)%EB%A5%BC%20%EC%B4%88%EA%B3%BC%ED%95%A9%EB%8B%88%EB%8B%A4..png)
mount
다음 명령으로 내가 뭘 잘못하고 있는지 이해하려고 노력하고 있습니다 .
여기에서 다음 파일을 가져옵니다.
img
에서 파일을 다운로드하면 됩니다.여기.
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)
나열된 솔루션이 없습니다.여기나를 위해 작동합니다:
- 2fs 크기를 조정하거나,
- 플로피 디스크
내가 놓친 게 무엇입니까?
내가 시도한 다른 실험은 다음과 같습니다.
$ 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
답변1
관심 있는 파일 시스템을 추출한 후( 를 사용하여 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
답변2
에서truncate
이 답변문제가 해결되지 않아서 좀 더 시도해 보았습니다. 존재하다어딘가에resize2fs
이미지 수정에 대한 제안을 찾았지만( resize2fs <image> <size>
예: resize2fs nand_2016_06_02.img 3779M
위의 데이터 제공) 나에게도 효과가 없었습니다(크기가 이미 이와 같다고 주장함).
나에게는 다음 두 단계로 문제가 해결되었습니다.
e2fsck -y -f nand_2016_06_02.img
y
( 먼저 오류가 있는지 확인할 수 있습니다. 오류가 없으면 필요하지 않습니다.)testdisk nand_2016_06_02.img
, 메뉴(계속 › (파티션 테이블) 없음 › 고급 › 이미지 생성)로 이동하여 testdisk가 이미지를 생성하도록 합니다.
image.dd
testdisk(이름 ) 로 생성된 이미지는 완벽하게 설치됩니다.
sudo mount image.dd /tmp/img -t ext4 -o loop,ro
(ext4라는 것을 알고 있으며 실수로 수정하지 않도록 읽기 전용으로 마운트하기를 명시적으로 원합니다. 제 경우에는 다운로드한 이미지가 아니라 포기한 "구출된" SD 카드였습니다. 데이터가 사용됩니다 myrescue -r 1000 -b 4096 /dev/sdf2 sdpart2.img
. 1014개의 불량 블록이 있는 8GB 파티션의 경우 약 24시간이 소요됩니다.