EXT4-fs 잘못된 형상 수정 (블록 수가 장치 크기를 초과 함) invalid. FIXED. Group descriptor

FAT32 파티션과 EXT4 파티션이있는 마이크로 SD 카드가 있습니다. EXT4 파티션은 더 이상 마운트되지 않습니다. dmesg는 다음 오류를 보여줍니다.

EXT4-fs (sdb2): bad geometry: block count 2199023779840 exceeds size of device (524288 blocks)

나는 구글 검색을했지만 문제가 어디에 있는지 (파티션 테이블에서 파일 시스템입니까?) 또는 문제를 해결하는 방법을 완전히 이해하지 못합니다. 여러 가지 해결책을 시도했습니다.

  • testdisk를 사용하여 파티션 테이블 작성
  • fsck를 사용하여 백업에서 수퍼 블록을 복원합니다 (모두 시도했습니다). 예 :fsck.ext4 -b 163840 -B 4096 /dev/sdb2
  • fsck -cc불량 블록 확인에 사용
  • resize2fs를 사용하여 파티션 크기를 설정하십시오. 산출:The combination of flex_bg and !resize_inode features is not supported by resize2fs.

fsck를 실행하면 많은 오류 (아래 전체 출력)가 발생하여 수정한다고 주장합니다. 그러나 다시 실행하면 매번 같은 오류가 다시 나타납니다.

잘못된 형상 문제를 해결하고 파일 시스템을 다시 마운트 할 수있게하려면 어떻게해야합니까? 어떻게 이런일이 일어 났습니까?

fsck 출력 :

e2fsck 1.42 (29-Nov-2011)
One or more block group descriptor checksums are invalid.  Fix<y>? yes

Group descriptor 0 checksum is invalid.  FIXED.
Group descriptor 1 checksum is invalid.  FIXED.
Group descriptor 2 checksum is invalid.  FIXED.
Group descriptor 3 checksum is invalid.  FIXED.
Group descriptor 4 checksum is invalid.  FIXED.
Group descriptor 5 checksum is invalid.  FIXED.
Group descriptor 6 checksum is invalid.  FIXED.
Group descriptor 7 checksum is invalid.  FIXED.
Group descriptor 8 checksum is invalid.  FIXED.
Group descriptor 9 checksum is invalid.  FIXED.
Group descriptor 10 checksum is invalid.  FIXED.
Group descriptor 11 checksum is invalid.  FIXED.
Group descriptor 12 checksum is invalid.  FIXED.
Group descriptor 13 checksum is invalid.  FIXED.
Group descriptor 14 checksum is invalid.  FIXED.
Group descriptor 15 checksum is invalid.  FIXED.
/dev/sdb2 contains a file system with errors, check forced.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
Free blocks count wrong for group #0 (24465, counted=24466).
Fix<y>? yes

Free blocks count wrong for group #2 (4788, counted=5812).
Fix<y>? yes

Free blocks count wrong for group #3 (8710, counted=8881).
Fix<y>? yes

Free blocks count wrong for group #8 (5682, counted=22066).
Fix<y>? yes

Free blocks count wrong (299742, counted=317322).
Fix<y>? yes

Inode bitmap differences:  -(8193--8194) -8197 -8208 -(8225--8226) -8229 -(8240--8241) -(8257--8258) -8261 -8272 -8274 -(8289--8290) -8293 -(8304--8306) -(8321--8322) -8325 -8336 -8339 -16387 -16389 -16400 -16419 -16421 -(16432--16433) -16451 -16453 -16464 -16466 -16483 -16485 -(16496--16498) -16515 -16517 -16528 -16531 -24577 -24579 -24581 -24592 -24609 -24611 -24613 -(24624--24625) -24641 -24643 -24645 -24656 -24658 -24673 -24675 -24677 -(24688--24690) -24705 -24707 -24709 -24720 -24723 -(32770--32771) -32773 -32784 -(32802--32803) -32805 -(32816--32817) -(32834--32835) -32837 -32848 -32850 -(32866--32867) -32869 -(32880--32882) -(32898--32899) -32901 -32912 -32915 -(40961--40963) -40965 -40976 -(40993--40995) -40997 -(41008--41009) -(41025--41027) -41029 -41040 -41042 -(41057--41059) -41061 -(41072--41074) -(41089--41091) -41093 -41104 -41107 -(49156--49157) -49168 -(49188--49189) -(49200--49201) -(49220--49221) -49232 -49234 -(49252--49253) -(49264--49266) -(49284--49285) -49296 -49299 -57345 -(57348--57349) -57360 -57377 -(57380--57381) -(57392--57393) -57409 -(57412--57413) -57424 -57426 -57441 -(57444--57445) -(57456--57458) -57473 -(57476--57477) -57488 -57491 -65538 -(65540--65541) -65552 -65570 -(65572--65573) -(65584--65585) -65602 -(65604--65605) -65616 -65618 -65634 -(65636--65637) -(65648--65650) -65666 -(65668--65669) -65680 -65683 -(73729--73730) -(73732--73733) -73744 -(73761--73762) -(73764--73765) -(73776--73777) -(73793--73794) -(73796--73797) -73808 -73810 -(73825--73826) -(73828--73829) -(73840--73842) -(73857--73858) -(73860--73861) -73872 -73875 -(81923--81925) -81936 -(81955--81957) -(81968--81969) -(81987--81989) -82000 -82002 -(82019--82021) -(82032--82034) -(82051--82053) -82064 -82067 -90113 -(90115--90117) -90128 -90145 -(90147--90149) -(90160--90161) -90177 -(90179--90181) -90192 -90194 -90209 -(90211--90213) -(90224--90226) -90241 -(90243--90245) -90256 -90259 -(98306--98309) -98320 -(98338--98341) -(98352--98353) -(98370--98373) -98384 -98386 -(98402--98405) -(98416--98418) -(98434--98437) -98448 -98451 -(106497--106501) -106512 -(106529--106533) -(106544--106545) -(106561--106565) -106576 -106578 -(106593--106597) -(106608--106610) -(106625--106629) -106640 -106643 -114694 -114704 -114726 -(114736--114737) -114758 -114768 -114770 -114790 -(114800--114802) -114822 -114832 -114835 -122881 -122886 -122896 -122913 -122918 -(122928--122929) -122945 -122950 -122960 -122962 -122977 -122982 -(122992--122994) -123009 -123014 -123024 -123027
Fix<y>? yes

