Before you can work with external storage, you need to confirm which drives the Linux kernel has successfully mounted. Knowing how to check mounted drives in linux is a fundamental skill for any system administrator or power user. This guide will walk you through every method, from simple commands to graphical tools, ensuring you always know what storage is available on your system.
When you plug in a USB drive or attach a new hard disk, Linux doesn’t always show it in your file manager right away. Understanding the mounted state of drives helps you troubleshoot issues, manage storage, and avoid data loss. Let’s start with the most common and powerful command-line tools.
How To Check Mounted Drives In Linux
The Linux kernel maintains a virtual filesystem called /proc/mounts that lists all currently mounted filesystems. However, there are much friendlier commands you can use. The mount command is the most direct way to see what’s mounted.
Open your terminal and type:
mount
This will output a long list of all mounted filesystems, including system partitions, pseudo-filesystems like proc and sysfs, and any external drives. The output shows the device, mount point, filesystem type, and mount options.
For a cleaner view, you can filter the output with grep. For example, to see only ext4 filesystems:
mount | grep ext4
This command is available on virtually every Linux distribution and doesn’t require root privileges for basic usage. It’s the go-to tool for quick checks.
Using The Df Command For Drive Space
The df command shows disk space usage for mounted filesystems. It’s particularly useful when you want to know how much space is left on a drive.
Run this in your terminal:
df -h
The -h flag makes the output human-readable, showing sizes in KB, MB, or GB. The output includes the filesystem device, total size, used space, available space, usage percentage, and mount point.
To see only specific filesystem types, use the -t option:
df -h -t ext4
This is especially helpful when you have many mounted drives and want to focus on your main storage. The df command is installed by default on all Linux systems.
Listing Block Devices With Lsblk
The lsblk command lists all block devices, including those that are not mounted. This gives you a complete picture of all drives connected to your system.
Type this in your terminal:
lsblk
The output shows device names (like sda, sdb), major/minor numbers, size, type (disk or partition), and mount points. If a partition is not mounted, the mount point column will be empty.
For more detail, use the -f flag to show filesystem information:
lsblk -f
This adds columns for filesystem type, label, UUID, and mount point. It’s one of the most comprehensive ways to see all drives and their current state.
You can also use lsblk -o to specify custom columns. For example:
lsblk -o NAME,SIZE,TYPE,MOUNTPOINT,FSTYPE
This gives you exactly the information you need without extra clutter. The lsblk command is part of the util-linux package and is available on all major distributions.
Checking Mounted Drives With Findmnt
The findmnt command is a newer tool that provides a tree-like view of mounted filesystems. It’s more visual than mount and easier to read.
Simply run:
findmnt
The output shows the target mount point, source device, filesystem type, and options. The tree structure makes it easy to see parent-child relationships, like which drives are mounted under /media.
To see only specific filesystem types, use the -t option:
findmnt -t ext4
You can also filter by mount point:
findmnt /mnt
This command is part of the util-linux package and is available on most modern distributions. It’s excellent for scripting because its output is easy to parse.
Using The /Proc/Mounts File Directly
For advanced users, the /proc/mounts file contains the kernel’s current mount table. You can read it with cat or less:
cat /proc/mounts
This file is dynamically generated and always up-to-date. It’s useful for scripting when you need raw data. However, it includes many pseudo-filesystems that aren’t actual drives.
To filter for real block devices, you can use:
cat /proc/mounts | grep /dev
This gives you only entries that involve physical or virtual block devices. It’s a low-level approach that works on every Linux system.
Graphical Methods To Check Mounted Drives
Not everyone likes the command line. Most Linux desktop environments provide graphical tools to see mounted drives.
In GNOME, open the Files application and look at the sidebar. Mounted drives appear under “Devices” or “Other Locations”. You can also use the Disks utility (gnome-disks) for a detailed view.
In KDE Plasma, use Dolphin file manager. Mounted drives show up in the Places panel. The KDE Partition Manager (partitionmanager) gives you a complete overview.
For XFCE, Thunar file manager shows mounted drives in the sidebar. You can also install the Disk Utility (gnome-disk-utility) for more control.
These graphical tools are user-friendly but may not show all system mounts. They are best for casual users who just want to see their external drives.
Checking Mounted Network Drives
Network filesystems like NFS or Samba also appear in the mount table. You can check them with the same commands.
For NFS mounts, use:
mount -t nfs
For Samba/CIFS mounts:
mount -t cifs
These commands show only network filesystems. The output includes the remote server and share path.
You can also use df -h to see network mounts, but they may be listed under different filesystem types. The findmnt command with -t nfs works well too.
Understanding Mount Points And Devices
When you check mounted drives, you’ll see entries like /dev/sda1 on / or /dev/sdb1 on /media/usb. The device name follows a pattern:
sdstands for SCSI disk, which includes SATA, USB, and SAS drives- The third letter (a, b, c) indicates the drive number
- The number (1, 2, 3) indicates the partition number
For example, /dev/sdb2 is the second partition on the second SCSI disk. NVMe drives use a different naming scheme like /dev/nvme0n1p1.
Mount points are directories where the filesystem is attached. Common mount points include:
/– root filesystem/home– user home directories/media– removable media (automounted)/mnt– manually mounted drives/run/media– used by some modern systems
Understanding this helps you interpret the output of any mount-checking command.
Automated Mounting And Systemd Mount Units
Modern Linux systems use systemd to manage mounts. You can check mounted drives via systemd with:
systemctl list-units --type=mount
This shows all mount units that systemd knows about. The output includes the unit name, load state, active state, and description.
For a more detailed view, use:
systemctl status '*.mount'
This is particularly useful when you want to see if a mount failed or is in a weird state. Systemd also creates mount units for /etc/fstab entries.
Checking Mounted Drives In Containers
If you’re using Docker or Podman, mounted drives inside containers are different from the host. Inside a container, use the same commands like mount or df.
On the host, you can see container mounts with:
mount | grep overlay
Docker uses overlay filesystems for containers. For bind mounts, you’ll see the host path in the mount output.
Podman works similarly. Use podman mount to see mounts for running containers.
Troubleshooting Common Mount Issues
Sometimes a drive doesn’t appear in the mount list. Here are common fixes:
- Check if the drive is detected:
lsblkorfdisk -l - Manually mount it:
sudo mount /dev/sdb1 /mnt - Check
dmesgfor kernel messages:dmesg | tail - Verify the filesystem type:
blkid /dev/sdb1 - Ensure the mount point exists:
ls -ld /mnt
If the drive is listed in lsblk but not mounted, you may need to create a mount point and mount it manually. If it’s not listed at all, check physical connections or driver support.
Using /Etc/Fstab For Permanent Mounts
The /etc/fstab file defines filesystems that should be mounted at boot. You can check what’s configured with:
cat /etc/fstab
This shows the device, mount point, filesystem type, options, dump, and pass fields. Not all entries in fstab are currently mounted—only those that were processed at boot.
To see which fstab entries are actually mounted, compare with the current mount table. The mount -a command mounts all entries in fstab that aren’t already mounted.
Checking Mounted Drives With Inotify
For real-time monitoring of mount events, you can use inotifywait on the /proc/mounts file:
inotifywait -m /proc/mounts
This watches for changes and prints them as they happen. It’s useful for debugging when drives are hotplugged.
You need to install inotify-tools first. This is an advanced technique but very powerful for system administrators.
Using The Blkid Command
The blkid command shows block device attributes like UUID and filesystem type. It doesn’t show mount points, but it helps identify drives.
Run:
sudo blkid
The output shows each block device with its UUID, TYPE, and optionally LABEL and PARTUUID. This is useful when you have multiple drives and need to identify them by UUID.
You can combine blkid with mount output to match devices to mount points. For example, find the UUID of a mounted drive with:
blkid $(mount | grep /mnt | awk '{print $1}' | sed 's/://')
Checking Mounted Drives In Recovery Mode
When booting into recovery mode or a live CD, you need to check which drives are mounted. Use the same commands, but note that the root filesystem may be mounted read-only.
First, remount root as read-write if needed:
mount -o remount,rw /
Then check mounts with mount or lsblk. In live environments, your hard drives may not be mounted automatically.
You can mount them manually to access data. Use lsblk to find the device, then mount it to a directory.
Scripting Mount Checks
You can automate mount checking with simple scripts. Here’s a bash example:
#!/bin/bash
echo "Currently mounted drives:"
mount | grep /dev/sd
echo "Space usage:"
df -h | grep /dev/sd
Save this as a script and make it executable. You can run it anytime to get a quick overview.
For more advanced scripting, parse /proc/mounts or use findmnt -J for JSON output. This makes it easy to integrate with monitoring tools.
Common Mistakes When Checking Mounted Drives
Beginners often confuse device names with mount points. Remember that /dev/sda1 is the device, and / is the mount point.
Another mistake is assuming all drives are listed in df. Drives that are not mounted won’t appear there. Always use lsblk first to see all available drives.
Some users forget to use sudo for commands like blkid or fdisk. These require root privileges to access raw device information.
Also, don’t rely solely on the file manager. It may hide system mounts or show only user-accessible drives. The command line gives you the full picture.
Performance Considerations
Checking mounted drives is a low-overhead operation. Commands like mount and df read kernel data structures and are very fast.
However, if you have many network mounts that are slow to respond, df may hang. Use the --direct flag or stat to avoid this.
For large systems with hundreds of mounts, consider using findmnt with filters to reduce output. The /proc/mounts file is always quick to read.
Security And Mounted Drives
Knowing what’s mounted is important for security. Unauthorized USB drives can be a vector for malware.
Regularly check mounts with mount or lsblk to ensure no unexpected devices are attached. You can also use auditd to log mount events.
For sensitive systems, disable automounting of removable media. This gives you control over what gets mounted and when.
Summary Of Commands
Here’s a quick reference for checking mounted drives:
mount– list all mounted filesystemsdf -h– show disk space usagelsblk– list all block devicesfindmnt– tree view of mountscat /proc/mounts– kernel mount tableblkid– show device UUIDs and typessystemctl list-units --type=mount– systemd mount units
Each command has its strengths. Use lsblk for a complete device list, mount for current mounts, and df for space information.
Frequently Asked Questions
Q: How do I check if a specific drive is mounted in Linux?
A