ext4 - 슈퍼블록의 잘못된 매직 넘버

ext4 - 슈퍼블록의 잘못된 매직 넘버

ext4가 또 실패했어요! 가장 불안정한 FS

백업에서 블록을 복원하여 문제를 해결하려고 시도했지만 운이 없었습니다.

↪ sudo fsck.ext4 -v /dev/sdd
e2fsck 1.45.6 (20-Mar-2020)
ext2fs_open2: Bad magic number in super-block
fsck.ext4: Superblock invalid, trying backup blocks...
fsck.ext4: Bad magic number in super-block while trying to open /dev/sdd

The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem.  If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>
or
e2fsck -b 32768 <device>

/dev/sdd contains DOS/MBR boot sector; partition 1 : ID=0xee, start-CHS (0x0,0,2), end-CHS (0x3ff,255,63), startsector 1, 4294967295 sectors, extended partition table (last) data


↪ sudo mke2fs -n /dev/sdd
mke2fs 1.45.6 (20-Mar-2020)
/dev/sdd contains DOS/MBR boot sector; partition 1 : ID=0xee, start-CHS (0x0,0,2), end-CHS (0x3ff,255,63), startsector 1, 4294967295 sectors, extended partition table (last) data
Proceed anyway? (y,N) y
Creating filesystem with 976754646 4k blocks and 244195328 inodes
Filesystem UUID: 0e4124ad-a390-4c60-bb4a-4f7c48dac23b
Superblock backups stored on blocks: 
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 
102400000, 214990848, 512000000, 550731776, 644972544


↪ sudo e2fsck -b 32768 /dev/sdd
e2fsck 1.45.6 (20-Mar-2020)
e2fsck: Bad magic number in super-block while trying to open /dev/sdd

The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem.  If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>
or
e2fsck -b 32768 <device>

/dev/sdd contains DOS/MBR boot sector; partition 1 : ID=0xee, start-CHS (0x0,0,2), end-CHS (0x3ff,255,63), startsector 1, 429496725 sectors, extended partition table (last) data

나는 최대 11239424의 청크를 시도했습니다.


↪ sudo fdisk -l /dev/sdd
The primary GPT table is corrupt, but the backup appears OK, so that will be used.
Disk /dev/sdd: 3.65 TiB, 4000787030016 bytes, 7814037168 sectors
Disk model: TOSHIBA MD04ABA4
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 7D5C7ECA-C305-3C44-AA4F-8503EB53A54F

Device     Start        End    Sectors  Size Type
/dev/sdd1   2048 7814031359 7814029312  3.7T Linux filesystem


↪ sudo e2fsck -b 32768 /dev/sdd1
e2fsck 1.45.6 (20-Mar-2020)
e2fsck: No such file or directory while trying to open /dev/sdd1
Possibly non-existent device?

답변1

이미 하드 드라이브 내부 백업 어딘가에 있는 파티션 작업을 수행했기 때문입니다.

↪ sudo fdisk /dev/sdb

Welcome to fdisk (util-linux 2.36.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

The primary GPT table is corrupt, but the backup appears OK, so that will be used.

간단하게 덤프하고, 덤프 후 바로 복원할 수 있습니다.

sudo sfdisk -d /dev/sdb > sdb.dump
sudo sfdisk /dev/sdb < sdb.dump

그리고 발리야 =)

The primary GPT table is corrupt, but the backup appears OK, so that will be used.
Checking that no-one is using this disk right now ... OK

Disk /dev/sdb: 3.64 TiB, 4000787030016 bytes, 7814037168 sectors
Disk model: TOSHIBA MD04ABA4
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 7D5C7ECA-C305-3C44-AA4F-8503EB53A54F

Old situation:

Device     Start        End    Sectors  Size Type
/dev/sdb1   2048 7814031359 7814029312  3.6T Linux filesystem

>>> Script header accepted.
>>> Script header accepted.
>>> Script header accepted.
>>> Script header accepted.
>>> Script header accepted.
>>> Script header accepted.
>>> Script header accepted.
>>> Created a new GPT disklabel (GUID: 7D5C7ECA-C305-3C44-AA4F-8503EB53A54F).
/dev/sdb1: Created a new partition 1 of type 'Linux filesystem' and of size 3.6 TiB.
Partition #1 contains a ext4 signature.
/dev/sdb2: Done.

New situation:
Disklabel type: gpt
Disk identifier: 7D5C7ECA-C305-3C44-AA4F-8503EB53A54F

Device     Start        End    Sectors  Size Type
/dev/sdb1   2048 7814031359 7814029312  3.6T Linux filesystem

The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

터미널에는 명령이 2개만 있습니다.

몇 초 밖에 걸리지 않습니다

새 하드 드라이브와 rstudio 백업에 시간과 비용을 낭비할 필요가 없습니다.

답변2

비교 fdisk커널이 파티션 테이블 백업을 사용하지 않는 것 같습니다. 그러니 먼저 고쳐야 합니다. 드라이브를 열고 fdisk /dev/sdd파티션 테이블에 쓰는 것만으로도 충분합니다.

답변3

github에서 e2fsprogs 소스 코드를 다운로드하면 findsuper장치에서 ext2/3/4 슈퍼블록 매직 값을 검색하는 도구를 구축할 수 있습니다. 이는 디스크에서 파일 시스템이 어디에 있는지 알려주고 파티션 테이블을 복구하는 데 도움이 됩니다.

관련 정보