As of v. 2.18 (July 2010) util-linux
includes a tool that allows you to display a list of currently mounted file systems:
findmnt
You can switch from the default tree view to list view with -l
, define output columns with -o
(similar to lsblk
), filter results based on filesystem type with -t
etc...
findmnt -lo source,target,fstype,label,options,used -t ext4
SOURCE TARGET FSTYPE LABEL OPTIONS USED
/dev/sda1 / ext4 ARCH rw,noatime,discard,data=ordered 17.6G
/dev/sdb2 /media/DATA ext4 DATA rw,noatime,discard,data=ordered 44M
As of version 2.27 there's also support for JSON
output via -J
or --json
switch:
findmnt -Jo source,target,label,uuid -t ext4
{
"filesystems": [
{
"source": "/dev/nvme0n1p5",
"target": "/",
"label": "ARCH",
"uuid": "f21a53194-b02a-4e92-ad96-fdf9b8bc1db9",
"children": [
{
"source": "/dev/nvme0n1p6",
"target": "/run/media/data",
"label": "DATA",
"uuid": "321e288a-e67c-4b68-8d0b-89720210921f"
}
]
}
]
}
For more details read the man
page (and findmnt --help
to get the list of available columns).