PC のハードディスクにデータの追加や削除を繰り返していると, データが連続した領域に保存されなくなることがある。改善策を講じない場合, どのような現象が起こり得るか。
平成23年度 特別試験 ITパスポート試験 問80
This question's explanation and your answers so far.
問 80
Incorrectア
Virus detection is performed by anti-virus software, which reads the contents of a file and compares them against the patterns in the virus definition file (pattern file), or monitors behavior. Whether a file is placed in a contiguous area on the disk or scattered in pieces is absorbed when the OS reads the contents through the file system, so what the anti-virus software sees is the same either way, and this has no effect whatsoever on whether a virus can be detected. A failure to detect comes from other factors — an outdated definition file, real-time scanning being turned off, or an unknown virus — and has nothing to do with fragmentation.
Incorrectイ
Even as fragmentation progresses, as long as free areas remain the OS can combine them and write the data, so writing does not stop being performed correctly. Because large contiguous free areas become scarcer, the number of positioning operations during writing also increases and the speed can drop, but that is a matter of speed, not of correctness. Data failing to be written correctly is a phenomenon caused by other faults: the disk running out of free capacity, bad sectors appearing on the recording surface, or the power being cut off during a write.
Incorrectウ
This is a confusing choice, but even when fragmentation occurs the data does not become unreadable. Where each fragment of a file sits on the disk and in what position it comes are recorded accurately in the file system's management information, and the OS follows that information to join the fragments back together in the correct order and restore them as a single file. The contents that are read out are therefore identical to what they were before fragmentation. Data becoming impossible to read correctly happens when a fault destroys the integrity of the data — bad sectors, deterioration of the medium, corruption of the management information — and is not a consequence of fragmentation. The point to keep straight is that what fragmentation brings about is a drop in speed, not a problem of correctness.
- エ
正解 The correct answer is エ. The state described in the question — data no longer being stored in contiguous areas after repeated additions and deletions — is called fragmentation. When a file is deleted, a small free area of that size is left behind, and such small free areas end up scattered here and there. When a new file is then written, it does not fit into any single free area, so the OS splits the file into several fragments and stores them one after another in separate free areas. In this way the contents of a single file come to be scattered across the disk. The important point here is that the information about which fragment is located where is correctly recorded in the management area of the file system (the FAT or an index). In other words, even when fragmentation occurs, the data itself is not damaged: the contents can be restored in complete form, and reading and writing do not start to fail. The only thing that gets worse is speed. A hard disk moves its magnetic head to the target position (a seek) and then waits for the disk to rotate into place before it reads or writes, so a file in a contiguous area can be read in one go after a single positioning, whereas for a fragmented file a seek and a rotational wait occur repeatedly, once for each fragment. The accumulation of this mechanical waiting time appears as a noticeable drop in access performance. Therefore the phenomenon that can occur when the situation is left alone without any corrective measure is that reading of the stored data becomes slow, so エ is correct. Incidentally, that corrective measure is defragmentation (defrag, or optimization), which rearranges the fragments and places files back into contiguous areas.
- Fragmentation — the state in which, through repeated adding and deleting of files, the free space becomes cut into small pieces and a single file ends up recorded split across several non-contiguous areas. On a hard disk the number of seeks and rotational waits increases, so the data is never damaged and only the access speed drops.
- Defragmentation (defrag, or optimization) — the maintenance task of rearranging fragmented files and placing them back into contiguous areas so that access performance is restored. The key to solving this kind of question is drawing the line clearly: the effect of fragmentation is limited to performance and does not extend to the correctness of reads and writes or to virus detection.