About Me

My photo
Kalyan Kumar Pasupuleti B-Tech(Information Technology). • AWS Certified Solutions Architect - Associate • RedHat Certified Engineer(RHCE) • Directory Services and Authentication Certificate of Expertise(LDAP) • Red Hat SELinux Policy Administration Certificate of Expertise(SELinux) • Network Services Security Certificate of Expertise (Network Services) • RedHat Certified Virtualization Administrator(RHCVA) • Red Hat Certified Security Specialist (RHCSS) Working as Cloud DevOps engineer

Tuesday, June 11, 2019

ext2 vs ext3 vs ext4 vs xfs file system differences


Ext2

             Ext2 stands for second extended file system.
             It was introduced in 1993. Developed by Rémy Card.
             This was developed to overcome the limitation of the original ext file system.
             Ext2 does not have journaling feature.
             On flash drives, usb drives, ext2 is recommended, as it doesn’t need to do the over head of 
               journaling.
             Maximum individual file size can be from 16 GB to 2 TB
             Overall ext2 file system size can be from 2 TB to 32 TB

How to create an ext2 filesystem
# mke2fs /dev/sda1


Ext3

             Ext3 stands for third extended file system.
             It was introduced in 2001. Developed by Stephen Tweedie.
             Starting from Linux Kernel 2.4.15 ext3 was available.
             The main benefit of ext3 is that it allows journaling.
             Journaling has a dedicated area in the file system, where all the changes are tracked. When
               the system crashes, the possibility of file system corruption is less because of journaling.
             Maximum individual file size can be from 16 GB to 2 TB
             Overall ext3 file system size can be from 2 TB to 32 TB
             There are three types of journaling available in ext3 file system.
o             Journal – Metadata and content are saved in the journal.
o             Ordered – Only metadata is saved in the journal. Metadata are journaled only after writing
               the content to disk. This is the default.
o             Writeback – Only metadata is saved in the journal. Metadata might be journaled either
                before or after the content is written to the disk.
             You can convert a ext2 file system to ext3 file system directly (without backup/restore).


How to create ext3 file system :-
# mkfs.ext3 /dev/sda1
(or)
# mke2fs –j /dev/sda1
( -j for adding journaling capability )
How to  convert  ext2 to ext3 :-
# umount /dev/sda2
# tune2fs -j /dev/sda2
# mount /dev/sda2  /var


 Ext4     

             Ext4 stands for fourth extended file system.
             It was introduced in 2008.
             Starting from Linux Kernel 2.6.19 ext4 was available.
             Supports huge individual file size and overall file system size.
             Maximum individual file size can be from 16 GB to 16 TB
             Overall maximum ext4 file system size is 1 EB (exabyte). 1 EB = 1024 PB (petabyte). 
              1 PB = 1024 TB (terabyte).
             Directory can contain a maximum of 64,000 subdirectories (as opposed to 32,000 in ext3)
             You can also mount an existing ext3 fs as ext4 fs (without having to upgrade it).
             Several other new features are introduced in ext4: multiblock allocation, delayed allocation,
               journal checksum. fast fsck, etc. All you need to know is that these new features have
               improved the performance and reliability of the filesystem when compared to ext3.
             In ext4, you also have the option of turning the journaling feature “off”.

Creating ext4 file system :-
# mkfs.ext4 /dev/sda1
(or)
# mke2fs -t ext4 /dev/sda1

Converting ext3 to ext4
( Warning :- Never try this live or production servers )
# umount /dev/sda2
# tune2fs -O extents,uninit_bg,dir_index  /dev/sda2
# e2fsck -pf /dev/sda2
# mount /dev/sda2 /var

Find your servers filesystem type
We can find the filesystem type used in our servers using any one of the following commands

# mount
/dev/sda3 on / type ext3 (rw)
proc on /proc type proc (rw)
/dev/sda1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
# file -sL /dev/sda1
/dev/sda1: Linux rev 1.0 ext3 filesystem data (needs journal recovery)
# df -T | awk ‘{print $1,$2,$7}’ | grep “^/dev”
/dev/sda3 ext3 /
/dev/sda1 ext3 /boot




XFS

XFS is a high-performance file system which was designed by SGI for their IRIX platform. 
Since XFS was ported to the Linux kernel in 2001, XFS has remained a preferred choice for many enterprise systems especially with massive amount of data.
XFS is  a high performance filesystem,due to its high performance, architectural scalability and robustness. For example, RHEL/CentOS 7 and Oracle Linux have adopted XFS as their default file system, and SUSE/openSUSE have long been an avid supporter of XFS.
XFS has a number of unique features that make it stand out among the file system crowd, such as scalable/parallel I/O, journaling for metadata operations, online de-fragmentation, suspend/resume I/O, delayed allocation for performance, etc.
If you want to create and mount an XFS file system on your Linux platform, here is how to do it.
XFS is packed full of cool features like 
  1. guaranteed rate I/O 
  2. online resizing
  3. built-in quota enforcement
  4. it can theoretically support filesystems up to 8 exabytes in size. 


It’s been used on Linux since about 2001, and is available as an install option on many popular Linux distributions. With variable block sizes, you can tune your system like a sliding scale to tweak for space efficiency or read performance. Best for extremely large file systems, large files, and lots of files Journaled (an asymmetric parallel cluster file system version is also available) POSIX extended access controls The XFS file system is Open Source and included in major Linux distributions. It originated from SGI (Irix) and was designed specifically for large files and large volume scalability. Video and multi-media files are best handled by this file system. Scaling to petabyte volumes, it also handles great deals of data. It is one of the few filesystems on Linux which supports Data Migration (SGI contributed the Hierarchical Storage Management interfaces into the Linux Kernel a number of years ago). SGI also offers a closed source cluster parallel version of XFS called cXFS which like cVxFS is an asymmetrical model. It has the unique feature, however, that it’s slave nodes can run on Unix, Linux and Windows, making it a cross platform file system. Its master node must run on SGI hardware. Recommended Use: If you really like to tweak your system to meet your needs, XFS is a great way to go.

The XFS file system is an extension of the extent file system .XFS is a high performance 64 bit journaling file system .Support of XFS was merged into the linux kernel in around 2002 and In 2009 Red Hat Enterprise Linux version 5.4 usage of XFS file system .
Default file system in RHEL7 is XFS
XFS supports maximum file system size of 8 exbibytes for 64 bit file system .Some comparison of XFS file system is XFS file system cannot be shrunk and poor performance with deletions of large numbers of files.
32-bit system 64-bit system
File size: 16 Terabytes 16 Exabytes
File system: 16 Terabytes 18 Exabytes


No comments:

Post a Comment