Identify mounted filesystems
Transparency
Tools like mount and findmnt reveal which partitions and filesystems are mounted on your computer.
When creating a boot medium or expanding a system, you often need to create a new partition or add a filesystem to an existing partition. Selecting the wrong device can cost you valuable data.
Tools like partx
, fdisk
/cfdisk
, gdisk
/cgdisk
, mount
, lsblk
, and findmnt
help you discover which partitions and filesystems are present on the system and where they are currently mounted. We take you on a quick tour of some of these partition and filesystem tools, which are found on most of the standard Linux distributions.
Disk Tools
To make sure that you pass the correct parameters to the commands, you first need an overview of the volumes that exist on the system. The partx
program will help you here. The --show
switch tells it to list the individual partitions (Figure 1).
The output includes six columns with the partition number, start and end blocks, number of blocks, size, name, and UUID of the partition. The example shows six partitions /dev/sda1
, /dev/sda2
, and /dev/sda5
to /dev/sda8
.
This output already gives you a brief overview. However, it does not yet show you how the individual partitions are structured. fdisk
, which outputs the individual partitions if you pass in the -l
option (Figure 2), provides a little more information. However, the program only works for disks with a capacity of up to 2TBe, whereas the gfdisk
and Parted tools can analyze larger disks.

Next up is cfdisk
. As you can see in Figure 3, cfdisk
provides even more information. This information includes the fact that /dev/sda1
is a primary partition, /dev/sda2
is an extended partition, and /dev/sda5
through /dev/sda8
contain logical partitions. In addition, it shows you the partition type – /dev/sda6
turns out to be a swap partition.

cfdisk
has a counterpart named cgdisk
, which works the same way as fdisk
/gdisk
. When it comes to partition tables, fdisk
and cfdisk
only support Master Boot Record (MBR) format. MBR is a boot sector format that was popular with BIOS-based computers for many years. On the other hand, gdisk
and cgdisk
also support the GUID Partition Table (GPT) format. GPT is the successor to MBR for partition tables on hard disks and part of the UEFI standard. FigFigure 4 shows the cgdisk
menu after calling cgdisk -l /dev/sda
.

However, all these programs do not help to detect whether the listed partitions are mounted in the filesystem or where they sit in the directory tree. If you want answers to these questions, the lsblk
program comes into play.
Mounted Disks
lsblk
(the abbreviation stands for "list block devices") shows all block devices. The default view in lsblk
includes only the devices or partitions currently in use (Figure 5). In the right-hand column, you will find the mount point (i.e., the position at which the device is mounted in the directory tree).
The output of lsblk
has six columns. Table 1 gives an overview of the information you get from this list.
Table 1
lsblk
NAME |
Device name |
MAJ:MIN |
Main and extension numbers of the device |
RM |
0 for fixed and 1 for removable devices (like CD/DVD drives) |
SIZE |
Storage capacity of the device in human readable form |
TYPE |
Type of device (see Table 2) |
MOUNTPOINT |
Directory in which the device is mounted |
Table 2
lsblk Types
disk |
Hard disk |
loop |
Loop device |
lvm |
Logic Volume Manager (LVM)1 partition |
part |
Partition on a storage medium |
rom |
CD/DVD drive |
1 LVM is the abstract partitioning schema across disks, partitions, and filesystems. LVM enables dynamically changeable partitions (logical volumes) across multiple hard disks. |
---|
Using the -a
switch helps lsblk
bring more devices to light by including devices that are not currently in use. For example, Figure 6 shows a series of loop devices (virtual block devices that do not map to a physical device, but use a file for underlying storage) from /dev/loop0
to /dev/loop7
.
Filesystems
The -a
switch tells you which partitions exist and under which mount points they are mounted in the filesystem. So far, however, you do not know which options were set when mounting the partition. The mount
command shows these kinds of details (Figure 7).

The output from the command is quite extensive and often includes numerous virtual devices managed by the kernel and system programs. In many cases, however, only the physical mass storage devices and their mounted partitions are of interest.
Since Linux partitions mostly have the ext filesystem (today mostly ext4), you could filter the output of mount
with grep
accordingly. However, this detour is not actually necessary. Mount offers a -t
(short for --type
) switch that outputs filesystems of a certain type only. For example, the command in Figure 8 only returns partitions formatted with ext4.

mount
provides so much information that clarity can suffer. The output of findmnt
from the same software package offers a better structure. When called without further options, findmnt
shows a tree view (Figure 9) from which you can see how the individual filesystems are mounted. The findmnt
command also identifies the origin and type of the filesystem and the options with which it was mounted.

findmnt
also supports the -t
option, with which you can filter for ext4 filesystems, for example (Figure 10). Unlike mount
, findmnt
isn't limited to a single filesystem parameter but lets you enter several if required.
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you've found an article to be beneficial.
News
-
Fedora 39 Beta is Now Available for Testing
For fans and users of Fedora Linux, the first beta of release 39 is now available, which is a minor upgrade but does include GNOME 45.
-
Fedora Linux 40 to Drop X11 for KDE Plasma
When Fedora 40 arrives in 2024, there will be a few big changes coming, especially for the KDE Plasma option.
-
Real-Time Ubuntu Available in AWS Marketplace
Anyone looking for a Linux distribution for real-time processing could do a whole lot worse than Real-Time Ubuntu.
-
KSMBD Finally Reaches a Stable State
For those who've been looking forward to the first release of KSMBD, after two years it's no longer considered experimental.
-
Nitrux 3.0.0 Has Been Released
The latest version of Nitrux brings plenty of innovation and fresh apps to the table.
-
Linux From Scratch 12.0 Now Available
If you're looking to roll your own Linux distribution, the latest version of Linux From Scratch is now available with plenty of updates.
-
Linux Kernel 6.5 Has Been Released
The newest Linux kernel, version 6.5, now includes initial support for two very exciting features.
-
UbuntuDDE 23.04 Now Available
A new version of the UbuntuDDE remix has finally arrived with all the updates from the Deepin desktop and everything that comes with the Ubuntu 23.04 base.
-
Star Labs Reveals a New Surface-Like Linux Tablet
If you've ever wanted a tablet that rivals the MS Surface, you're in luck as Star Labs has created such a device.
-
SUSE Going Private (Again)
The company behind SUSE Linux Enterprise, Rancher, and NeuVector recently announced that Marcel LUX III SARL (Marcel), its majority shareholder, intends to delist it from the Frankfurt Stock Exchange by way of a merger.