7 ways to determine the file system type in Linux

Summary: Files are named, stored, retrieved, and updated on disks and partitions through file systems, which are the way files are organized on disks. The file system is divided into two parts: user data and metadata (file name, creation time, modification time, size, location in the directory hierarchy, etc.). In this guide, we'll use 7 methods to identify your Linux filesystem type, such as Ext2, Ext3, Ext4, BtrFS, GlusterFS, and more.

Files are named, stored, retrieved, and updated on disks and partitions through a file system, which is the way files are organized on a disk.

The file system is divided into two parts: user data and metadata (file name, creation time, modification time, size, location in the directory hierarchy, etc.).

In this guide, we'll use 7 methods to identify your Linux filesystem type, such as Ext2, Ext3, Ext4, BtrFS, GlusterFS, and more.

1. Use the df command The
df command reports the filesystem disk space utilization. To display the filesystem type of a specific disk partition, use the -T flag as follows:

$ df -Th
or
$ df -Th | grep "^/dev"
df Command Find Filesystem Type
df Command – Find Filesystem Type

To better understand the df command, read the following article:

12 Useful df Commands to Check Disk Space in Linux
Pydf - An Alternative to df, Colored Display disk usage
2. Use the fsck command
fsck is used to check and repair the Linux file system, it can also output the file system type of the specified disk partition.

The -N flag disables checking for filesystem errors, it just shows what will do (but we only need the filesystem type):

$ fsck -N /dev/sda3
$ fsck -N /dev/sdb1
fsck print Linux filesystem type
fsck --print Linux filesystem type

3. Use the lsblk command
lsblk will display block devices, and when the -f option is used, it will also print the filesystem type of the partition:

$ lsblk -f
lsblk display Linux filesystem type
lsblk – Display Linux filesystem type

4 , Using the mount command The
mount command is used to mount a file system in Linux, it can also be used to mount an ISO image, mount a remote Linux file system, and so on.

When run without any arguments, it prints information about the disk partition including the filesystem type:

$ mount | grep "^/dev"
Mount shows the filesystem type
in Linux Mount - shows the filesystem type in Linux

5 , Use the blkid command The
blkid command is used to find or print block device attributes, as long as the disk partition is used as a parameter:

$ blkid /dev/sda3
blkid find out the file system type
blkid - find out the file system type

6. Use the file command
The file command will recognize the file type, use the -s flag to enable reading block or character devices, and -L to enable symlink following:

$ sudo file -sL /dev/sda3
file recognize file system type
file – recognize file system type

7, use fstab file
/etc/fstab is a file with static filesystem information (such as mount point, filesystem type, mount options, etc.):

$ cat /etc/fstab
fstab show linux filesystem type
fstab - show linux filesystem type

original text Release time: 2017-03-11

This article is from Yunqi Community Partner "Linux China"

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326318140&siteId=291194637
Recommended