如果重新格式化的硬盘中充满了零,写性能会提高吗?

如果你要重新格式化一个硬盘,有没有什么可以“提高”以后的写性能,或者是你甚至不应该担心的事情?今天的超级用户问答帖子回答了一位好奇的读者的问题。...

如果重新格式化的硬盘中充满了零,写性能会提高吗?

如果你要重新格式化一个硬盘,有没有什么可以“提高”以后的写性能,或者是你甚至不应该担心的事情?今天的超级用户问答帖子回答了一位好奇的读者的问题。

今天的问答环节是由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
  • 阅读 ( 194 )
  • 分类:互联网

你可能感兴趣的文章

如何在linux下配置raid硬盘阵列

...建一个文件系统,并挂载它以便我们可以实际使用它!要格式化数组并指定可访问的位置,请键入: ...

  • 发布于 2021-03-12 05:36
  • 阅读 ( 205 )

101固态驱动器指南

...。首先,智能**革命提高了人们对便携性的需求。毕竟,如果你能在**上浏览完整的网页,为什么你不能有一台轻便、方便的笔记本电脑呢?但这些便携式机器使用的内存也有影响。如果你的**可以存储千兆字节的数据,而不需要...

  • 发布于 2021-03-12 07:32
  • 阅读 ( 276 )

任天堂wii u扩展存储,解释道

... 为wii u格式化驱动器 ...

  • 发布于 2021-03-12 21:41
  • 阅读 ( 527 )

固态硬盘的成本即将飞涨:你应该在2017年升级吗?

...,即使没有NAND危机,SSD每GB的价格仍然高于HDD同类产品。如果你真的需要大量的存储,你可能会更好地与盘片驱动器。但是,也有混合驱动器,它结合了固态硬盘和硬盘的优点(我们称之为固态硬盘)。此外,大多数台式机机箱...

  • 发布于 2021-03-16 05:28
  • 阅读 ( 238 )

如何修理你的慢电脑

...的程序还是Windows配置错误,性能不佳有时都不会出现。如果你一直打开电脑,这是特别正确的。您应该定期重新启动以避免这些问题。 ...

  • 发布于 2021-03-16 21:38
  • 阅读 ( 222 )

7种有效的工具,可在windows上提高硬盘性能

... 如果您想提高磁盘的读/写速度,另一个值得使用的Windows工具是设备管理器。您可以使用它来确保写缓存已打开。 ...

  • 发布于 2021-03-18 01:20
  • 阅读 ( 438 )

3种降级到旧版本macos的方法

... 在创建安装程序之前,需要格式化驱动器。如果驱动器已格式化,则可以跳过此部分。 ...

  • 发布于 2021-03-18 08:10
  • 阅读 ( 345 )

硬盘分区的利弊:你需要知道的

...驱动器的哪个部分。这叫做分区。当您用特定的文件系统格式化分区以使其可用时,它被称为卷。 ...

  • 发布于 2021-03-22 07:09
  • 阅读 ( 240 )

如何彻底擦除硬盘

... 所以,如果你的驱动器号是X,你需要五次格式化,你会使用 ...

  • 发布于 2021-03-22 16:06
  • 阅读 ( 327 )

慢树莓皮?提高速度和性能的11个技巧

...意味着您可以在Raspbian中更改Raspberry Pi的引导模式,然后格式化新存储并从microSD卡复制密钥文件。初始引导序列仍然需要该卡,但其他所有操作都将从USB设备运行。 ...

  • 发布于 2021-03-24 00:07
  • 阅读 ( 269 )
ogf39232
ogf39232

0 篇文章

相关推荐