4

NTFS and EXT4 File Systems. What are the key differences between them? What are the similarities between them ?

3

1 Answer 1

10

NTFS

NT file system, NTFS, is designed to quickly perform standard file operations such as read, write, search,and even advanced operations such as file-system recovery on very large hard disks.

Formatting a volume with the NTFS file system results in the creation of several system files such as $MFT, Master File Table, $Bitmap, $LogFile and others.

The first information on an NTFS volume is the Partition Boot Sector ($Boot metadata file), which starts at sector 0 and can be up to 16 sectors long.

Encryption: The Encrypting File System (EFS) provides the core file encryption technology used to store encrypted files on NTFS volumes.

Disk Quotas: Windows 2000 supports disk quotas for NTFS volumes.

Reparse Points: Reparse points are new file system objects in NTFS that can be applied to NTFS files or folders.

Volume Mount Points: Volume mount points based on reparse points, volume mount points allow administrators to graft access to the root of one local volume onto the folder structure of another local volume.

Sparse Files: Sparse files allow programs to create very large files but consume disk space only as needed.

Distributed Link Tracking: NTFS provides a link-tracking service that maintains the integrity of shortcuts to files as well as OLE links within compound documents.

EXT4

Ext4 is the evolution of the most used Linux filesystem, Ext3. The result is a filesystem with an improved design, better performance, reliability and features.

Bigger filesystem/file sizes: Ext4 adds 48-bit block addressing, so it will have 1 EB of maximum filesystem size and 16 TB of maximum file size. 1 EB = 1,048,576 TB. Why 48-bit and not 64-bit? There are some limitations that would need to be fixed before making Ext4 fully 64-bit capable, which have not been addressed in Ext4. The Ext4 data structures have been designed keeping this in mind, so a future update to Ext4 will implement full 64-bit support at some point.

Sub directory scalability: Ext4 breaks that limit and allows an unlimited number of sub directories.

Extents: An extent is basically a bunch of contiguous physical blocks. It basically says "The data is in the next n blocks". For example, a 100 MB file can be allocated into a single extent of that size, instead of needing to create the indirect mapping for 25600 blocks (4 KB per block). Huge files are split in several extents. Extents improve the performance and also help to reduce the fragmentation, since an extent encourages continuous layouts on the disk.

Multiblock allocation Ext4 uses a "multiblock allocator" (mballoc) which allocates many blocks in a single call, instead of a single block per call, avoiding a lot of overhead. This improves the performance, and it's particularly useful with delayed allocation and extents.

Delayed allocation: Delayed allocation is a performance feature and it consists in delaying the allocation of blocks as much as possible, contrary to what traditionally filesystems do: allocate the blocks as soon as possible. For example, if a process write()s, the filesystem code will allocate immediately the blocks where the data will be placed - even if the data is not being written right now to the disk and it's going to be kept in the cache for some time.

Fast fsck Fsck is a very slow operation, especially the first step: checking all the inodes in the file system. In Ext4, at the end of each group's inode table will be stored a list of unused inodes (with a checksum, for safety), so fsck will not check those inodes. The result is that total fsck time improves from 2 to 20 times, depending on the number of used inodes.

Journal checksumming The journal is the most used part of the disk, making the blocks that form part of it more prone to hardware failure. And recovering from a corrupted journal can lead to massive corruption. Ext4 checksums the journal data to know if the journal blocks are failing or corrupted.

Online defragmentation While delayed allocation, extents and multiblock allocation help to reduce the fragmentation, with usage filesystems can still fragment. Ext4 will support online fragmentation, and there's a e4defrag tool which can defragment individual files or the whole filesystem.

Inode-related features: Larger inodes, nanosecond timestamps, fast extended attributes, inodes reservation. Ext4 will default to 256 bytes. This is needed to accommodate some extra fields, and the remaining space of the inode will be used to store extend attributes that are small enough to fit it that space. Inode reservation consists in reserving several inodes when a directory is created, expecting that they will be used in the future. Nanoseconds timestamps means that inode fields like "modified time" will be able to use nanosecond resolution.

Persistent preallocation This feature, available in Ext3 in the latest kernel versions, and emulated by glibc in the filesystems that don't support it, allows applications to preallocate disk space: Applications tell the filesystem to preallocate the space, and the filesystem preallocates the necessary blocks and data structures, but there's no data on it until the application really needs to write the data in the future.

Barriers on by default: This is an option that improves the integrity of the filesystem at the cost of some performance (you can disable it with "mount -o barrier=0", recommended trying it if you're benchmarking).

NTFS Source

EXT4 Source

1
  • 1
    @wb9688 I think this statement might be wrong. NTFS absolutely supports file permissions natively. In fact, IIRC, they are more complex than those supported by EXT4.
    – cjbarth
    Jun 17, 2019 at 23:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .