Tag Archives: linux interview question

Difference between ext2, ext3 and ext4

List of differences between ext2, ext3, and ext 4 Linux file systems. One of the Linux interview questions answered in this article!

Comparison : ext2 vs ext3 vs ext4

This is another Linux interview question. What is the difference between ext2, ext3, and ext4 file systems? Or Explain Linux file system ext2 vs ext3 vs ext4? In this article we will walk through these differences and lastly I will present you all of them in tabular format so that they are easy to quickly read during your preparations.

Let’s see each file system’s features and lastly their comparison with other file systems.

EXT2 file system

  • It’s a second extended file system that was created to overcome limitations of the EXT file system.
  • Introduced in 1993 by Remy Card. It was the first commercial-grade filesystem for Linux
  • Does not supports Journaling
  • Fit for SD cards & USB drives since it has high performance and low writes (as journaling is not available). USB and SD storage are limited with write cycles hence its best fit for them.
  • Limits: Individual file size 16GB to 2TB. File system size 2TB to 32TB.

Limits are calculated based on block size used.  Block size varies from 1KB to 8KB. For example,  If 1KB block size is used max file size can go up to 16GB and for 8KB it’s 2TB. Middle range sizes being 2KB and 4KB which has file size limits of 256GB & 2TB (not mentioned in above limits) respectively. The same applies to the File system size limits defined above.

EXT3 file system

  • It’s third extended file system was created to overcome limitations of the EXT2 file system.
  • Introduced in 2001 by Stephen Tweedie. It was the most common filesystem in any Linux distro.
  • Supports Journaling
  • Journaling keeps track of file changes which helps in fast recovery and reduce chances of data loss in case of a system crash
  • Limits: Individual file size 16GB to 2TB. File system size 4TB to 32TB.
  • Upgrading FS from ext2 to ext3 is an online process without downtime.

EXT4 file system

  • It’s the fourth extended file system that was created to overcome limitations of the EXT3 file system.
  • Introduced in 2008 by a team of developers. Its most the latest filesystem in ext family.
  • Supports Journaling
  • Lots of new features introduced. Extents, Backward compatibility, Persistent pre-allocation, Delayed allocation, Unlimited number of subdirectories, Journal checksum, Faster FS check, Transparent encryption.
  • Limits: Individual file size 16GB to 16TB. File system size up to 1EB.
  • Upgrading FS not needed. Due to backward compatibility, ext2, ext3 can be directly mounted as ext4.

All above points can be formatted in tabular format as below :

ParameterEXT2EXT3EXT4
Introduced year

199320012008
Developed by

Remy Card Stephen Tweedie Team of developers
Journaling Not available Available Available
Individual file size

16GB to 2TB 16GB to 2TB 16GB to 16TB
File system size

2TB to 32TB 4TB to 32TB up to 1EB
Upgrade Can be done online to EXT3. Can be mounted as EXT4. No upgrade needed Can be mounted as EXT4. No upgrade needed NA

Difference between LVM and LVM2: Linux interview question explained

Post stating point-wise differences between LVM and LVM2 explained. This is one of the frequently asked questions for the Linux interview.

One of the frequently asked Linux interview questions is ‘what is the difference between LVM and LVM2?’ to which most of the candidate’s flanks. In this article, we will be discussing this question.

First of all, what is LVM? LVM is a logical volume manager. It is a widely used volume manager in Linux and Unix like VxVM (Veritas volume manager). As a sysadmin, you must be knowing all tasks which can be done in LVM but not a theoretical question like the difference between LVM and LVM2.

LVM and LVM2 are two different versions of LVM. Obviously, LVM2 being the latest. Their differences can be identified in terms of their functions, services offered, availability, etc. Let’s see one by one :

Availability :

LVM is available in most of the famous distributions like HPUX, Redhat, Suse, etc. LVM2 is available only kernel version 2.6.9 and above like RHEL4 and later. You can even build LVM modules as per your kernel (if its not available in your distributions). Setup information can be found here.

Compatibility :

LVM2 has backward compatibility with LVM. It has the same command modules and infrastructure like LVM with enhanced features. LVM being the previous version don’t have compatibility with LVM2 features.

Size limits :

Different size limits are increased in the new LVM2. The maximum file system/device size was capped to 2TB in LVM whereas its 16TB(32-bit CPU) & 8EB (64 bit CPU) in LVM2.

Max LV and PV were 255 in LVM. In LVM2 it has no limit (snippet from vgcreate manpage below).

 -l, --maxlogicalvolumes MaxLogicalVolumes
              Sets the maximum number of logical volumes allowed in this  vol-
              ume  group.  The setting can be changed with vgchange.  For vol-
              ume groups with metadata in lvm1 format, the limit  and  default
              value  is  255.   If  the metadata uses lvm2 format, the default
              value is 0 which removes this  restriction:  there  is  then  no
              limit.

 -p, --maxphysicalvolumes MaxPhysicalVolumes
              Sets  the  maximum number of physical volumes that can belong to
              this volume group.  The setting can be  changed  with  vgchange.
              For  volume  groups  with metadata in lvm1 format, the limit and
              default value is 255.  If the metadata  uses  lvm2  format,  the
              value  0  removes  this restriction: there is then no limit.

Extra features :

LVM2 is bundled with below extra features over LVM :

  1. Volume mirroring support
  2. Shared volume support with GFS
  3. Transnational metadata for fast recovery
  4. Cluster suite failover supported
  5. Striped volume expansion

This sums up the difference between LVM and LVM2 versions. Write to us in comments if you have corrections/suggestions.