Raspberry Pi

How to Determine the File System Type in Raspberry Pi

Determining the file system type on a Linux system is crucial since it allows the users to know which file system function is used to access the data on the file system. There are several file systems with different features, thus, their ability to store or secure the file on the system is different too.

If you are curious about finding the file system on Raspberry Pi, follow this guide to learn different commands.

Determine the File System Type in Raspberry Pi

There are different commands to determine the file system type in Raspberry Pi, which are as follows:

  • Through df Command
  • Through lsblk Command
  • Through mount Command
  • Through file Command
  • Through fsck Command

Let’s talk about these commands in detail.

1: Determine File System Type Through df Command

The df command is widely used to display the file system information on the terminal. The following command lets you view the type of file system used by different disks on Raspberry Pi.

$ df -TH

2: Determine File System Type Through lsblk Command

There is another command called “lsblk” that provides the list of information about different block devices on your system, including the SD card or USB drives. Run the following “lsblk” command to determine the file system type.

$ lsblk -f

3: Determine File System Type Through mount Command

The mount command is mostly used to mount a file system or storage device to a directory and if you want to determine the file system type, you can use this command in the following way:

$ mount | grep "^/dev"

4: Determine File System Type Through file Command

You can also use the following file command in the Raspberry Pi terminal to determine the file system type of a disk. However, for that command, you have to provide the disk name.

$ sudo file -sL /dev/mmcblk0p2

5: Determine File System Type Through fsck Command

The fsck is another useful command that checks and repairs the file system on Linux and you can use this command to determine the file system type of a disk on Raspberry Pi system too.

$ fsck -N /dev/mmcblk0p2

Conclusion

Each disk on the system has a different file system and finding the information about the disk’s file system is straightforward through the commands like df, lsblk, mount, file and fsck. These commands will quickly display the file system type of a disk mounted on the Raspberry Pi system.

About the author

Awais Khan

I'm an Engineer and an academic researcher by profession. My interest for Raspberry Pi, embedded systems and blogging has brought me here to share my knowledge with others.