Free inodes count wrong for group #0 (7803, counted=7804).
Fix<y>? yes

Free inodes count wrong (130683, counted=130684).
Fix<y>? yes


/dev/sdb2: ***** FILE SYSTEM WAS MODIFIED *****
/dev/sdb2: 388/131072 files (22.7% non-contiguous), 206966/524288 blocks

fdisk -l 산출:

Disk /dev/sdb: 16.0 GB, 16012804096 bytes
64 heads, 32 sectors/track, 15271 cylinders, total 31275008 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
Disk identifier: 0x0005ce93

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *        2048    27080703    13539328    c  W95 FAT32 (LBA)
/dev/sdb2        27080704    31275007     2097152   83  Linux


답변

SD에 원본보다 몇 블록 적은 SD 카드 이미지를 자른 후에도 동일한 문제가 발생합니다. fdisk로 드라이브를 다시 분할했지만 (위 참조) “수퍼 블록의 크기가 파티션의 물리적 크기와 다릅니다”라는 메시지가 남아있었습니다. 여기에서 해결책을 찾았습니다 : http://www.linuxquestions.org/questions/linux-hardware-18/size-in-superblock-is-different-from-the-physical-size-of-the-partition-298175/

따라서 마운트 해제 된 파티션에서 :

e2fsck -f /dev/XXX
resize2fs /dev/XXX


답변

파일 시스템은 디스크 구조에 신경 쓰지 않습니다. 이것은 파티션 테이블 문제입니다.

파티션 테이블을 덤프하고 결과를 확인한 후이 덤프로 파티션 테이블을 덮어 쓰는 것이 좋습니다. CHS 항목을 수정해야합니다.

sfdisk -d /dev/sdx >sdx.txt
cat sdx.txt
sfdisk /dev/sdx <sdx.txt

답변

나는 거의 같은 문제를 겪었고 마운트하려고 시도했다.

$sudo mount /dev/sda2 ./oldfs/
mount: wrong fs type, bad option, bad superblock on /dev/sda2,
   missing codepage or helper program, or other error
   In some cases useful info is found in syslog - try
   dmesg | tail  or so

위에서 언급 한 부분 테이블을 다시 작성해 보았습니다.

그래서 마지막으로 fdisk를 통해 드라이브를 다시 파티션하여 문제를 해결할 수있었습니다. 두 번째 파티션을 삭제하고 다시 만들었습니다.

$fdisk /dev/sda

Command (m for help): p

Disk /dev/sda: 31.4 GB, 31440502784 bytes
64 heads, 32 sectors/track, 29984 cylinders, total 61407232 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
Disk identifier: 0x000ecdca

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048    20447231    10222592   83  Linux
/dev/sda2        20447232    61406208    20479488+  83  Linux

Command (m for help): d
Partition number (1-4): 2

Command (m for help): n
Partition type:
   p   primary (1 primary, 0 extended, 3 free)
   e   extended
Select (default p): p
Partition number (1-4, default 2):
Using default value 2
First sector (20447232-61407231, default 20447232):
Using default value 20447232
Last sector, +sectors or +size{K,M,G} (20447232-61407231, default 61407231):
Using default value 61407231

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

답변

나는 이미지 파일, 즉 파티션 테이블이없는 것과 같은 문제가 있었으므로 문제는 파일 시스템 자체에 있습니다. resize2fs이미지 파일을 수행하여 문제를 해결할 수있었습니다 .


답변

다른 솔루션을 찾을 수 없으므로 EXT4 파티션을 다시 포맷했습니다. 이것은 잘못된 형상 오류를 제거했습니다. 왜 그런지 알았 으면 좋겠다.