如果重新格式化的硬碟中充滿了零,寫效能會提高嗎?

如果你要重新格式化一個硬碟,有沒有什麼可以“提高”以後的寫效能,或者是你甚至不應該擔心的事情?今天的超級使用者問答帖子回答了一位好奇的讀者的問題。...

如果重新格式化的硬碟中充滿了零,寫效能會提高嗎?

如果你要重新格式化一個硬碟,有沒有什麼可以“提高”以後的寫效能,或者是你甚至不應該擔心的事情?今天的超級使用者問答帖子回答了一位好奇的讀者的問題。

今天的問答環節是由SuperUser提供的,SuperUser是Stack Exchange的一個分支,是一個由社群驅動的問答網站分組。

照片由克里斯·班尼斯特(Flickr)提供。

問題

超級使用者讀者Brettetete想知道用零填充硬碟是否會提高寫入效能:

I have a 2TB hard-drive that was 99 percent full. I have deleted the partiti*** with fdisk and formatted it as ext4. As far as I know, the actual data that was on the hard-drive still exists, yet the partition table was reassigned.

My question is: Would it improve the write performance for further write acti*** if the hard-drive was clean? By ‘clean’ I mean fill the hard-drive with zeroes? Something like:

  • dd if=/dev/zero of=/dev/sdx bs=1 count=4503599627370496

用零填充硬碟會提高寫效能嗎?

答案

超級使用者貢獻者Michael Kjörling為我們提供了答案:

No, it would not improve performance. HDDs do not work like that.

First, when you write any given data to a rotational drive, it gets transformed into magnetic domains that may actually look very different from the bit pattern you are writing. This is done in part because it is much easier to maintain synchronization when the pattern read back from the platter has a certain amount of variability. For example, a long string of ‘zero’ or ‘one’ values would make it very hard to maintain synchronization. Have you read 26,393 bits or 26,394 bits? How do you recognize the boundary between bits?

The techniques for doing this have evolved over time. For example, look up Modified Frequency Modulation, MMFM, Group Code Recording, and the more general technology of run-length limited encodings.

Second, when you write new data to a sector, the magnetic domains of the relevant porti*** of the platter are simply set to the desired value. This is done regardless of what the previous magnetic domain ‘was’ at that particular physical location. The platter is already spinning under the write head; first reading the current value, then writing the new value if and only if it is different. It would cause each write to require two revoluti*** (or an extra head for each platter), causing write latency to double or greatly increasing the complexity of the drive, in turn increasing cost.

Since the limiting factor in hard-drive sequential I/O performance is how quickly each bit passes under the read/write head, this would not even offer any benefit to the user. As an aside, the limiting factor in random I/O performance is how fast the read/write head can be positioned at the desired cylinder and then the desired sector arrives under the head. The major reason why SSDs can be so fast in random I/O workloads is that they completely eliminate both of these factors.

As pointed out by JakeGould, one reason why you might want to overwrite the drive with some fixed pattern (such as all zeroes) would be to ensure that no remnants of previously stored data can be recovered, either deliberately or accidentally. But doing so will not have any effect on the hard-drive’s performance going forward, for the reas*** stated above.


有什麼要補充的解釋嗎?在評論中發出聲音。想從其他精通技術的Stack Exchange使用者那裡瞭解更多答案嗎?在這裡檢視完整的討論主題。

  • 發表於 2021-04-10 04:41
  • 閱讀 ( 42 )
  • 分類:網際網路

你可能感興趣的文章

如何在linux下配置raid硬碟陣列

...立一個檔案系統,並掛載它以便我們可以實際使用它!要格式化陣列並指定可訪問的位置,請鍵入: ...

  • 發佈於 2021-03-12 05:36
  • 閲讀 ( 40 )

101固態驅動器指南

...。首先,智慧**革命提高了人們對便攜性的需求。畢竟,如果你能在**上瀏覽完整的網頁,為什麼你不能有一臺輕便、方便的膝上型電腦呢?但這些行動式機器使用的記憶體也有影響。如果你的**可以儲存千兆位元組的資料,而不...

  • 發佈於 2021-03-12 07:32
  • 閲讀 ( 69 )

如何清潔你的windows電腦:終極清單

...開始。清潔電腦的第一步是刪除所有不再使用的舊軟體。如果你不是一個“勤奮的刪除者”,你會驚訝於你的機器上安裝了多少不必要的東西。 ...

  • 發佈於 2021-03-12 07:56
  • 閲讀 ( 43 )

macports為您的mac帶來了最好的開源軟體

...和相關作業系統上可以找到的所有優秀的開源應用程式。如果您熟悉Linux,那麼您最喜歡的應用程式很有可能在19000多個可用應用程式中。不僅如此,它們的安裝和維護都非常類似於Unix,但仍然可以很好地與macOS整合。 ...

  • 發佈於 2021-03-13 05:02
  • 閲讀 ( 59 )

固態硬碟的成本即將飛漲:你應該在2017年升級嗎?

...,即使沒有NAND危機,SSD每GB的價格仍然高於HDD同類產品。如果你真的需要大量的儲存,你可能會更好地與碟片驅動器。但是,也有混合驅動器,它結合了固態硬碟和硬碟的優點(我們稱之為固態硬碟)。此外,大多數桌上型電腦...

  • 發佈於 2021-03-16 05:28
  • 閲讀 ( 54 )

如何提高adobe lightroom的速度和效能

如果你經常使用adobelightroom,你就會知道應用程式是如何使用大量計算機資源的。目錄越大,所做的編輯越多,Lightroom的速度就越慢。 ...

  • 發佈於 2021-03-16 09:05
  • 閲讀 ( 42 )

如何格式化新的內部硬碟驅動器或固態驅動器

...淨了。或者可能驅動器是為其他作業系統(如Mac或Linux)格式化的,在這種情況下,它可能無法在Windows上使用,或者至少可能導致相容性問題。 ...

  • 發佈於 2021-03-16 14:49
  • 閲讀 ( 52 )

如何修理你的慢電腦

...的程式還是Windows配置錯誤,效能不佳有時都不會出現。如果你一直開啟電腦,這是特別正確的。您應該定期重新啟動以避免這些問題。 ...

  • 發佈於 2021-03-16 21:38
  • 閲讀 ( 66 )

7種有效的工具,可在windows上提高硬碟效能

... 如果您想提高磁碟的讀/寫速度,另一個值得使用的Windows工具是裝置管理器。您可以使用它來確保寫快取已開啟。 ...

  • 發佈於 2021-03-18 01:20
  • 閲讀 ( 49 )

3種降級到舊版本macos的方法

... 在建立安裝程式之前,需要格式化驅動器。如果驅動器已格式化,則可以跳過此部分。 ...

  • 發佈於 2021-03-18 08:10
  • 閲讀 ( 36 )
ogf39232
ogf39232

0 篇文章

作家榜

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