驱动器健康状态降级_硬盘驱动器上的数据会在没有警告损坏的情况下降级吗?...

驱动器健康状态降级

驱动器健康状态降级

can-data-on-hard-drives-degrade-and-be-accessed-without-warning-about-damage-00

We all worry about keeping our data and files safe and intact, but is it possible for data to become damaged and be accessed by a user without a notification or warning of any kind about the problem? Today’s SuperUser Q&A post has the answer to a worried reader’s question.

我们都担心保持我们的数据和文件的安全性和完整性,但是是否有可能数据损坏并被用户访问而没有任何有关该问题的通知或警告? 今天的《超级用户问答》帖子解答了一个担心的读者的问题。

Today’s Question & Answer session comes to us courtesy of SuperUser—a subdivision of Stack Exchange, a community-driven grouping of Q&A web sites.

今天的“问答”环节由SuperUser提供,它是Stack Exchange的一个分支,该社区是由社区驱动的Q&A网站分组。

Photo courtesy of generalising (Flickr).

照片由generalisation(Flickr)提供

问题 (The Question)

SuperUser reader topo morto wants to know if data on hard drives can degrade and be accessed without a warning about the damage:

超级用户阅读器topo morto想要了解硬盘驱动器上的数据是否会降级并在没有损坏警告的情况下进行访问:

Is it possible that physical degradation of a hard drive could cause bits to “flip” in a file’s contents without the operating system noticing the change and notifying the user about it when reading the file? For example, could a “p” (binary 01110000) in an ASCII text file change to a “q” (binary 01110001), then when a user opens the file, they see “q” without being aware that a failure has occurred?

硬盘驱动器的物理性能下降是否可能导致文件内容中的位“翻转”,而操作系统在读取文件时却没有通知更改并通知用户有关更改? 例如,是否可以将ASCII文本文件中的“ p”(二进制01110000)更改为“ q”(二进制01110001),然后当用户打开文件时,他们看到“ q”却不知道发生了故障吗?

I am interested in answers relating to FAT, NTFS, or ReFS (if it makes a difference). I want to know if operating systems protect users from this, or if we should be checking our data for variances between copies over time.

我对有关FAT,NTFS或ReFS(如果有所作为)的答案感兴趣。 我想知道操作系统是否可以保护用户免受此侵害,或者我们是否应该检查数据中副本之间随时间变化的情况。

Can data on hard drives degrade and be accessed without a warning about the damage?

硬盘驱动器上的数据是否可以降级并在没有损坏警告的情况下被访问?

答案 (The Answer)

SuperUser contributor Guntram Blohm has the answer for us:

超级用户贡献者Guntram Blohm为我们提供了答案:

Yes, there is a thing called bit rot. But no, it will not affect a user unnoticed.

是的,有一种叫做腐烂的东西。 但是不,它不会影响用户而不被注意。

When a hard drive writes a sector to the platters, it does not just write the bits in the same way that they are stored in RAM, it uses an encoding to make sure there are no sequences of the same bit that are too long. It also adds ECC codes that allow it to repair errors that affect a few bits and detect errors that affect more than a few bits.

当硬盘驱动器将一个扇区写入磁盘时,它不仅以与存储在RAM中相同的方式写入位,还使用编码来确保同一位的序列不存在太长的序列。 它还添加了ECC代码,使它可以修复影响几个位的错误并检测影响多个位的错误。

When the hard drive reads the sector, it checks these ECC codes and repairs the data if necessary (and if possible). What happens next depends on the circumstances and the firmware of the hard drive, which is influenced by the designation of the drive.

硬盘驱动器读取扇区时,将检查这些ECC代码并在必要时(如果可能)修复数据。 接下来发生的情况取决于硬盘驱动器的环境和固件,这受驱动器名称的影响。

  • If a sector can be read and has no ECC code problems, then it is passed on to the operating system.

    如果可以读取一个扇区并且没有ECC代码问题,则将其传递给操作系统。
  • If a sector can be repaired easily, the repaired version may be written to disk, read back, then verified to determine if the error was a random one (i.e. cosmic rays, etc.) or if there is a systematic error with the media.

    如果可以轻松地修复扇区,则可以将修复后的版本写入磁盘,再读回,然后进行验证以确定错误是随机的(即宇宙射线等)还是介质是否存在系统性错误。
  • If the hard drive determines that there is an error with the media, it reallocates the sector.

    如果硬盘驱动器确定介质存在错误,则会重新分配扇区。
  • If a sector can be neither read nor corrected after a few read attempts (on a hard drive that is designated as a RAID hard drive), then the hard drive will give up, reallocate the sector, and tell the controller that there was a problem. It relies on the RAID controller to reconstruct the sector from the other RAID members and write it back to the failed hard drive, which then stores it in the reallocated sector (that hopefully does not have a problem).

    如果在几次读取尝试后(在指定为RAID硬盘的硬盘驱动器上)无法读取或纠正扇区,则该硬盘驱动器将放弃,重新分配该扇区,并告知控制器存在问题。 它依靠RAID控制器从其他RAID成员重建扇区,并将其写回到发生故障的硬盘驱动器,然后将其存储在重新分配的扇区中(希望不会出现问题)。
  • If a sector cannot be read or corrected on a desktop’s hard drive, then the hard drive will engage in more attempts to read it. Depending on the quality of the hard drive, this might involve repositioning the head, checking to see if there are any bits that flip when read repeatedly, checking which bits are the weakest, and a few other things. If any of these attempts succeed, the hard drive will reallocate the sector and write back the repaired data.

    如果无法在台式机硬盘驱动器上读取或纠正扇区,则硬盘驱动器将进行更多读取尝试。 根据硬盘的质量,这可能涉及重新放置磁头,检查是否有任何位在重复读取时发生翻转,检查哪些位是最弱的位以及其他一些事情。 如果这些尝试中的任何一个成功,硬盘驱动器将重新分配该扇区并写回修复的数据。

