fstatfs64 - Linux


Overview

fstatfs64 retrieves information about a mounted file system. It’s typically used for obtaining details about storage space, file system type, and other file system attributes.

Syntax

fstatfs64 [-h] [-t FS_TYPE] FILE

Options/Flags

  • -h, –help: Display help information.
  • -t, –type=FS_TYPE: Specify the file system type (e.g., ext4, btrfs, ntfs).

Examples

Get file system information for the root partition:

fstatfs64 /

Get specific file system type information:

fstatfs64 -t ext4 /mnt/data

Get file system information using file descriptor:

fstatfs64 -t ext4 /dev/sda1

Common Issues

  • Invalid file system type: Ensure the specified file system type is correct.
  • Permission denied: Verify you have sufficient permissions to access the file system.
  • File not mounted: The specified file or device must be mounted to retrieve information.

Integration

  • df: Display information about disk space usage, which can be combined with fstatfs64 for detailed file system attributes.
  • mount: Can be used to verify or adjust file system mount settings based on the information provided by fstatfs64.

Related Commands

  • fstype – Identify the file system type of a device.
  • statfs – Similar to fstatfs64 but returns less detailed information.