Managing mounted file systems in Linux is crucial for ensuring proper data accessibility, troubleshooting storage issues, and maintaining system integrity. Whether you are operating a VPS hosting, a dedicated server, or utilizing a cloud hosting solution, understanding how to check mounted files and partitions is essential for system administration. Additionally, businesses relying on managed hosting services benefit from streamlined storage management and performance optimization.

Why Check Mounted Files in Linux?

  • Verify storage devices attached to the system.
  • Ensure correct mounting of partitions.
  • Diagnose and resolve disk-related issues.
  • Monitor network-mounted file systems (NFS, CIFS, etc.).

1. Using the mount Command

The mount command is the most common way to display all mounted file systems.

mount

This command lists all mounted partitions along with their mount points and filesystem types.

To filter the output for a specific device, use:

mount | grep /dev/sdX

Replace /dev/sdX with the specific device name.

2. Using the df Command

The df (Disk Free) command provides an overview of the mounted filesystems and their usage statistics.

df -h
  • The -h flag displays sizes in a human-readable format.
  • This command is useful for checking disk space utilization on mounted filesystems.

To check only a specific filesystem, use:

df -h /mount/point

Replace /mount/point with the actual mount location.

3. Using the lsblk Command

The lsblk (List Block Devices) command provides a structured view of storage devices and their mount points.

lsblk

For more detailed information, including filesystem types, use:

lsblk -f

This command is particularly useful for identifying which partitions are mounted.

4. Using the findmnt Command

The findmnt command offers a tree-like view of mounted file systems, making it easier to interpret mount relationships.

findmnt

To search for a specific mount point:

findmnt /mount/point

5. Checking /proc/mounts File

The /proc/mounts file contains real-time information about all mounted file systems.

cat /proc/mounts

For better readability, use:

cat /proc/mounts | column -t

6. Using the blkid Command

To get detailed information about block devices and their UUIDs, use the blkid command:

blkid

This is helpful for identifying mounted filesystems and their unique identifiers.

7. Using the df -T Command to Check Filesystem Types

To list all mounted filesystems along with their types:

df -T

Conclusion

Monitoring mounted file systems in Linux is an essential skill for system administrators. Using commands like mount, df, lsblk, and findmnt, you can easily check and manage your file systems on a VPS hosting solution or a dedicated server. Proper monitoring helps in ensuring optimal system performance and troubleshooting storage issues effectively.