This is one of the main differences between hard drives that are sold as “desktop”, “NAS/RAID”, or “video surveillance” hard drives. A RAID hard drive can just give up quickly and make the controller repair the sector to avoid latency on the user’s side. A desktop hard drive will continue trying again and again because having the user wait a few seconds is probably better than telling them the data is lost. And a video hard drive values constant data rates more than error recovery as a damaged frame will typically not even be noticed.

这是作为“台式”,“ NAS / RAID”或“视频监控”硬盘出售的硬盘之间的主要区别之一。 RAID硬盘驱动器可以快速放弃,并使控制器修复该扇区,从而避免用户方面的延迟。 台式机硬盘驱动器将继续反复尝试,因为让用户等待几秒钟可能比告诉他们数据丢失更好。 视频硬盘驱动器重视恒定数据速率而不是错误恢复,因为通常甚至不会注意到损坏的帧。

At any rate, the hard drive will know if there has been bit rot, will typically recover from it, and if it cannot, it will tell the controller which will in turn tell the driver which will then tell the operating system. Then, it is up to the operating system to present the error to the user and act on it. This is why cybernard says:

无论如何,硬盘驱动器将知道是否有位腐烂,通常会从中恢复,如果无法恢复,它将告诉控制器,后者又会告诉驱动程序,然后告诉操作系统。 然后,由操作系统将错误呈现给用户并采取措施。 这就是为什么Cyber​​nard说:

  • I have never witnessed a single bit error myself, but I have seen plenty of hard drives where entire sectors have failed.

    我自己从未见过一点错误,但是我看到很多硬盘驱动器中的整个扇区都发生了故障。

The hard drive will know if there is something wrong with a sector, but it will not know which bits have failed. A single bit that has failed will always be caught by ECC.

硬盘驱动器将知道某个扇区是否有问题,但是它将不知道哪些位已失败。 单个失败的位将始终被ECC捕获。

Please note that chkdsk and file systems that automatically repair themselves do not address repairing data within files. These are targeted at corruption within the structure of the file system itself, like a difference in a file’s size between the directory entry and the number of allocated blocks. The self-healing feature of NTFS will detect structural damage and prevent it from affecting your data further, but it will not repair any data that is already damaged.

请注意,自动修复自身的chkdsk和文件系统不解决修复文件中的数据的问题。 这些目标是针对文件系统本身结构中的损坏,例如目录条目与分配的块数之间文件大小的差异。 NTFS的自我修复功能将检测结构损坏并防止其进一步影响您的数据,但它不会修复任何已损坏的数据。

There are, of course, other reasons why data may become damaged. For example, bad RAM on a controller may alter data before it is even sent to the hard drive. In that case, no mechanism on the hard drive will detect or repair the data, and this may be one reason why the structure of a file system is damaged. Other reasons include software bugs, blackouts while writing to the hard drive (although this is addressed by file system journaling), or bad file system drivers (the NTFS driver on Linux defaulted to read-only for a long time since NTFS was reverse engineered, not documented, and the developers did not trust their own code).

当然,还有其他可能导致数据损坏的原因。 例如,控制器上的坏RAM甚至可能在更改数据甚至将其发送到硬盘驱动器之前对其进行更改。 在那种情况下,硬盘驱动器上没有机制可以检测或修复数据,这可能是文件系统结构损坏的原因之一。 其他原因包括软件错误,写入硬盘时出现断电(尽管这是通过文件系统日志记录解决的)或文件系统驱动程序错误(Linux上的NTFS驱动程序默认为只读状态很长时间,因为对NTFS进行了反向工程,未记录,开发人员不信任自己的代码)。

  • I had this scenario once where an application would save all of its files to two different servers in two different data centers in order to keep a working copy of the data available under all circumstances. After a few months, we noticed that about 0.1 percent of all the copied files did not match the MD5 check sum that the application stored in its database. It turned out to be a faulty fiber cable between the server and the SAN.

    我曾经遇到过这种情况,即应用程序会将其所有文件保存到两个不同数据中心的两个不同服务器上,以便在所有情况下都可以使用数据的工作副本。 几个月后,我们注意到所有复制文件中约有0.1%与应用程序存储在其数据库中的MD5校验和不匹配。 原来是服务器和SAN之间的光纤电缆有故障。

These other reasons are why some file systems, like ZFS, keep additional check sum information in order to detect errors. They are designed to protect you from a lot more things that can go wrong than just bit rot.

这些其他原因是为什么某些文件系统(例如ZFS)保留其他校验和信息以检测错误的原因。 它们旨在保护您免受可能会出错的许多事情的影响,而不仅仅是腐烂。



Have something to add to the explanation? Sound off in the comments. Want to read more answers from other tech-savvy Stack Exchange users? Check out the full discussion thread here.

有什么补充说明吗? 在评论中听起来不错。 是否想从其他精通Stack Exchange的用户那里获得更多答案? 在此处查看完整的讨论线程

翻译自: https://www.howtogeek.com/255106/can-data-on-hard-drives-degrade-without-a-warning-about-the-damage/

驱动器健康状态降级

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值