我的一个磁盘在断电后损坏了。当我尝试通过 fsck 修复磁盘时。首先,它输出“正在恢复日志”和“无论如何运行日志<y>?
按 y 后,fsck 输出:
fsck.ext4: Invalid argument while trying to open /dev/sda
当我检查 fdisk -l 时磁盘消失。
我已经尝试了很多次,重新启动后,磁盘将出现,fsck将开始恢复日志,在我按y后,磁盘就消失了。
对于我的情况有什么有用的建议吗?
以下是一些详细输出:
(anaconda3) ubuntu@ubuntu:/$ sudo fsck /dev/sda
fsck from util-linux 2.27.1
e2fsck 1.42.13 (17-May-2015)
/dev/sda: recovering journal
Superblock needs_recovery flag is clear, but journal has data.
Run journal anyway<y>? yes
fsck.ext4: Invalid argument while trying to open /dev/sda
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>
更新:sda的smartctl的输出:
smartctl 6.5 2016-01-24 r4214 [x86_64-linux-4.15.0-142-generic] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Device Model: Samsung SSD 870 EVO 2TB
Serial Number: S5Y3NF0R801831K
LU WWN Device Id: 5 002538 f4180e30c
Firmware Version: SVT01B6Q
User Capacity: 2,000,398,934,016 bytes [2.00 TB]
Sector Size: 512 bytes logical/physical
Rotation Rate: Solid State Device
Form Factor: 2.5 inches
Device is: Not in smartctl database [for details use: -P showall]
ATA Version is: Unknown(0x09fc), ACS-4 T13/BSR INCITS 529 revision 5
SATA Version is: SATA >3.2 (0x1ff), 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is: Tue Oct 4 17:22:25 2022 CST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
Read SMART Data failed: scsi error badly formed scsi parameters
=== START OF READ SMART DATA SECTION ===
SMART Status command failed: scsi error badly formed scsi parameters
SMART overall-health self-assessment test result: UNKNOWN!
SMART Status, Attributes and Thresholds cannot be read.
Read SMART Log Directory failed: scsi error badly formed scsi parameters
Read SMART Error Log failed: scsi error badly formed scsi parameters
Read SMART Self-test Log failed: scsi error badly formed scsi parameters
Selective Self-tests/Logging not supported
答案1
几乎可以肯定 上没有直接的文件系统/dev/sda
。在你惊慌之前继续阅读。
通常磁盘上有一个分区表,一个或多个分区包含文件系统。此命令将显示磁盘上的分区:
parted /dev/sda --align 最佳单位 MiB 打印
就我而言,我只有一个,在/dev/sda1
.注意后面的数字。
Number Start End Size Type File system Flags
1 1.00MiB 49152MiB 49151MiB primary ext4
如果您确实需要这样做,您现在可以fsck
在该分区上运行,但您不需要这样做。
e2fsck /dev/sda1
然而,在你运行任何这个之前,更新您的问题以显示磁盘故障的症状,使您相信您根本需要执行此操作。对于某些磁盘故障模式,唯一正确的响应是在磁盘完全故障之前复制磁盘。理想情况下,您将能够运行 SMART 诊断,并使用以下输出更新您的问题:
smartctl -a /dev/sda