The main idea behind the mapping is the efficient use of file space and fast file access. There are three types of assignment:
1. contiguous assignment
2. linked assignment
3. indexed allocation
In addition to storing the actual file data on the disk drive, the file system also stores metadata about the files: the name of each file, when it was last edited, exactly where it is on the disk, and what parts of the disk "free". Free areas are not currently in use by file data or metadata, and are available for storing new files. (The places where these metadata are stored are often called "inodes", "chunks", "file allocation tables", etc.)
To track free space, the file system maintains a list of free space that tracks all free disk blocks. To create a file, the required space is reserved for the file and the corresponding space is removed from the free list linked to each other.
File structure
A file structure must conform to a required format that the operating system can understand.
• A file has a specific structure defined by its type.
• A text file is a sequence of characters arranged in lines.
• A source file is a sequence of procedures and functions.
• An object file is a sequence of bytes arranged in blocks that are understandable by the machine.
• When the operating system defines different file structures, it also contains the code to support this file structure. Unix, MS-DOS support a minimum number of file structures.