How to Determine the File System Type in Linux (Ext2, Ext3, or Ext4)?

Linux is an ocean of different kinds of file systems. Some distributions ship Ext4 as the default file system, while distributions like RedHat stick with an XFS.

Besides Ext4 and XFS, there are around 10+ file systems in Linux with unique features and few drawbacks. To know, your Linux system is running in which type of file system use the below method.

1. df Command

df (or Disk free) is UNIX based command to display the amount of free and occupied space in the system. With the help of -T flag (Display type of file system) and -h flag (Display sizes in human-readable format), you can list all the types of file systems used by different partitions in Linux.

$ df -Th
df -Th
df -Th

2. lsblk Command

lsblk (lists information about all of the specified block devices) is an interesting command-line tool to display mounted, unmounted file systems and devices without any files system.

Information will be displayed in a tree-like structure. Using -f a flag will output the file system information with the rest of the result.

$ lsblk -f
lsblk -f
lsblk -f

3. fsck Command

fsck (Filesystem check) is a system utility command to perform consistency checks and interactive repairs on the file system.

To prevent checking for a file system error, use -f a flag along with the partition name.

$ fsck -N /dev/sda1
fsck -N /dev/sda1
fsck -N /dev/sda1

4. blkid Command

blkid (Block identification) is a command-line utility to list available block devices in the system. Specify partition name along with the command to display the file system.

$ blkid /dev/sda1
blkid /dev/sda1
blkid /dev/sda1

5. file Command

The file command is used to determine the file type of any files or devices assigned along with the command.

Assign -s flag (read block and characters file) and -L flag (follow symlinks) along with partition name to list type file system.

$ sudo file -sL /dev/sda1
sudo file -sL /dev/sda1
sudo file -sL /dev/sda1

6. fstab file

Fstab (File system table) is a static system configuration file present by default in all Linux distributions at /etc/fstab.

The available disk, disk partition, and mounting partition are written in fstab. To read, use the cat command to read all of the content along with the file system type in Linux.

$ cat /etc/fstab
cat /etc/fstab
cat /etc/fstab

Final Thought

Above all, commands can help you list the file system type used in your Linux. Another way to find this is using GUI tools like GParted.

If you have any queries feel free to ask in the comment section.

0 0 votes
Article Rating
Subscribe
Notify of
guest
2 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
James
James
2 years ago

Open the GUI programs “gparted” or “gnome disk utility” and the file extension of each partition will be right there.
This can be particularly important is you have multiple partitions to make sure you are looking at the correct one, or looking for an external hard-drive or USB drive.