linux修复ntfs分区,修复没有Windows的损坏的NTFS分区

这篇博客讲述了如何在Linux环境下修复损坏的NTFS分区,包括使用ntfsfix、testdisk等工具进行修复,并提供了错误排查和解决的步骤。在尝试修复过程中,博主遇到了超级块问题和读取错误,通过不同方法最终成功修复了NTFS分区。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

问题描述

我的NTFS分区已经以某种方式腐败了(这是我安装Windows的日子里的遗物)。

637309fab8825eaf5c884e820f852cf8.png

我正在调试fdisk和blkid here的调试输出。

同时,任何操作系统都无法挂载我的根分区,该分区位于我的NTFS分区旁边。不过,我不确定这是否与它有关。尝试安装我的根分区(sda5)时出现以下错误

mount: wrong fs type, bad option, bad superblock on /dev/sda5,

missing codepage or helper program, or other error

In some cases useful info is found in syslog - try

dmesg | tail or so

ubuntu@ubuntu:~$ dmesg | tail

[ 1019.726530] Descriptor sense data with sense descriptors (in hex):

[ 1019.726533] 72 03 11 04 00 00 00 0c 00 0a 80 00 00 00 00 00

[ 1019.726551] 1a 3e ed 92

[ 1019.726558] sd 0:0:0:0: [sda] Add. Sense: Unrecovered read error - auto reallocate failed

[ 1019.726568] sd 0:0:0:0: [sda] CDB: Read(10): 28 00 1a 3e ed 40 00 01 00 00

[ 1019.726584] end_request: I/O error, dev sda, sector 440331666

[ 1019.726602] JBD: Failed to read block at offset 462

[ 1019.726609] ata1: EH complete

[ 1019.726612] JBD: recovery failed

[ 1019.726617] EXT4-fs (sda5): error loading journal

当我打开gparted(使用live CD)时,我的NTFS驱动器旁边会有一个感叹号

58b2729a0fa3a2fa1904349060aaae88.png

有没有办法在不使用Windows的情况下运行chkdsk?

我尝试运行fsck导致以下结果:

ubuntu@ubuntu:~$ sudo fsck /dev/sda

fsck from util-linux-ng 2.17.2

e2fsck 1.41.14 (22-Dec-2010)

fsck.ext2: Superblock invalid, trying backup blocks...

fsck.ext2: Bad magic number in super-block while trying to open /dev/sda

The superblock could not be read or does not describe a correct ext2

filesystem. If the device is valid and it really contains an ext2

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

更新:我能够修复从Hiren的BootCD运行chkdsk的NTFS分区,但似乎超级块问题仍然存在。

更新2:使用e2fsck -c /dev/sda5修复了超级块问题

最佳解决方案

使用sudo apt-get install ntfs-3g安装ntfs-3g。然后在NTFS分区上运行ntfsfix命令。

例如:

ntfsfix /dev/hda6

ntfsfix v2.0.0 (libntfs 10:0:0)

Usage: ntfsfix [options] device

Attempt to fix an NTFS partition. -h, --help Display this help -V, --version Display version information

Developers’ email address:

linux-ntfs-dev@lists.sf.net Linux NTFS homepage: http://www.linux-ntfs.org

对于较新的Ubuntus您可以一起使用-b和-d选项。 -b尝试修复坏簇和-d来修复脏状态。所以命令可以

sudo ntfsfix -b -d /dev/sda6

--help显示它们

ntfsfix v2015.3.14AR.1 (libntfs-3g)

Usage: ntfsfix [options] device

Attempt to fix an NTFS partition.

-b, --clear-bad-sectors Clear the bad sector list

-d, --clear-dirty Clear the volume dirty flag

-h, --help Display this help

-n, --no-action Do not write anything

-V, --version Display version information

次佳解决方案

我刚刚使用”testdisk”修复了我的USB驱动器,这是一个Linux命令行(还是友好的)实用程序。我的驱动器甚至没有安装在Windows和Windows 8中发现像6个分区(当驱动器只有一个)。

要使用该实用程序,请安装它:

sudo apt-get install testdisk

然后运行它:

sudo testdisk

并按照说明操作。您必须搜索分区,然后编写更改。

希望这有助于任何人。

第三种解决方案

只是为了清楚你的一些观点。

My attempt to run fsck results in the following :

ubuntu@ubuntu:~$ sudo fsck /dev/sda ... fsck.ext2: Bad magic number in super-block while trying to open /dev/sda

现在,这并不奇怪,因为你试图fsck磁盘,而不是它的分区。 fsck的作用是,它试图识别FS类型。因为你已经给它原始磁盘表面,它无法识别并转换为默认类型 – ext,调用fsck.ext。

fsck.ext在该位置找不到任何FS签名并尝试查找超级块。最终它失败了,因为它的磁盘只有NTFS分区类型。

这就是您遇到此错误的原因。

正确的命令是:

sudo fsck /dev/sda1

这将提供第一个SATA硬盘驱动器的FIRST分区,而不是第一个sata磁盘本身。

第四种方案

你的磁盘是烤面包。检查磁盘实用程序中的SMART诊断以确认;它应该说你有大量的坏扇区需要更换驱动器。

第五种方案

我同意@psusi:磁盘需要更换,请参阅我接受的答案中的评论。做一个ntfsfix根本没有帮助,只是延迟了以下基本行动:

尽快备份磁盘上的所有数据

用新的磁盘替换磁盘

没有必要真正检查SMART诊断 – 他们只会收集一定比例的错误。红旗是两行:

[ 1019.726558] sd 0:0:0:0: [sda] Add. Sense: **Unrecovered read error** - auto reallocate failed

[ 1019.726602] JBD: **Failed to read block** at offset 462

一旦磁盘开始提供不可恢复的读取错误(URE),就应立即将其替换并仅用于数据恢复。 (过量的non-UREs也表示需要更换。)

磁盘应被视为必须每隔几年更换一次的耗材,因此具有非常好的备份(自动,每日,完整,至少对外部驱动器)至关重要。

第六种方案

在Ubuntu 14.04中试试吧

sudo ntfsfix /dev/sdXY

其中XY是您的分区。 (在您的情况下为/dev/sda2)

参考资料

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值