findmnt Command

Find and display information about mounted filesystems in a tree-like format for easy system administration.

Syntax

findmnt [options] [device|mountpoint] findmnt [options] -t type findmnt [options] -S source

The findmnt command displays information about mounted filesystems in a tree-like format, showing mount points, device names, filesystem types, and mount options.

Basic Usage

List all mounted filesystems

# Show all mounted filesystems in tree format findmnt # Show in list format findmnt -l # Show with additional details findmnt -D

Display all mounted filesystems with their hierarchy and properties

Find specific mount point

# Find mount point for a specific directory findmnt /home findmnt /var # Find mount point for root filesystem findmnt /

Locate specific mount points and their associated devices

Find by device

# Find mount point for a specific device findmnt /dev/sda1 findmnt /dev/nvme0n1p1 # Find by UUID findmnt UUID="1234-5678"

Find where a specific device is mounted

Common Options

Output format options

# Tree format (default) findmnt # List format findmnt -l # JSON format findmnt -J # Export format findmnt -E

Choose different output formats for different use cases

Filtering options

# Filter by filesystem type findmnt -t ext4 findmnt -t nfs findmnt -t tmpfs # Filter by source findmnt -S /dev/sda1 findmnt -S LABEL="ROOT" # Filter by mount point findmnt -T /home

Filter results by various criteria

Information display

# Show detailed information findmnt -D # Show mount options findmnt -o # Show filesystem information findmnt -i

Display additional information about mounts

Practical Examples

System administration tasks

# Check all mounted filesystems findmnt # Find specific filesystem type findmnt -t ext4 # Check if a directory is on a separate partition findmnt /home # Find all NFS mounts findmnt -t nfs # Check mount options for root findmnt -o /

Common administrative tasks using findmnt

Scripting and automation

# Get device name for a mount point findmnt -n -o SOURCE /home # Get filesystem type findmnt -n -o FSTYPE /var # Check if device is mounted if findmnt /dev/sda1 >/dev/null 2>&1; then echo "Device is mounted" else echo "Device is not mounted" fi

Use findmnt in scripts and automation

Best Practices

findmnt Best Practices
  • Use tree format for overview, list format for scripting
  • Combine with grep for complex filtering
  • Use JSON output for programmatic parsing
  • Check mount options for security implications
  • Verify filesystem types before operations
  • Use in combination with mount and umount commands
Common Pitfalls
  • Permission issues - Some information may require root access
  • Output parsing - Tree format can be complex to parse
  • Device names - Device names may change between reboots
  • Network filesystems - May show different information than local filesystems
  • Mount options - Complex mount options may be truncated

See also