Monday, January 5, 2015

Why would you always choose ext3 over ext2 filesystem?

The answer in one word would be: JOURNALING.


ext2 does not support journaling while ext3 does. So does ext4 (if you are ok with an in-the-works kind of a filesystem).

What does journaling do?
Excerpt from the ubuntu help page:
A journaling file system is more reliable when it comes to data storage. Journaling file systems do not necessarily prevent corruption, but they do prevent inconsistency and are much faster at file system checks than non-journaled file systems. If a power failure happens while you are saving a file, the save will not complete and you end up with corrupted data and an inconsistent file system. Instead of actually writing directly to the part of the disk where the file is stored, a journaling file system first writes it to another part of the hard drive and notes the necessary changes to a log, then in the background it goes through each entry to the journal and begins to complete the task, and when the task is complete, it checks it off on the list. Thus the file system is always in a consistent state (the file got saved, the journal reports it as not completely saved, or the journal is inconsistent (but can be rebuilt from the file system)). Some journaling file systems can prevent corruption as well by writing data twice.
A more elaborate comparison of the filesystems from the same page is as below:

File System
Max File Size
Max Partition Size
Journaling
Notes
Fat16
2 GB
2 GB
No
Legacy
Fat32
4 GB
8 TB
No
Legacy
NTFS
2 TB
256 TB
Yes
(For Windows Compatibility) NTFS-3g is installed by default in Ubuntu, allowing Read/Write support
ext2
2 TB
32 TB
No
Legacy
ext3
2 TB
32 TB
Yes
Standard linux filesystem for many years. Best choice for super-standard installation.
ext4
16 TB
1 EB
Yes
Modern iteration of ext3. Best choice for new installations where super-standard isn't necessary.
reiserFS
8 TB
16 TB
Yes
No longer well-maintained.
JFS
4PB
32PB
Yes (metadata)
Created by IBM - Not well maintained.
XFS
8 EB
8 EB
Yes (metadata)
Created by SGI. Best choice for a mix of stability and advanced journaling.
GB = Gigabyte (1024 MB) :: TB = Terabyte (1024 GB) :: PB = Petabyte (1024 TB) :: EB = Exabyte (1024 PB)
Above you'll see a brief comparison of two main attributes of different filesystems, the max file size and the largest a partition of that data can be.
Of the above file systems the only one you cannot install Linux on is the NTFS. It is not recommended to install Linux on any type of FAT file system, because FAT does not have any of the permissions of a true Unix FS.

0 comments:

Post a Comment