什么是磁盘碎片?我还需要碎片整理吗?

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

什么是磁盘碎片?我还需要碎片整理吗?Do modern computers still need the kind of routine defragmentation procedures that older computers called for? Read on to learn about fragmentation and what modern operating systems and file systems do to minimize performance impacts.

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

问题

超级用户读者Simon Sheehan对现代硬盘的碎片整理状态很好奇:

As a part of regular Windows maintenance, I defragment my hard drive. But why does the hard drive fragment on NTFS and FAT* systems? Apparently EXT* does not, why is this? Should I also be defragmenting my USB drives?

让我们看看投稿人的一些答案来调查西蒙的问题。

答案

超级用户贡献者Daniel R.Hicks提出了一个问题:

Fragmentation is not the issue it was 30 years ago. Back then you had hard drives that were scarcely faster than floppies, and processor memory sizes that were minuscule. Now you have very fast drives and large processor memories, and sometimes substantial buffering on the hard drive or in the controller. Plus sector sizes have gotten larger (or files are allocated in larger blocks) so that more data is inherently contiguous.

Operating systems have gotten **arter as well. Whereas DOS 1.x would have fetched each sector from disk as it was referenced, a modern OS is able to see that you have a file open for sequential access and can reasonably predict that you’ll be fetching additional sectors once you’ve c***umed those you have now. Thus it can “pre-fetch” the next several (dozen) sectors.

And any more it’s often better to not have a file contiguous. On a (large) system where the file system is spread across multiple drives a file can actually be accessed faster if it is “spread” as well, since multiple disks can be seeking the file simultaneously.

I defragment every 2-3 years, whether my box needs it or not.

[I’ll add that the important thing is not so much whether the data on the disk gets defragmented as whether the free space does. FAT was terrible at this — unless you defragged things kept getting worse and worse until there were no two contiguous blocks of free space. Most other schemes can coalesce free space and allocate pieces in a somewhat “**art” fashion so the fragmentation reaches a certain threshold and then stabilizes, rather than getting worse and worse.]

Journeyman Geek添加了关于Linux文件系统的以下信息:

ALL file systems fragment. ext and other Linux file systems fragment less due to the way they’re designed – to quote Wikipedia regarding the Linux Network Administrators’ Guide:

Modern Linux filesystem(s) keep fragmentation at a minimum by keeping all blocks in a file close together, even if they can’t be stored in c***ecutive sectors. Some filesystems, like ext3, effectively allocate the free block that is nearest to other blocks in a file. Therefore it is not necessary to worry about fragmentation in a Linux system.

I’d note though that ext4 has online defragmentation so eventually fragmentation IS an issue, even with Linux file systems.

Windows file systems have their clusters placed wherever there’s space to put them, and defrag runs around and replaces them. With Linux, files are preferentially placed where there’s enough space.

I’d note though, Windows 7 has scheduled defragmentation runs, so it isn’t really necessary to run defrag manually.

最初的一个问题没有解决,那就是你是否应该整理你的闪存驱动器。碎片整理是一个非常读/写密集型的过程,应该避免在固态存储设备上,如闪存驱动器和固态磁盘(ssd)。有关碎片整理、文件系统和SSD的更多信息,请参阅以下HTG文章:

  • HTG解释说:你真的需要整理你的电脑吗?
  • HTG解释道:什么是固态硬盘,我需要知道什么?
  • HTG解释:为什么Linux不需要碎片整理

有什么要补充的解释吗?在评论中发出声音。想从其他精通技术的Stack Exchange用户那里了解更多答案吗?在这里查看完整的讨论主题。

  • 发表于 2021-04-12 03:43
  • 阅读 ( 221 )
  • 分类:互联网

你可能感兴趣的文章

如何在windows10中修复速度较慢的外部硬盘

...甚至可以从USB3.0驱动器上运行视频游戏。无论应用程序是什么,选择它并单击“结束任务”停止它。这将有望使驱动器恢复到正常的工作速度。 ...

  • 发布于 2021-03-25 23:19
  • 阅读 ( 318 )

