我们都担心保持数据和文件的安全和完整,但是否有可能数据被损坏,并且在没有任何问题通知或警告的情况下被用户访问?今天的超级用户问答帖子回答了一位忧心忡忡的读者的问题。
今天的问答环节是由SuperUser提供的,SuperUser是Stack Exchange的一个分支,是一个由社区驱动的问答网站分组。
图片由通用公司(Flickr)提供。
超级用户阅读器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?
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.
硬盘上的数据是否会降级,并且可以在没有损坏警告的情况下访问?
超级用户贡献者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.
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.
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 c***tant data rates more than error recovery as a damaged frame will typically not even be noticed.
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:
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.
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.
There are, of course, other reas*** 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 mechani** 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 reas*** 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).
These other reas*** 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.
有什么要补充的解释吗?在评论中发出声音。想从其他精通技术的Stack Exchange用户那里了解更多答案吗?在这里查看完整的讨论主题。
...算机的短期内存,它存储着你的计算机正在使用的数据。硬盘是一种长期内存,用于保存重启之间需要访问的内容。 ...
固态驱动器(SSD)比传统的硬盘驱动器(HDD)更快、更稳定、功耗更低。但是固态硬盘并不是完美无缺的,在预期的5到7年的使用寿命之前就可能出现故障。 ...
把外置硬盘**电脑后,发现它比以前慢了?如果你经常使用这个驱动器,这很容易解释:可能是因为它太旧了或者需要碎片整理。 ...
当固态硬盘(SSD)开始进入市场时,它们以其速度和可靠性而备受赞誉。用户认为,由于SSD没有机械部件,因此发生机械故障的可能性较小。 ...
...源的小型设备来说,这可能是一件大事。例如,突然切断硬盘的电源可能会损坏硬盘。即使是闪存驱动器也需要电源才能成功完成写入操作,而且您可能会过早地拔掉电源。弹出将向驱动器发送信号以正常关闭电源。 相关:什...
...。这将导致更快的启动时间和更灵敏的控制台。 这与对硬盘进行碎片整理不同,这一过程需要更长的时间。碎片整理会移动数据,而重建数据库只会影响数据库。重建数据库后,控制台会记录相关数据在驱动器上的位置,然后...
硬盘死机从来都不是一件有趣的事,但Synology至少让更换NAS中的死机变得相当容易。你可以不必大惊小怪地重新站起来跑步。下面是如何做到这一点。 相关:当你的硬盘出现故障时该怎么办 如果您现在处于这种情况,希望您正...
就像每一件硬件一样,硬盘也会出故障。特别是机械硬盘,其运动部件可能(最终)停止工作。即使是没有运动部件的固态驱动器也可能出现故障。每个驱动器在启动前都有一个有限的寿命。 相关:备份我的电脑最好的方法是...
硬盘使用S.M.A.R.T.(自我监控、分析和报告技术)来衡量自身的可靠性,并确定是否出现故障。你可以查看硬盘上的s.M.A.R.T.数据,看看它是否开始出现问题。 硬盘不会永远存在,而且你常常看不到终结的到来。幸运的是,大多...
...。 无法保证您的数据是可恢复的。如果您的计算机由于硬盘故障而无法工作,则可能无法恢复文件——至少没有某种昂贵的专业数据恢复服务。 从linux live cd(或windows安装光盘)引导 如果你的电脑硬件真的死在你身上了,这...