Linux file system is generally a built-in layer of a Linux operating system used to handle the data management of the storage. It controls how data is stored and retrieved. It manages the file name, file size, creation date, and much more information about a file.
We will cover how to check file system type in Linux.
What is file system?
In computing, file system or filesystem (often abbreviated to fs) is a method and data structure that the operating system uses to control how data is stored and retrieved. Without a file system, data placed in a storage medium would be one large body of data with no way to tell where one piece of data stopped and the next began, or where any piece of data was located when it was time to retrieve it.
By separating the data into pieces and giving each piece a name, the data is easily isolated and identified. Taking its name from the way a paper-based data management system is named, each group of data is called a “file.” The structure and logic rules used to manage the groups of data and their names is called a “file system.”
File systems in Linux
Linux ships with different file systems from which to choose, including Btrfs, Ext4, Ext3, Ext2 and XFS. Each file system has its own advantages and disadvantages. For a side-by-side feature comparison of the major operating systems in Linux Enterprise Server, see http://www.suse.com/products/server/technical-information/#FileSystem
Using df Command to check file system type in Linux
df command reports file system disk space usage, to include the file system type on a particular disk partition, use the -T flag as below:$df -Th
The df command is used to display information about the file system type in Linux. This command can be used to get information about the amount of space that is being used on a file system, as well as the type of file system that is being used.
To use the df command, you will need to open a terminal window and type the df command followed by the file system that you want to get information about.
For example, if you wanted to get information about the /home directory, you would type the following command: df -Th /home
Using lsblk Command to check file system type in Linux
The lsblk command can be used to check the file system type in Linux. This command can be used to view information about all of the block devices on the system.
The lsblk command displays a list of all of the block devices on the system, as well as information about each device. This information includes the device name, the size of the device, the type of device, and the mount point.
lsblk lists information about all available or the specified block devices. The lsblk command reads the sysfs filesystem and udev db to gather information. with -f option, it will display the file system info. $ lsblk -f
Using mount Command to check file system type in Linux
The mount command mounts a storage device or filesystem, making it accessible and attaching it to an existing directory structure.When run without any arguments, it prints info about disk partitions including the file system type as below:
$ mount | grep “^/dev”
Using blkid Command to check file system type in Linux
The blkid command is a tool that can be used to identify and display information about block devices in Linux. This command can be used to find out the size of a device, the type of device, and other information about the device.
The blkid command can be useful for troubleshooting problems with block devices, or for displaying information about devices that are currently mounted.
To use the blkid command, you will need to specify the device that you want to display information about. $ blkid /dev/sda3
Using fstab File to check file system type in Linux
The /etc/fstab file is a file that contains information about the filesystems on your system. This file is used to mount filesystems at startup, and to specify the order in which filesystems should be mounted.
The /etc/fstab file is a useful tool for managing your filesystems, and it is a good idea to familiarize yourself with this file. The /etc/fstab is a static file system info (such as mount point, file system type, mount options etc) file: $ cat /etc/fstab
Using /proc/mounts to check file system type in Linux
The /proc/mounts file is part of the proc virtual file system. Using the command cat /proc/mounts, we can view the status of all mounted file systems:
/dev/sda4 /home ext3 rw 0 0 none /dev/shm tmpfs rw 0 0
As we can see from the above example, the format of /proc/mounts is very similar to that of /etc/mtab. $ cat /proc/mounts