如何在Windows10上整理硬盘

...使用内置工具对其进行碎片整理和优化。下面是方法。 什么是碎片整理(defragmentation)? 随着时间的推移,组成文件的数据块(片段)可能分散在硬盘表面的多个位置。这叫做碎片化。碎片整理会移动所有这些块,使它们在物理...

  • 发布于 2021-04-02 05:08
  • 阅读 ( 161 )

为什么mac硬盘不需要碎片整理

...的时间。在macOS(和Linux)上,您根本不需要担心它。为什么会这样,到底什么是碎片整理?我们来看看。 什么是碎片整理,为什么windows需要它(defragmenting, and why does windows need it)? 首先,让我们把这个放一边。您不需要对固...

  • 发布于 2021-04-04 23:59
  • 阅读 ( 152 )

为什么linux不需要碎片整理

...意到,Linux发行版没有附带磁盘碎片整理实用程序。但为什么呢? 要理解为什么Linux文件系统在正常使用时不需要碎片整理—而Windows文件系统需要碎片整理—您需要理解为什么会出现碎片整理,以及Linux和Windows文件系统的工作方...

  • 发布于 2021-04-09 02:10
  • 阅读 ( 141 )

我是否需要使用第三方软件“优化”我的ssd?

...个片段,磁头就必须四处移动才能读取文件——这就是为什么碎片会减慢机械驱动的速度,也就是为什么碎片整理会有帮助——磁头不需要移动那么多。固态驱动器没有磁头或任何其他运动部件。不管文件在驱动器上的什么位置...

  • 发布于 2021-04-09 03:50
  • 阅读 ( 181 )

我真的需要整理我的电脑吗?

...案:让我们通过几个场景进行解释,这样您就可以理解为什么您可能不需要进行碎片整理。 如果您使用的是带ssd驱动器的windows 如果您在计算机中使用SSD(固态驱动器),则不应对驱动器进行碎片整理以避免过度磨损事实上,W...

  • 发布于 2021-04-09 04:24
  • 阅读 ( 172 )

通过命令提示符深入了解windows碎片整理

...整理,才能保持高速运行。当WindowsVista和Windows7自动整理磁盘碎片时,这里有一些方法可以让你更深入地了解WindowsDefragmenter。 WindowsDiskDefragmenter在WindowsVista和Windows7中变成了一个非常精简的实用程序。事实上,Vista的磁盘碎片整...

  • 发布于 2021-04-13 03:39
  • 阅读 ( 207 )

通过整理虚拟磁盘碎片提高vmware vm性能

...您还应该定期整理主机的硬盘。这在Windows7和Vista中不是什么问题,因为它们会自动对硬盘进行碎片整理,但如果您使用的是XP,则可能需要设置自动磁盘碎片整理。或者,如果您想要更多的碎片整理控制,您可以始终在提升的命...

  • 发布于 2021-04-13 06:10
  • 阅读 ( 315 )

在WindowsXP中创建自己的Windows7样式的自动碎片整理

...或Windows7类似的工作方式。 对硬盘进行碎片整理可以确保磁盘上的数据是连续的,以便更容易地访问文件和程序。尽管它是否能提高最新机器的性能还没有定论,但最好知道你的驱动器总是井然有序的。默认情况下,它在Vista和w...

  • 发布于 2021-04-13 06:46
  • 阅读 ( 153 )

在windows 7或vista中配置磁盘碎片整理程序计划

Windows7或Vista会自动配置磁盘碎片整理,以安排碎片整理每周运行一次,通常在周三凌晨1点运行。我不知道你的情况,但我通常在星期三凌晨一点醒来,我宁愿把它安排在不同的时间。 要打开碎片整理实用程序,只需在“开始”...

  • 发布于 2021-04-14 15:04
  • 阅读 ( 109 )
zqszf5525
zqszf5525

0 篇文章

相关推荐