A file system in a computer is the manner in which files are named and logically placed for storage and retrieval. It can be considered as a database or index that contains the physical location of every single piece of data on the respective storage device, such as hard disk, CD, DVD or a flash drive. This data is organized in folders, which are called directories. These directories further contain folders and files.
For storing and retrieving files, file systems make use of metadata, which includes the date the file was created, data modified, file size, and so on. They can also restrict users from accessing a particular file by using encryption or a password.
Files are stored on a storage media in “sectors”. Unused sectors can be utilized for storing data, typically done in sector groups known as blocks. The file system identifies the file size and position and the sectors that are available for storage. If a structure for organizing files wouldn’t exist, it would not be possible to delete or retrieve files, or to keep two files with the same name since all the files would exist in the same folder. For example, it is because of folders that we are able to name two different image files with the same name, as both exist in two different folders. But if two files are in the same directory, they cannot have the same name.
Most of the applications need a file system to work, hence every partition needs to have one. Programs are also dependent on file systems, which means that if a program is built to be used in Mac OS, it will not run on Windows.
Some Commonly Used File Systems
FAT File System
FAT or File Allocation Table is a file system used by operating systems for locating files on a disk. Due to fragmentation, files may be scattered around and divided into sections. FAT system keeps a track of all parts of the file. FAT has existed as a file system since the advent of personal computers.
- File Name
- FAT system in MS DOS allows file names of 8 characters only
- FAT file system in Windows supports long file name, with full file path being as long as 255 characters
- File name should start with alphanumeric characters
- File names can have any character except “/ \ = ,? ^“”
- File names can have more than one period and spaces. Characters that come after the last period in full file name are considered as the file extension.
- FAT file system does not support folder and local security. This means users logged into a computer locally will gain complete access to folders and files that lie in FAT partitions.
- It provides fast access to files. The rate depends upon the size of partition, file size, type of file and number of files in the folder.
FAT 32 File System
This is an advanced version of the FAT File system and can be used on drives ranging from 512 MB to 2 TB.
- It is more storage-efficient and supports up to 2TB of size
- Provides a better usage of disk space
- Easier access of files in partitions less than 500 MB or greater than 2GB in size
The figure below shows partitioning layout in FAT and FAT 32 file systems.
NTFS File System
The NTFS File System stands for New Technology File System.
- File name can be as long as 255 characters
- File names can have any character other than /\ “ \:*
- They are not case sensitive
- It provides folder and file security. This is done by passing on NTFS permission to files and folders. Security works at local as well as network level. Every file and folder in the list has an Access Control List that includes the users, security identifier, and the access privileges that are granted to the users.
- Files and partition sizes are larger in NTFS than those of FAT. An NTFS partition can be of a size as large as 16 Exabytes, but practically it is limited to 2TB. File size can range from 4GB to 64 GB.
- It provides up to 50% file compression
- It is a reliable and recoverable file system which makes use of transaction logs for updating files and folders automatically.
- It provides bad-cluster mapping. This means that it can detect bad clusters or erroneous space in the disk, retrieve the data in those clusters, and then store it in another space. To avoid further data storage in those areas, bad clusters are marked for errors.
EXT File Systems
Extended file system (EXT), Second Extended file system (EXT2) and Third Extended file system (EXT3) are designed and implemented on Linux. The EXT is an old file system that was used in pioneer Linux systems. EXT2 is probably one of the most widely used Linux file systems. EXT 3 also includes same features as EXT 2, but also includes journaling.
Here we will talk about the most commonly used EXT2. With the optimizations in kernel code, it provides robustness along with good performance whilst providing standard and advanced Unix file features.
- Supports standard file types in Unix i.e. regular files, device special files, directories, symbolic links
- Can manage file systems created on huge partitions. Originally, file system size was restricted to 2 GB, but with recent work in VFS layer, this limit has now increased to 4 TB.
- Reserves about 5 percent of blocks for administrator usage, thus allowing the admins to recover from situations of overfilled processes.
- Allows for secure deletion of files. Once data is deleted, the space is overwritten with random data to prevent malicious users from gaining access to the previous data.