user
How do I know if a partition is ext2, ext3, or ext4?
alphonsio

You can determine whether a partition is formatted with ext2, ext3, or ext4 by using several command-line tools in Linux. Here are a couple of methods:

Method 1: Using df

  1. Open a terminal.
  2. Type the following command:
df -T

This command lists all devices and their file system types, including whether they are ext2, ext3, or ext4 in the type column.

Method 2: Using file

  1. Open a terminal.
  2. Type the following command:
sudo file -sL /dev/sd*

This command lists the format of data in a device file.

Method 3: Using lsblk with -f option

  1. Open a terminal.
  2. Type the following command:
lsblk -f

This command lists all block devices and their file system types, including whether they are ext2, ext3, or ext4.

Method 4: Using blkid

  1. Open a terminal.
  2. Run the blkid command:
sudo blkid

This command will also show you the type of filesystems for all the partitions. Look for the TYPE field in the output.

Method 5: Using df and file commands

  1. Find your mounted partition by using:
df -h  

Note the device name you are interested in (e.g., /dev/sda1).

  1. Check the file system type with a command like:
sudo file -sL /dev/sda1

Replace /dev/sda1 with the actual device path. This command provides detailed information about the file system.

Method 6: mount or /proc/mounts

  1. Simply typing mount or cat /proc/mounts will show you all mounted file systems including their type:
mount

or

cat /proc/mounts

Look for the partition or mount point you are interested in, and next to it, there will be information about the file system type (ext2, ext3, or ext4).

More Information:

  • ext2 doesn't have journaling feature.
  • ext3 is essentially ext2 with journaling.
  • ext4 is an advanced level of ext3 which includes extents, improved performance and more.

Remember that if you are unsure or don't have particular tools install them or use the tool that is readily available on your Linux distribution. Also, ensure you have the necessary permissions to run these commands (some commands might require sudo).