VMware ESXi and vSphere Cluster Management

Check Available Disk Space with df on Raspberry Pi

Learn how to use df and df -h on Raspberry Pi OS to check filesystem capacity, used space, available space, and utilization.

When using Raspberry Pi OS, check storage capacity before installing software, copying files, downloading updates, or investigating write failures. A full filesystem can prevent programs from saving files or updates from completing.

Disk-space usage is different from memory usage. Disk space is the persistent storage provided by an SD card, USB drive, or other mounted storage. Memory, usually called RAM, is temporary working space used by running programs. The df command reports disk-space information, not RAM usage.

What the df command does

df is a Linux command that reports the capacity and available space of mounted filesystems. A filesystem is a formatted storage area organized for files and directories. A filesystem becomes available in the Linux directory tree when it is mounted.

Running df without options reports every filesystem currently mounted on the Raspberry Pi.

Run df from a terminal

Open a terminal on Raspberry Pi OS and enter:

df

The default report normally uses fixed-size blocks. These values are commonly labeled 1K-blocks, meaning reporting units of approximately 1 kilobyte. Large block counts can be less convenient to read than megabytes or gigabytes.

Read the df output

A typical report has one row for each mounted filesystem. The exact device names and sizes depend on your Raspberry Pi and its connected storage.

Filesystem     1K-blocks      Used  Available Use% Mounted on
/dev/mmcblk0p2  30500000  12000000   17200000  42% /
/dev/mmcblk0p1    500000    110000     390000  22% /boot
FieldWhat it representsHow a Raspberry Pi user should interpret it
FilesystemThe device, partition, or virtual filesystem providing the storage.Shows where the filesystem comes from, such as an SD-card partition represented by a device name.
1K-blocks or SizeThe filesystem's total capacity.Compare this with Used and Available to understand the total storage assigned to that filesystem.
UsedCapacity already occupied by files and filesystem data.A growing value means less capacity remains for new files.
AvailableCapacity still available for ordinary file creation.This is the most useful value when deciding whether an installation, download, or copy operation has room to finish.
Use%The proportion of the filesystem currently occupied.A high percentage indicates that the filesystem is close to full.
Mounted onThe directory through which the filesystem is accessed.Use this column to identify what storage a row describes. The root filesystem is mounted on /.

A mount point is the directory where a filesystem becomes accessible. For example, / is the mount point for the root filesystem, while /boot can be the mount point for a separate boot partition.

Use human-readable output with df -h

The -h option requests human-readable output. Instead of showing large block counts, it scales sizes into practical units such as KB, MB, GB, or TB.

df -h

For routine checks, df -h is usually the preferred form because the total, used, available, and percentage values are easier to compare quickly.

CommandUnit styleBest use
dfDefault fixed-size block units, commonly 1K blocks.Detailed reports when working with block counts or scripts that expect the default format.
df -hHuman-readable scaled units such as MB and GB.Routine checks by Raspberry Pi users and quick capacity comparisons.

Check the root filesystem

The root filesystem is the primary filesystem mounted at /. It contains the Raspberry Pi OS directory hierarchy and normally stores installed applications, system files, logs, and user data unless those files are placed on another mounted filesystem.

Run:

df -h

Then find the row whose Mounted on column is /. Read that row as follows:

  • Total size: the value in the Size column.
  • Occupied space: the value in the Used column.
  • Remaining space: the value in the Avail or Available column.
  • Utilization: the value in the Use% column.

This root entry is usually the most relevant row when checking whether Raspberry Pi OS and its installed applications have enough storage. For example, a row showing 32G total, 20G used, 11G available, and 65% use means that the root filesystem has 32 GB of capacity, 20 GB is occupied, about 11 GB remains available, and 65 percent is in use.

Understand multiple filesystem entries

The output can contain more than the main SD-card-backed root filesystem. Linux may list:

  • The root filesystem mounted at /.
  • A separate boot partition mounted at a path such as /boot.
  • Temporary or virtual filesystems used by the operating system.
  • Network filesystems.
  • Removable media such as a USB storage device.

Do not assume that every row represents physical SD-card consumption. Some rows are virtual or temporary, and others may belong to separate devices. The Mounted on column helps identify the storage location being checked, while the Filesystem column helps identify its source.

Troubleshoot common df results

The output has many unfamiliar rows

Linux reports all mounted filesystems, including temporary and virtual mounts. Use the mount-point column to understand each row. When checking operating-system storage, prioritize the row mounted at /.

The numbers are difficult to interpret

If the report contains large block counts, you used the default format. Run:

df -h

A filesystem is nearly full

Check the Used, Available, and Use% columns and note the affected mount point. Free space on that filesystem, then run df -h again to verify the result. Freeing space on one mounted filesystem does not automatically create space on another.

Quick reference

  • Use df to report all mounted filesystems in default block units.
  • Use df -h for easier-to-read capacity values.
  • Read Size, Used, Avail, and Use% together.
  • Find / in the Mounted on column to assess the root filesystem.
  • Remember that disk space and RAM are different resources.

For this topic, the practical command to remember is df -h for checking available disk space.