File system: Difference between revisions

Content deleted Content added
References: Further reading per MOS:LAYOUT
Space management: Fixed typo, Fixed grammar
Tags: Mobile edit Mobile app edit
Line 15:
''Note: this only applies to file systems used in storage devices.''
 
{{[[File:100 000-files 5-bytes each -- 400 megs of slack space.png|frame|Example of slack space, demonstrated with 4,096-[[byte]] NTFS clusters: 100,000 files, each 5 bytes per file, equals 500,000 bytes of actual data, but requires 409,600,000 bytes of disk space to store <!-- The size listing shown in Explorer is oddly doubly-wrong. The example files are 5 bytes each, not 1K, and the clusters are a minimum of 4K not 1K.-->]]}}
 
File systems allocate space in a granular manner, usually multiple physical units on the device. The file system is responsible for organizing {{[[computer file|files]] and [[directory (file systems)|directories]]}}, and keeping track of which areas of the media belong to which file and which are not being used. For example, in {{[[Apple DOS]] of the early 1980s,[[ 256-byte sectors on 140 kilobyte floppy disk used]] }}a ''track/sector map''.{{Citation needed|date=September 2012}}
 
This results in unused space when a file is not an exact multiple of the allocation unit, sometimes referred to as ''slack space''. For a 512-byte allocation, the average unused space is 256 bytes. For 64&nbsp;KB clusters, the average unused space is 32&nbsp;KB. The size of the allocation unit is chosen when the file system is created. Choosing the allocation size based on the average size of the files expected to be in the file system can minimize the amount of unusable space. Frequently the default allocation may provide reasonable usage. Choosing an allocation size that is too small results in excessive overhead if the file system will contain mostly very large files.