硬碟上的資料會在沒有損壞警告的情況下降級嗎?

我們都擔心保持資料和檔案的安全和完整,但是否有可能資料被損壞,並且在沒有任何問題通知或警告的情況下被使用者訪問?今天的超級使用者問答帖子回答了一位憂心忡忡的讀者的問題。...

硬碟上的資料會在沒有損壞警告的情況下降級嗎?

我們都擔心保持資料和檔案的安全和完整,但是否有可能資料被損壞,並且在沒有任何問題通知或警告的情況下被使用者訪問?今天的超級使用者問答帖子回答了一位憂心忡忡的讀者的問題。

今天的問答環節是由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.

  • If a sector can be read and has no ECC code problems, then it is passed on to the operating system.
  • 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. co**ic 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 rec***truct 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).
  • 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 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:

  • 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.

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).

  • 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.

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使用者那裡瞭解更多答案嗎?在這裡檢視完整的討論主題。

  • 發表於 2021-04-09 15:31
  • 閱讀 ( 41 )
  • 分類:網際網路

你可能感興趣的文章

流動(streaming)和正在下載(downloading)的區別

...net連線和連線速度,而不需要儲存。另一方面,下載需要硬碟儲存,但並不取決於你在哪裡或你的網際網路連線。 當影片、音樂或資料等檔案從一個裝置或internet複製到另一個裝置(如電話或計算機)時,稱為下載。下載檔案時...

  • 發佈於 2020-10-21 00:31
  • 閲讀 ( 51 )

5個windows pc維護錯誤可能會損壞您的電腦

... 過度清潔的最終形式是擦拭硬碟。當你重置windows10時,你可以選擇保持你的個人檔案完好無損,或者擦除所有內容以重新開始。 ...

  • 發佈於 2021-03-10 19:23
  • 閲讀 ( 49 )

如何防止谷歌在沒有警告的情況下刪除你的android備份

...情況下刪除你的資料,也不會讓你有機會使用可用的谷歌硬碟儲存來儲存寶貴的備份。似乎這還不夠,無法恢復已刪除的備份。 ...

  • 發佈於 2021-03-12 12:37
  • 閲讀 ( 35 )

安裝sata硬碟時要考慮的5件事

... 採用帶有序列ATA(SATA)聯結器的硬碟驅動器來取代IDE,以及增強型IDE(並行ATA)驅動器。SATA消除了並行硬碟驅動器之間的主從關係,每個驅動器都使用自己的SATA介面卡連線到主機板。 ...

  • 發佈於 2021-03-12 14:58
  • 閲讀 ( 66 )

如何在任何系統上備份遊戲儲存

...>“備份PS4”以備份到USB快閃記憶體驅動器或外部硬碟驅動器。 ...

  • 發佈於 2021-03-14 20:18
  • 閲讀 ( 66 )

你的公羊即將失敗的5個跡象和症狀

...機的短期記憶體,它儲存著你的計算機正在使用的資料。硬碟是一種長期記憶體,用於儲存重啟之間需要訪問的內容。 ...

  • 發佈於 2021-03-17 16:18
  • 閲讀 ( 45 )

Windows10中釋放磁碟空間的6個技巧

...的應用程式儲存到裝置的RAM中,而Hibernate則將它們儲存到硬碟中。睡眠類似於把電視置於待機狀態,而休眠則讓你的電腦完全關機。 ...

  • 發佈於 2021-03-17 16:47
  • 閲讀 ( 45 )

5個警告訊號您的ssd即將發生故障

固態驅動器(SSD)比傳統的硬碟驅動器(HDD)更快、更穩定、功耗更低。但是固態硬碟並不是完美無缺的,在預期的5到7年的使用壽命之前就可能出現故障。 ...

  • 發佈於 2021-03-18 00:44
  • 閲讀 ( 58 )

如何重新格式化外部硬碟而不丟失其上的所有內容

大多數人都很擅長將自己寶貴的資料備份到外部硬碟上。但是如果驅動器損壞了怎麼辦? ...

  • 發佈於 2021-03-21 23:31
  • 閲讀 ( 48 )

如何在windows10中修復速度較慢的外部硬碟

把外接硬碟**電腦後,發現它比以前慢了?如果你經常使用這個驅動器,這很容易解釋:可能是因為它太舊了或者需要碎片整理。 ...

  • 發佈於 2021-03-25 23:19
  • 閲讀 ( 54 )
w91395898
w91395898

0 篇文章

作家榜

  1. admin 0 文章
  2. 孫小欽 0 文章
  3. JVhby0 0 文章
  4. fvpvzrr 0 文章
  5. 0sus8kksc 0 文章
  6. zsfn1903 0 文章
  7. w91395898 0 文章
  8. SuperQueen123 0 文章

相關推薦