Email WhatsApp
WeChat
WeChat QR

Table of Contents

How to Check Disk Space in Linux

Run df -h / to check free space on the filesystem containing the Linux root directory. The Avail column shows how much space remains available for ordinary users.

On a KiwiPi running Ubuntu 24.04.3 LTS, you can run it in a local terminal or connect to Linux from macOS and check over SSH. If you’re about to copy files with SCP, check the destination first. An archive needs room for the download and, if you’re extracting it on the board, the extracted files too.

How to Check Disk Space in Linux

Check free space with df

df -h /

Read Size, Used, Avail, and Use% together. Mounted on identifies the mountpoint, which is / for this check. The -h option gives you readable units such as M and G; you don’t have to work through a long block count to see whether another model or disk image will fit.

You can also give df a directory. For example, this checks the filesystem holding your home directory, then a possible data directory:

df -h "$HOME"
df -h /mnt/data

That second command requires an existing /mnt/data directory. And the number belongs to its containing filesystem. It doesn’t tell you how much data sits inside the folder—use du for that.

Find the directories using space

du -h --max-depth=1 "$HOME" | sort -h

This lists the disk space used by your home directory and its immediate subdirectories, with larger values near the bottom. The home-directory total includes the children, so don’t add every line together. Once you find a large directory, run the same command against that path to look one level deeper.

Hidden directories count too. That’s useful for .cache and application data, which a quick look at Downloads would miss. But –max-depth=1 only limits the printed results: du still scans below that level to calculate the totals. A directory with thousands of small files can take a while.

If your home directory doesn’t explain the usage, check /var, where Ubuntu keeps logs, caches, and other application data:

sudo du -xhd1 /var | sort -h

Here, -x keeps the scan on one filesystem, -h formats the sizes, and -d1 limits the displayed depth. sudo lets the scan read directories your account can’t access. Without access, du can report permission errors and incomplete totals; changing permissions just to get a measurement is unnecessary. Our guide to Linux file permissions covers ownership and access separately.

Find individual large files

For regular files larger than 100 MiB in your home directory, run:

find "$HOME" -type f -size +100M -exec ls -lh -- {} +

This shows matching filenames and their sizes. It doesn’t rank them or remove anything. A model checkpoint, an old Ubuntu image, or a recording might explain the missing space immediately, but check what uses the file before deleting it. Also, find -size checks logical file size; a sparse disk image can occupy less actual disk space than its listed size suggests.

Check which drive holds the files

lsblk -o NAME,SIZE,FSTYPE,MOUNTPOINTS

lsblk shows block devices, partitions, filesystem types, and mountpoints. Its SIZE column reports device or partition capacity, so a large number there doesn’t mean that much space remains free. Find the relevant mountpoint, then check it with df.

For example, a KiwiPi 5 Pro setup might boot from one drive and keep datasets on an SSD. The SSD could have plenty of room while the system filesystem fills with downloads. Check where the application actually writes; attaching another drive doesn’t move its existing output directory.

Confirm the SSD is mounted

If you expect the SSD at /mnt/data, check that exact mountpoint:

findmnt –mountpoint /mnt/data

If there’s no matching mount, the folder may still exist on the system filesystem. A copy into it can then fill that filesystem instead of the SSD. The drive-mounting steps for Linux explain how to identify and mount the intended partition. After mounting it, run df -h /mnt/data again before starting the transfer.

Check inodes when space still looks available

df -i /

On filesystems such as ext4, you can run out of inodes while free bytes remain. Inodes hold file metadata, and a workload producing huge numbers of tiny files can exhaust them. Check IFree and IUse% if a write fails with No space left on device despite a reasonable Avail value. Use the destination path instead of / if it lives elsewhere.

Command reference

Command What it checks
df -h / Available space on the root filesystem
du -sh “$HOME” Total disk space used by your home directory
lsblk -o NAME,SIZE,FSTYPE,MOUNTPOINTS Devices, capacities, filesystems, and mountpoints
df -i / Inode usage on the root filesystem

After moving or removing files, repeat df against the same destination. Checking / won’t tell you whether you’ve freed space on a separately mounted data drive.

FAQ

Do I need sudo to check disk space?

Usually not for df or lsblk. Use sudo for a targeted du scan when directory permissions prevent a complete result.

Why does Linux show less capacity than the drive label?

Drive makers generally use decimal gigabytes, while df -h uses powers of 1024. Partitions and filesystem overhead reduce usable capacity further. For decimal units, use df -H.

Can I check disk space without the terminal?

If your Ubuntu image includes a desktop, its file manager can show available space in the filesystem’s properties. Over SSH, df -h gives you the same kind of check without needing a desktop session.

Documentation

Command options: Ubuntu df command reference, Ubuntu du command reference, and Ubuntu findmnt command reference.

 

Related Products

Kiwipi-5

KiwiPi 5

The alternative to Raspberry Pi features an RK3588S octa-core 64-bit flagship processor. Built with 8nm technology, it incorporates an ARM Mali-G610 MP4 quad-core GPU and a 6TOPs AI NPU. Its architecture provides high performance and energy efficiency, making it suitable for intensive applications.

Kiwipi-5B

KiwiPi 5B

The Kiwi Pi 5B RK3588 single-board computer (SBC), an alternative to the Raspberry Pi 5, features an 8-core CPU, Mali-G610 GPU, and 6 TOPS NPU.

Kiwipi-5Pro

KiwiPi 5 Pro

KiwiPi 5 Pro is powered by Rockchip RK3588 8-core 64-bit processor with 4 Cortex-A76 (2.2GHz), 4 Cortex-A55(1.8GHz), and an independent NEON coprocessor.

Kiwi Box 1

The RK3588 Mini PC is powered by Rockchip’s latest flagship AIoT SoC built on an 8nm process. Its chipset combines a CPU with a big.LITTLE architecture, featuring four high-performance Cortex-A76 cores and four energy-efficient Cortex-A55 cores, offering a balance of performance and power savings.

Get in Touch about Your Needs

Contact Us