Introduction
Each application creates its own file structure and a file created by one application is usually not usable by another except for some universal formats like ASCII, PDF, HTML, and RTF. However there is a basic underlying similarity in storage media in that all storage media are divided into storage blocks of 512 bytes each. In this paper we shall discuss the file structures in three operating systems – Mac OSX, Windows OS, and Linux/Unix.
Mac OS is Apples GUI (Graphic User Interface) based operating system. The newest releases since 2001 have been released under the brand name Mac OSX. The Mac OS or OSX follows what is known as the hierarchical file system(HFS) – called the MacHFS - also developed by Apple Inc. Depending on the total size of the storage media, the storage blocks – barring the blocks reserved for booting and other purposes - are grouped into allocation blocks. Each allocation block is given a unique 16-bit address with which it can be referenced. Blocks 0 through 2 are reserved for booting and storing data about the storage volume. Block 3 is used to store information about the allocation blocks. Data about the system – also called system data - is stored in especial files called system files. Mac OS uses the following system files –
Extent Over Flow File – This file stores information about which file is in which block. Later versions of Mac OS also store information about bad blocks so that the system does not allocate a bad block to any file.
The system files are in a B-Tree or Binary Tree structure which facilitates indexing and quick location of files.
The Mac OS has certain limitations in that it only allows for 65,535 blocks. Therefore, any storage medium can only store up to 65,535 files. In storage media with large capacity like 1GB disks, this results in a lot of wasted storage space.
Another limitation of this file system is that the Catalog file for files and directories is the same. In a multi-user system where a lot of multitasking is required, this results in slowing down of the system as only one application can write to the catalog file at a time. If a single user is working on a number of files, he may end up “hogging” the system and blocking other users. (Giampaolo, 1999)
The Windows File System
Windows uses a file system called NTFS (New Technology File System) along with FAT (File Allocation Table) system which was earlier used by DOS. FAT file system consists of a boot sector called the system descriptor sector, a file system block allocation table (FAT), and a storage space divided into blocks. The file allocation table contains information about which file is stored on which block. The table indicates whether or not a block is used along with information about files stored on the block.
NTFS is a newer system introduced by Microsoft with Windows NT. This system stores data about files in a Master File Table which is similar to FAT and provides additional features like encryption and access control.
Microsoft has now introduced a new file system called ReFS (Resilient File System) with Window 8. The main feature of this new file system is the Copy-on-Write (CoW) feature which never really deletes any data from the storage space. Any modifications to a file are stored in an unused disk space. New meta-data is created for the modified file and liked to meta-data of the older file. Thus several versions of the same file are stored and the risk of losing data is minimized. (UFS).
Linux/Unix File System
The file system for Unix is UFS which uses inodes to store meta data. Each inode stores data about a single file. This system is now outdated and no longer used. Linux uses a file system called Ext2. This system supports large disk partitions and file sizes. Ext3 and Ext4 are newer versions of the system.
In the Unix/Linux system everything is reduced to a file including directories. Some standard directories are used to store meta-data about directories, files, kernels, logs etc. (Lascon). These are –
The root directory denoted by /. This directory is mounted on a separate partition of the disk. All other directories are subdirectories of the root.
/bin is a directory which stores all information about standard Unix/Linux commands.
/boot stores the system files used to start up the system.
/etc stores the configuration files.
/dev stores the drivers for the various devices like printer etc.
/home stores the meta-data for the home directory of every user.
/lib stores the command line utilities for the system.
/mnt stores information about removable storage media like floppy disks and CD-ROMs.
/opt stores the various applications used on the system like WordPerfect.
/proc stores information about the various processes currently running on the system. This includes user data, the devices being used, and other necessary data.
/root is the home directory for the root directory user – the system administrator.
/sbin has the system administration commands like file permissions etc.
/tmp stores temporary files. This directory is periodically deleted.
/usr houses programs and administration commands which can be used by all users.
/var stores all variables and other logs.
Conclusion
The Mac, Windows, and Linux are all operating systems which store files and meta-data in different ways. Which system should be used depends on the requirement of the users. An in-depth understanding of the file system helps the system administrator to locate and solve any problems quickly and efficiently.
References
http://www.businessdictionary.com/definition/file-format.html
Giampaolo, Dominic (1999). Practical File System Design with the Be File System (PDF). Morgan Kaufmann. p. 37. ISBN 1-55860-497-9.
UFS - Understanding file systems (http://www.ufsexplorer.com/und_fs.php)
Lascon Storage – Unix and Linux File Systems (http://www.lascon.co.uk/UNIX-File-Systems.php)
(http://computernetworkingnotes.com/linux-file-system-basic-commands/linux-filesystems.html).