What is a file system?
In the heart of a computer, all consisting of 1 and 0, but the organization of this data is not as simple. A bit is a 1 or a 0; an octet (byte English) consists of eight bits; a binary kilobyte (kibibyte) is a group of 1024 bytes; a binary megabyte (mebibyte) is constituted of 1024 binary kilobytes; and thus continues the chain.
A hard drive (hard drive or hard disk) stores all your data: each time you save a file, you write thousands of 1s and 0s on a metal disc, pungent literally and creating an indentation that can later be reread as 1 or 0 by the computer. In reality, you magnetize thousands of small sticks (called clusters) that are polarized in one direction or another (N-S or S-N); this different polarization will be re-interpreted later by the computer as 1 or 0.
There is so much data on a hard disk that must be a way to organize them. It’s a bit like the old cabinets of books ID cards in a public library where all the books are identified: without these indexes, it would be impossible to easily find the books we seek. Libraries use mostly the Dewey decimal system to organize books in subjects; there are also other classification systems arriving at similar results, although none of them has reached the same popularity as the Dewey system.
File systems play exactly the same role as the index: organize your computer files on your hard drive so you can find them when you need them. File systems commonly used at present are surely the FAT32 and NTFS, which are the only file systems that can natively read Microsoft® Windows®. But just as there are other systems to classify books in a library, there are many other file systems: ext2, ext3, ReiserFS, JFS, XFS, …
The qualifications of a file system
Many different attributes are needed to define a file system. They include among others the maximum size that can have a file in that file system, the maximum size of a partition and journaling or not the file system.
The maximum file size
This criterion defines the maximum size that any file saved to a file system can have. So if you have a 100 megabyte file and attempt to save it to a file system that does not support files larger than 90 megabytes, the recording operation can not be completed and you will have to a corrupted file, incomplete.
The maximum partition size
This criterion defines the maximum size that can have a partition on a hard drive. Many characteristics cause greater or lesser limitations on the size of a partition formatted in a given file system. You will find further down on this page, a summary table of the main file systems encountered in the Linux user world; we reported it the maximum size that can have a score according to each of these file systems.
The management of access rights to files and directories
This criterion defines whether it is possible or not to assign the ownership of a file or directory to a user and a group of users, as well as to define what actions users have the right to on files and directories, as they own the file, member of the file owner or neither one nor the other. Possession and management of access rights associated individually performed with each file and directory.
The access rights that are usually found playing the file or directory, writing in it and its implementation. For example, the toto user has read and execute permissions on the directory foo, but not write; totopeut therefore launch these programs in this directory and open the files in it but can not edit or create new ones
Now about logging. A journaling file system is more reliable when entering the field of data storage. It has been explained above what actually happens when a file is saved on a hard disk (a sequence of 1’s and 0 is written to disk); but what happens if the writing of the chain is interrupted before its completion (which occurs, for example, during a power failure)? Your file is “corrupted” incomplete.
A journaling file system works to prevent such corruption when saving a file, instead of writing directly on the hard disk data to the exact location where they should be saved, the file system writes data to another part of the hard drive and notes the changes necessary in a newspaper, and then in the background, he returns each log entries and completes the work begun; when the task is done, it scratches the task from the list.
But how it prevents data loss? An example: let’s say you click the Save button in your word processor to save the foo.txt file. The computer first wrote a “draft” defoo.txt in a different part of the hard disk and writes the change to the file system log. Once this is done, the computer begins to transcribe the file (after 1 and 0) to its final location on the hard disk. Suddenly there is a power failure; while transcription of the file is interrupted. When power returns, even if the “clean”, the final version of your file is incomplete, you still have your draft in the file system of the newspaper; So the computer begins the transcript of the file, overwriting the corrupted data.
And if, by chance, the current was cut off when the computer wrote in the journal, you still happen to have a draft previously written in the log to recover your work.
“But, you say, it is much more advantageous to use a journaling file system! It’s more secure! Why should I use a non-journaled file system? “The use of a newspaper requires large storage capacity on your devices; these file systems are not adapted to the low-capacity media such as memory cards (memory sticks) and diskettes.
Special files of * nix systems: inode
Microsoft Windows users accustomed know it is not normally possible to modify the properties of a file (rename, move, delete …) when it is opened by a program; This restriction does not exist on UNIX-like file systems (ext2, ext3, ReiserFS …). The reason is that the files of * nix systems, files are indexed to a number known or inode inode and each inode has many attributes associated with it, such access rights, time stamp, file size etc. When you delete a file, what actually happens is that the inode is “loosed” from the file system (that is to say, it is not indexed), but if the programs are related inode (eg, if a text document is opened in a text editor, it has a link with this text editor), the file that the inode is associated continues to exist in the operating system and continues to be updated. A file is not actually deleted until all ties with its inode were cut (and again, the data still resides on the hard drive, but as they are not indexed, it is difficult to recover). What all this means is that you can remove programs while they are running without crash your operating system, rename or move files before they have finished being downloaded without corrupt and delete a file while it is still open in software.
Comparison of file systems
Below is a very brief comparison of the most common file systems and most used in the Linux user world.
file system name Maximum size of a maximum file size of a partition or not Logged? Management of access rights? Notes
(Extended File System) 4 2 TiB TiB No Yes Extended File System is the native Linux file system. In versions 1 and 2, it can be considered as obsolete because it has no logging. Ext2 can still be useful on 3½ floppy disks and other devices with storage space is limited, as no space should be reserved for a newspaper.
ext3fs 4 2 TiB TiB Yes ext3 is basically ext2 with managing logging. It is possible to pass a formatted ext2 to ext3 file system (and vice versa) without formatting.
Ext4FS 16 TiB 1 EiB Yes ext4 is the successor of ext3 file system. However, it is considered by its own designers as an interim solution pending the true next-generation system that will Btrfs
ReiserFS 8 TiB TiB 16 Yes Developed by Hans Reiser and the Namesys company, ReiserFS is recognized particularly to manage the files less than 4k. An advantage of ReiserFS, compared to ext3, is that it does not require a hierarchy also thrust: it is interesting for storing more temporary files from the Internet. By cons, ReiserFS is not recommended for laptops, because the drive is running continuously, which consumes a lot of energy.
(File Allocation Table) 2 GiB 2 GiB No No * Developed by Microsoft, this file system is less frequently encounter today. It is nevertheless used on 3½ formatted floppy disks under Windows and Linux should be used if a disk should also be read in Windows. It is also used by several manufacturers such as file system for memory cards (memory sticks), because, well documented, this file system remains the most widely used and accessible.
FAT32 4 GiB 8 TiB No No * This file system, also developed by Microsoft, is an evolution of its predecessor. Since its versions 2000 SP4 and XP, Windows can not format (or voluntarily blocks formatting) a FAT32 partition larger than 32GB. This limitation does not apply to Linux, as well as with versions earlier Windows. A FAT32 partition larger than 32GB formatted already can be read by Windows, regardless of its version.
(New Technology File System) 16 256 TiB TiB Yes Yes * This file system was also developed by Microsoft and there is very little documented. Writing for Linux on this file system is stable with the ntfs-3g driver. This driver is included in basic Ubuntu 7.10, and available in packets in deposits for earlier versions.
FAT32 and NTFS file systems
Among previous file systems, the only ones on which you can not install Linux are the NTFS, FAT and FAT32. In theory it might be possible to install Linux on one of these file systems, but that file system does not manage the access rights, it follows a highly non-secure operating system.
File systems created by Microsoft (FAT, FAT32 and NTFS) do not support the file permissions like Unix file systems (ext2, ext3, ReiserFS …). However, to be available on Linux, a file system must have the access rights system; to work around this limitation, Unix-like permissions are emulated on these file systems. This emulation is performed to mount a hard disk partition formatted with any of these file systems, and these rights are immutable all the time that this file system is in use.
It is not possible to change the permissions or the properties of a file or a folder on an NTFS or FAT32 file system. The only way to change this is to unmount the file system and then put it with different mounting options.
Microsoft® Windows®, the NTFS file system manages access rights based on a control list (ACL) is not taken into account in Linux. Linux can also support a form of ACL, but it is different from that implemented in NTFS. For this reason, the ACLs of NTFS file systems are simply ignored.