6 ways to find out your Linux file system type

How an operating system accesses and manages these files is determinant on the file system used. For example, a USB drive formatted using the basic Linux file system (ext4) is inaccessible on a Windows computer. Let's show you ways to find out your Linux file system type. Most of them are commands that are executed on the Linux Terminal.

Any Operating system in the market whether its Windows, Linux, Unix, macOS, and any other, must be able to access and manage files and data on storage devices.

How an operating system accesses and manages these files is determinant on the file system used. For example, a USB drive formatted using the basic Linux file system (ext4) is inaccessible on a Windows computer. 

A lot of Linux distributions support quite a variety of file systems. They include ext, ext2, ext3, ext4, hpfs, iso9660, JFS, minix, msdos, ncpfs nfs, NTFS, proc, Reiserfs, smb, sysv, vfat, XFS, xiafs, and many more. 

With Linux operating systems, every data is configured as a file, from text data, images, device drivers, and many more. Every file system is divided into two parts; User data, which contains file system information and metadata, which holds the inode information.

The inode(metadata) holds information like Filename, type of file, file-permission, file-owner, Group-name, file-size, time-created, modified-time, time-deleted, hard-link, and soft-link, location in the directory hierarchy, etc..

Ways to find out your Linux system’s file type

In this post, we will put our focus on the Linux file systems. We will discuss ways that you can use to find out your Linux file system type. Most of them are commands that are executed on the Linux Terminal. Our distro of choice is Ubuntu 19.04 (Disco Dingo) and Fedora. 

1. The DF command

The df Linux command stands for Disk File-system. DF command alone displays the disk space utilization on your operating system. However, several parameters can be added to give it a lot more functionality. Execute df –help to see all of the parameters available. 

To display the file system, you will need to include the -Th parameter. In case you need elevated privileges, add the sudo command.

fosslinux-tuts:~$ sudo df -Th

df -Th command

The file system-type is listed under the Type column. You can also use it with a combination of other commands like grep to get detailed information. For example, to know the file system of all device (/dev) files, execute the command below.

fosslinux-tuts:~$ sudo df -Th | grep dev

fsck -N Grep dev
fsck -N Grep dev

Alternatively, use the df command to display the file system of a specific device. For example, the df command below prints the file system of the partition holding your current operating system. 

fosslinux-tuts:~$ df -Th /boot

df -Th_boot command
df -Th_boot command

2. The FSCK command

The fsck command checks the Linux file system and attempts repairs in case of an issue. However, with an additional parameter -N and the device path, it shows you the file system type.

fosslinux-tuts:~$ fsck -N /dev/sda

fsck -N _dev_sda
fsck -N _dev_sda

fosslinux-tuts:~$ fsck -N /dev/sdb1

fsck _N dev_sdb1
fsck _N dev_sdb1

3. The lsblk command

The lsblk command displays all the necessary information about all block devices present or a specific device depending on the path used. lsblk command gathers information by reading the sysfs filesystem and udev db. To display the file system type with lsblk, we will add the -f parameter.

Execute the command lsblk -f or lsblk -fs

fosslinux-tuts:~$ lsblk -f

lsblk -f command
lsblk -f command

4. The mount command

The mount command is used to load a file system in a Linux operating system. Other than that, it loads a remote file system or loads an ISO image. 

fosslinux-tuts:~$ mount | grep "/dev"

mount | grep "^dev"
mount | grep “^dev”

5. The blkid command

The blkid command displays the block device information, i.e., filesystem or swap. You will need to add the device label when using the blkid command.

fosslinux-tuts:~$ blkid /dev/sda

blkid _dev_sda1
blkid _dev_sda1 command

6. The file command

The file command determines the type of a file in a Linux system. It displays all the information about a given file. See the below example:

fosslinux-tuts:~$ file DSC_0627.JPG

file Image_File commmand
file Image_File command

To determine the disk file system, we will need to add the -s parameter. 

fosslinux-tuts:~$ file -sL /dev/sda1

file -sl _dev_sda1 command
file -sl _dev_sda1 command

Note, the file command might require elevated privileges; in such a case, use the sudo command.

fosslinux-tuts:~$ sudo file -sL /dev/sdb1

sudo file -sL _dev_sdb1
sudo file -sL _dev_sdb1

That’s it! Those are six ways to use to identify the file system used on your Linux system. Is there another method we have not listed? Please let our readers know in the comment section below.

Arun Kumar
Arun did his bachelor in computer engineering and loves enjoying his spare time writing for FOSS Linux. He uses Fedora as the daily driver and loves tinkering with interesting distros on VirtualBox. He works during the day and reads anything tech at night. Apart from blogging, he loves swimming and playing tennis.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

STAY CONNECTED

23,275FansLike
384FollowersFollow
16SubscribersSubscribe

LATEST ARTICLES

MUST READ

Buyers who wish to go for a machine that is based on Linux often show interest in Chromebooks due to the form factor and extended battery life capabilities. Although ChromeOS power these machines, users can still miss out on a more genuine Linux experience. For those who happen to agree, the new Lemur Pro by System76 might get some heads turning.
Linux is growing faster than ever. As per the latest report, there is a drop in the Windows 10 market share for the first time, and Linux's market share has improved to 2.87% this month. Most of the features in the list were rolled out in the Pop OS 20.04. Let's a detailed look into the new features, how to upgrade, and a ride through video.

CentOS vs. Fedora: Key Differences

Both Fedora and CentOS are RPM-based Linux distributions. The two share a lot of features in common but still have several differences. In this post, we introduce both Fedora and CentOS and look at their key differences in this comparison article.

Installing multiple Linux distros on a USB drive

A bootable Linux USB drive, which also referred to as a Live USB drive, is a drive containing files that enable a computer to boot into a specific Linux distro. It is most commonly used to test-drive various Linux distros before installing on the computer for use as a daily driver.

5 Things to do when your Linux system GUI freezes

All operating systems freeze at some point and, Linux distributions are no exceptions. In this post, we are going to look at five methods you can apply to your frozen system before thinking of plugging out the power cable or holding down the power button to power off the PC.

How to create a Live Linux USB drive using Etcher

In the Linux community, one thing is common between almost all of the users: trying out different Linux distributions. Most of the Linux based distributions have a great way of being tested as they provide ISO images for creating a Live USB.