我使用的是 Ubuntu 22.04.4 LTS。我有以下磁盘:
Disk /dev/sdb: 3.64 TiB, 4000787030016 bytes, 7814037168 sectors
Disk model: WDC WD40EZRZ-22G
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: EE5CF412-6F1B-43EC-8F1D-13F09FBABB93
Device Start End Sectors Size Type
/dev/sdb1 2048 1050623 1048576 512M EFI System
/dev/sdb2 1050624 7814035455 7812984832 3.6T Linux filesystem
磁盘上没有我需要恢复的数据,但我希望能够使用该磁盘存储新文件。
fsck 给出以下输出:
lynx@lynx-MS-7A69:/$ sudo fsck /dev/sdb
fsck from util-linux 2.37.2
e2fsck 1.46.5 (30-Dec-2021)
ext2fs_open2: Bad magic number in super-block
fsck.ext2: Superblock invalid, trying backup blocks...
fsck.ext2: Bad magic number in super-block while trying to open /dev/sdb
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>
Found a gpt partition table in /dev/sdb
尝试使用备用超级块会产生以下输出:
lynx@lynx-MS-7A69:/$ sudo e2fsck -b 32768 /dev/sdb
e2fsck 1.46.5 (30-Dec-2021)
e2fsck: Bad magic number in super-block while trying to open /dev/sdb
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>
Found a gpt partition table in /dev/sdb
fsck.ext4 产生类似的输出。如何修复该磁盘以便可以在其上存储新文件?
磁盘问题分为三种类型:固件、硬件和软件。为了确保您的固件是最新的,请检查制造商的网站。接下来进行一些明显的硬件检查、电缆和电源(有时除了从 USB 端口拔出的电源之外还需要外部电源)。如果磁盘上没有任何有价值的内容,或者全部都已备份(您确实检查过是否可以成功读取备份,对吧?),则格式化会将干净的文件系统写入磁盘上。现在,您可以运行更多硬件检查,例如 smartmontools 软件包提供的检查: sudo smartctl -a /dev/sdb2 如果您无法确定输出的大量信息中是否存在严重问题,请寻求帮助。