Definition - What does Fragmentation mean?
Fragmentation, in the context of a hard disk, is a condition in which the contents of a single file are stored in different locations on the disk rather than in a contiguous space. This results in inefficient use of storage space as well as occasional performance degradation. Users frequently create, modify, delete and save files. Back-end operating systems (OS) continuously store these files on hard drives, which inevitably creates scattered files. When fragmentation occurs, the OS needs to consolidate stored files to enhance processing efficiency.
Techopedia explains Fragmentation
Fragmentation, which happens when the contents of a single file are stored in a non-contiguous space, occurs three forms:
- Internal fragmentation: Unusable allocated space that reduces performance. Files are stored in clusters, which are mini-allocated hard drive storage areas. Each file is automatically written at the beginning of a cluster, which creates a gap potential between the first and last file bytes, that is, slack space. Internal fragmentation also occurs when additional specific bytes are allocated to each file for alignment.
- External fragmentation: Unusable allocated storage space. Applications divide and allocate available space as drive data are read and written. Leftover space becomes fragmented due to allocating algorithm weakness, which renders available storage unusable. External fragmentation also occurs when a large number of files are created, modified and deleted, that is, deleted files are divided into smaller stored chunks.
- Data fragmentation: Occurs when large memory files are divided into smaller pieces and/or an OS tries to allocate large files to an external fragmented storage. For example, when a user creates new files and performs different operations (e.g., renaming, modifying and deletion), extremely small spaces are expected to hold new data files. However, if these new files require more overhead, the OS must seek storage that is greater than average.