- 7 Ways to Determine the File System Type in Linux (Ext2, Ext3 or Ext4)
- 1. Using df Command
- 2. Using fsck Command
- 3. Using lsblk Command
- 4. Using mount Command
- 5. Using blkid Command
- 6. Using file Command
- 7. Using fstab File
- If You Appreciate What We Do Here On TecMint, You Should Consider:
- /proc/filesystems: Find out what filesystems supported by Linux kernel
- How to see which filesystems are supported by the Linux
- Finding out Linux kernel modules
- Get a list of currently loaded Linux kernel modules
- How to load Linux kernel modules related to filesystem
- Conclusion
- File systems
- Contents
- Types of file systems
- Journaling
- FUSE-based file systems
- Stackable file systems
- Read-only file systems
- Clustered file systems
- Shared-disk file system
- Identify existing file systems
- Create a file system
- Mount a file system
- List mounted file systems
7 Ways to Determine the File System Type in Linux (Ext2, Ext3 or Ext4)
A file system is the way in which files are named, stored, retrieved as well as updated on a storage disk or partition; the way files are organized on the disk.
A file system is divided in two segments called: User Data and Metadata (file name, time it was created, modified time, it’s size and location in the directory hierarchy etc).
In this guide, we will explain seven ways to identify your Linux file system type such as Ext2, Ext3, Ext4, BtrFS, GlusterFS plus many more.
1. Using df Command
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 Command – Find Filesystem Type
For a comprehensive guide for df command usage go through our articles:
2. Using fsck Command
fsck is used to check and optionally repair Linux file systems, it can also print the file system type on specified disk partitions.
The flag -N disables checking of file system for errors, it just shows what would be done (but all we need is the file system type):
fsck – Print Linux Filesystem Type
3. Using lsblk Command
lsblk displays block devices, when used with the -f option, it prints file system type on partitions as well:
lsblk – Shows Linux Filesystem Type
4. Using mount Command
mount command is used to mount a file system in Linux, it can also be used to mount an ISO image, mount remote Linux filesystem and so much more.
When run without any arguments, it prints info about disk partitions including the file system type as below:
Mount – Show Filesystem Type in Linux
5. Using blkid Command
blkid command is used to find or print block device properties, simply specify the disk partition as an argument like so:
blkid – Find Filesystem Type
6. Using file Command
file command identifies file type, the -s flag enables reading of block or character files and -L enables following of symlinks:
file – Identifies Filesystem Type
7. Using fstab File
The /etc/fstab is a static file system info (such as mount point, file system type, mount options etc) file:
Fstab – Shows Linux Filesystem Type
That’s it! In this guide, we explained seven ways to identify your Linux file system type. Do you know of any method not mentioned here? Share it with us in the comments.
If You Appreciate What We Do Here On TecMint, You Should Consider:
TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.
If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.
We are thankful for your never ending support.
Источник
/proc/filesystems: Find out what filesystems supported by Linux kernel
S o, How do you find out or see which filesystems are supported by the Linux kernel? The answer is simple. Use /proc/filesystems file. It is the file used to detect filesystems supported by running kernel. You can quickly run grep command or cat command to display the list of all supported file system. nodev indicates that the file system is not associated with a physical device such as /dev/sdb1. If you see ext3 or vfat, it means you will be able to mount ext3 and vfat based file systems. This page explains filesystems supported by Linux using various commands.
How to see which filesystems are supported by the Linux
Following cat command will quickly tell you what filesystems supported by currently running Linux kernel:
$ cat /proc/filesystems
Sample outputs:
For example, if the iso9660 fllesystem not listed, you can not mount standard CD-ROM file system. To add support simply recompile Linux kernel with iso9660 filesystem support.
Finding out Linux kernel modules
Type the following ls command to list the Linux kernel modules related to filesystem:
ls /lib/modules/$(uname -r)/kernel/fs/*/*ko
Click to enlarge image
Get a list of currently loaded Linux kernel modules
Run any one of the following command:
cat /proc/modules
OR use the lsmod command along with grep command to filter out filesystems such as zfs:
lsmod
lsmod | grep zfs
Sample outputs:
- No ads and tracking
- In-depth guides for developers and sysadmins at Opensourceflare✨
- Join my Patreon to support independent content creators and start reading latest guides:
- How to set up Redis sentinel cluster on Ubuntu or Debian Linux
- How To Set Up SSH Keys With YubiKey as two-factor authentication (U2F/FIDO2)
- How to set up Mariadb Galera cluster on Ubuntu or Debian Linux
- A podman tutorial for beginners – part I (run Linux containers without Docker and in daemonless mode)
- How to protect Linux against rogue USB devices using USBGuard
Join Patreon ➔
Please note that the lsmod is an awesome command which nicely formats the contents of the /proc/modules, showing what kernel modules are currently loaded.
How to load Linux kernel modules related to filesystem
Linux based systems comes with the modprobe command, to add and remove modules from the Linux Kernel. To load zfs module, run:
sudo modprobe zfs
sudo modprobe -v zfs
See “how to load Linux kernel driver/modules automatically boot time” for more information.
Conclusion
You learned how to use various Linux command line utilities to list supported filesystems. See Linux wiki for more information here.
Category | List of Unix and Linux commands |
---|---|
Documentation | help • mandb • man • pinfo |
Disk space analyzers | df • duf • ncdu • pydf |
File Management | cat • cp • less • mkdir • more • tree |
Firewall | Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04 |
Linux Desktop Apps | Skype • Spotify • VLC 3 |
Modern utilities | bat • exa |
Network Utilities | NetHogs • dig • host • ip • nmap |
OpenVPN | CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04 |
Package Manager | apk • apt |
Processes Management | bg • chroot • cron • disown • fg • glances • gtop • jobs • killall • kill • pidof • pstree • pwdx • time • vtop |
Searching | ag • grep • whereis • which |
Shell builtins | compgen • echo • printf |
Text processing | cut • rev |
User Information | groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w |
WireGuard VPN | Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04 |
Comments on this entry are closed.
What does “nodev” in the beginning of a line mean?
It’s not always true. For example you will not see nfs and nfs4 in /proc/filesystems after reboot. But still you can mount remote nfs directory if needed packages are installed in the system. After successful mounting nfs and nfs4 will appear in /proc/filesystem. Tested on Ubuntu 11.10
i can still mount vfat usb drive even vfat not found in /proc/filesystems.But after mounting, it appears in /proc/filesystems too! Tested on kernel 2.4.35.4
The “nodev” string in the first column means that filesystem does not require a block device to be mounted, it’s so called virtual filesystem.
How to troubleshoot apache log errors. can u please explain step by step process in linux ??/
Just adding my 2 cents here. The only way to be sure about what filesystems are supported by the kernel or not is to check its configuration file. In my case, it is
and look for the filesystem type.
I searched for ISO9660 (for example) and found the following:
# CD-ROM/DVD Filesystems
#
CONFIG_ISO9660_FS=m
CONFIG_JOLIET=y
CONFIG_ZISOFS=y
CONFIG_UDF_FS=m
CONFIG_UDF_NLS=y
The “m” means it was compiled as a module but not automatically inserted into the kernel.
In order to load it into the kernel, we must run the following command:
modprobe -a isofs
(where isofs is the alias of the corresponding module)
And then iso9660 will show up in the /proc/filesystems file.
(on a side note, the aliases for modules can be found in /lib/modules, then look for the directory of your kernel, and read the file modules.alias)
Sorry, I forgot to include the path to my kernel’s configuration file. Here it is:
/boot/config-3.2.0-4-686-pae
I got a list of loadable filesystems this way:
ls /lib/modules/$(uname -r)/kernel/fs/*/*ko
Источник
File systems
In computing, a file system or filesystem controls how data is stored and retrieved. Without a file system, information placed in a storage medium would be one large body of data with no way to tell where one piece of information stops and the next begins. By separating the data into pieces and giving each piece a name, the information is easily isolated and identified. Taking its name from the way paper-based information systems are named, each group of data is called a «file». The structure and logic rules used to manage the groups of information and their names is called a «file system».
Individual drive partitions can be setup using one of the many different available filesystems. Each has its own advantages, disadvantages, and unique idiosyncrasies. A brief overview of supported filesystems follows; the links are to Wikipedia pages that provide much more information.
Contents
Types of file systems
The factual accuracy of this article or section is disputed.
See filesystems(5) for a general overview and Wikipedia:Comparison of file systems for a detailed feature comparison. File systems supported by the kernel are listed in /proc/filesystems .
File system | Creation command | Userspace utilities | Archiso [1] | Kernel documentation [2] | Notes |
---|---|---|---|---|---|
Btrfs | mkfs.btrfs(8) | btrfs-progs | Yes | btrfs.html | Stability status |
VFAT | mkfs.fat(8) | dosfstools | Yes | vfat.html | Windows 9x file system |
exFAT | mkfs.exfat(8) | exfatprogs | Yes | Native file system in Linux 5.4. [3] | |
mkexfatfs(8) | exfat-utils | No | N/A (FUSE-based) | ||
F2FS | mkfs.f2fs(8) | f2fs-tools | Yes | f2fs.html | Flash-based devices |
ext3 | mkfs.ext3(8) | e2fsprogs | Yes | ext3.html | |
ext4 | mkfs.ext4(8) | e2fsprogs | Yes | ext4.html | |
HFS | mkfs.hfsplus(8) | hfsprogs AUR | No | hfs.html | Classic Mac OS file system |
HFS+ | mkfs.hfsplus(8) | hfsprogs AUR | No | hfsplus.html | macOS (8–10.12) file system |
JFS | mkfs.jfs(8) | jfsutils | Yes | jfs.html | |
NILFS2 | mkfs.nilfs2(8) | nilfs-utils | Yes | nilfs2.html | Raw flash devices, e.g. SD card |
NTFS | No | ntfs.html | Windows NT file system. Kernel’s in-built driver has very limited write support. officially supported kernels are built without CONFIG_NTFS_FS so this driver is not available. | ||
mkfs.ntfs(8) | ntfs-3g | Yes | N/A (FUSE-based) | FUSE driver with extended capabilities. | |
ReiserFS | mkfs.reiserfs(8) | reiserfsprogs | Yes | ||
UDF | mkfs.udf(8) | udftools | Yes | udf.html | |
XFS | mkfs.xfs(8) | xfsprogs | Yes |
File system | Creation command | Kernel patchset | Userspace utilities | Notes |
---|---|---|---|---|
APFS | mkapfs(8) | linux-apfs-rw-dkms-git AUR | apfsprogs-git AUR | macOS (10.13 and newer) file system. Read only, experimental. |
Bcachefs | bcachefs(8) | linux-bcachefs-git AUR | bcachefs-tools-git AUR | |
NTFS3 | ntfs3-dkms AUR | Paragon NTFS3 driver FAQ | ||
Reiser4 | mkfs.reiser4(8) | reiser4progs AUR | ||
ZFS | zfs-linux AUR , zfs-dkms AUR | zfs-utils AUR | OpenZFS port |
Journaling
All the above filesystems with the exception of exFAT, ext2, FAT16/32, Reiser4 (optional), Btrfs and ZFS, use journaling. Journaling provides fault-resilience by logging changes before they are committed to the filesystem. In the event of a system crash or power failure, such file systems are faster to bring back online and less likely to become corrupted. The logging takes place in a dedicated area of the filesystem.
Not all journaling techniques are the same. Ext3 and ext4 offer data-mode journaling, which logs both data and meta-data, as well as possibility to journal only meta-data changes. Data-mode journaling comes with a speed penalty and is not enabled by default. In the same vein, Reiser4 offers so-called «transaction models» which not only change the features it provides, but in its journaling mode. It uses a different journaling techniques: a special model called wandering logs which eliminates the need to write to the disk twice, write-anywhere—a pure copy-on-write approach (mostly equivalent to btrfs’ default but with a fundamentally different «tree» design) and a combined approach called hybrid which heuristically alternates between the two former.
The other filesystems provide ordered-mode journaling, which only logs meta-data. While all journaling will return a filesystem to a valid state after a crash, data-mode journaling offers the greatest protection against corruption and data loss. There is a compromise in system performance, however, because data-mode journaling does two write operations: first to the journal and then to the disk (which Reiser4 avoids with its «wandering logs» feature). The trade-off between system speed and data safety should be considered when choosing the filesystem type. Reiser4 is the only filesystem that by design operates on full atomicity and also provides checksums for both meta-data and inline data (operations entirely occur, or they entirely do not and does not corrupt or destroy data due to operations half-occurring) and by design is therefore much less prone to data loss than other file systems like Btrfs.
Filesystems based on copy-on-write (also known as write-anywhere), such as Reiser4, Btrfs and ZFS, have no need to use traditional journal to protect metadata, because they are never updated in-place. Although Btrfs still has a journal-like log tree, it is only used to speed-up fdatasync/fsync.
FUSE-based file systems
Stackable file systems
- aufs — Advanced Multi-layered Unification Filesystem, a FUSE based union filesystem, a complete rewrite of Unionfs, was rejected from Linux mainline and instead OverlayFS was merged into the Linux Kernel.
http://aufs.sourceforge.net || linux-aufsAUR
- eCryptfs — The Enterprise Cryptographic Filesystem is a package of disk encryption software for Linux. It is implemented as a POSIX-compliant filesystem-level encryption layer, aiming to offer functionality similar to that of GnuPG at the operating system level.
https://ecryptfs.org || ecryptfs-utils
- mergerfs — a FUSE based union filesystem.
https://github.com/trapexit/mergerfs || mergerfsAUR
- mhddfs — Multi-HDD FUSE filesystem, a FUSE based union filesystem.
http://mhddfs.uvw.ru || mhddfsAUR
- overlayfs — OverlayFS is a filesystem service for Linux which implements a union mount for other file systems.
https://www.kernel.org/doc/html/latest/filesystems/overlayfs.html || linux
- Unionfs — Unionfs is a filesystem service for Linux, FreeBSD and NetBSD which implements a union mount for other file systems.
https://unionfs.filesystems.org/ || not packaged? search in AUR
- unionfs-fuse — A user space Unionfs implementation.
https://github.com/rpodgorny/unionfs-fuse || unionfs-fuse
Read-only file systems
- EROFS — Enhanced Read-Only File System is a lightweight read-only file system, it aims to improve performance and compress storage capacity.
https://www.kernel.org/doc/html/latest/filesystems/erofs.html || erofs-utils
- SquashFS — SquashFS is a compressed read only filesystem. SquashFS compresses files, inodes and directories, and supports block sizes up to 1 MB for greater compression.
https://github.com/plougher/squashfs-tools || squashfs-tools
Clustered file systems
- Ceph — Unified, distributed storage system designed for excellent performance, reliability and scalability.
https://ceph.com/ || ceph
- Glusterfs — Cluster file system capable of scaling to several peta-bytes.
https://www.gluster.org/ || glusterfs
- IPFS — A peer-to-peer hypermedia protocol to make the web faster, safer, and more open. IPFS aims replace HTTP and build a better web for all of us. Uses blocks to store parts of a file, each network node stores only content it is interested, provides deduplication, distribution, scalable system limited only by users. (currently in alpha)
https://ipfs.io/ || go-ipfs
- MooseFS — MooseFS is a fault tolerant, highly available and high performance scale-out network distributed file system.
https://moosefs.com || moosefs
- OpenAFS — Open source implementation of the AFS distributed file system
https://www.openafs.org || openafsAUR
- OrangeFS — OrangeFS is a scale-out network file system designed for transparently accessing multi-server-based disk storage, in parallel. Has optimized MPI-IO support for parallel and distributed applications. Simplifies the use of parallel storage not only for Linux clients, but also for Windows, Hadoop, and WebDAV. POSIX-compatible. Part of Linux kernel since version 4.6.
https://www.orangefs.org/ || not packaged? search in AUR
- Sheepdog — Distributed object storage system for volume and container services and manages the disks and nodes intelligently.
https://sheepdog.github.io/sheepdog/ || sheepdogAUR
- Tahoe-LAFS — Tahoe Least-Authority Filesystem is a free and open, secure, decentralized, fault-tolerant, peer-to-peer distributed data store and distributed file system.
https://tahoe-lafs.org/ || tahoe-lafsAUR
Shared-disk file system
- GFS2 — GFS2 allows all members of a cluster to have direct concurrent access to the same shared block storage
https://pagure.io/gfs2-utils || gfs2-utilsAUR
- OCFS2 — The Oracle Cluster File System (version 2) is a shared disk file system developed by Oracle Corporation and released under the GNU General Public License
https://oss.oracle.com/projects/ocfs2/ || ocfs2-toolsAUR
- VMware VMFS — VMware’s VMFS (Virtual Machine File System) is used by the company’s flagship server virtualization suite, vSphere.
https://www.vmware.com/products/vi/esx/vmfs.html || vmfs-toolsAUR
Identify existing file systems
To identify existing file systems, you can use lsblk:
An existing file system, if present, will be shown in the FSTYPE column. If mounted, it will appear in the MOUNTPOINT column.
Create a file system
File systems are usually created on a partition, inside logical containers such as LVM, RAID and dm-crypt, or on a regular file (see Wikipedia:Loop device). This section describes the partition case.
Before continuing, identify the device where the file system will be created and whether or not it is mounted. For example:
Mounted file systems must be unmounted before proceeding. In the above example an existing filesystem is on /dev/sda2 and is mounted at /mnt . It would be unmounted with:
To find just mounted file systems, see #List mounted file systems.
To create a new file system, use mkfs(8) . See #Types of file systems for the exact type, as well as userspace utilities you may wish to install for a particular file system.
For example, to create a new file system of type ext4 (common for Linux data partitions) on /dev/sda1 , run:
The new file system can now be mounted to a directory of choice.
Mount a file system
To manually mount filesystem located on a device (e.g., a partition) to a directory, use mount(8) . This example mounts /dev/sda1 to /mnt .
This attaches the filesystem on /dev/sda1 at the directory /mnt , making the contents of the filesystem visible. Any data that existed at /mnt before this action is made invisible until the device is unmounted.
fstab contains information on how devices should be automatically mounted if present. See the fstab article for more information on how to modify this behavior.
If a device is specified in /etc/fstab and only the device or mount point is given on the command line, that information will be used in mounting. For example, if /etc/fstab contains a line indicating that /dev/sda1 should be mounted to /mnt , then the following will automatically mount the device to that location:
mount contains several options, many of which depend on the file system specified. The options can be changed, either by:
- using flags on the command line with mount
- editing fstab
- creating udev rules
- compiling the kernel yourself
- or using filesystem-specific mount scripts (located at /usr/bin/mount.* ).
See these related articles and the article of the filesystem of interest for more information.
List mounted file systems
To list all mounted file systems, use findmnt(8) :
findmnt takes a variety of arguments which can filter the output and show additional information. For example, it can take a device or mount point as an argument to show only information on what is specified:
findmnt gathers information from /etc/fstab , /etc/mtab , and /proc/self/mounts .
Источник