MEANDER

Disk Space, Memory Usage, and Swap Usage on Linux Mint

Updated 14 December 2025

The reserved space for system drives using the ext4 file system is too high. It was designed way back when drives were measured in megabytes instead of gigabytes and terabytes.

Leave 1 Percent for System Drives

This assumes sda2 is your main partition:

    sudo tune2fs -m 1 /dev/sda2 

Leave 0 Percent for Storage Drives

This assumes your storage drive is on sdb1:

    sudo tune2fs -m 0 /dev/sdb1

Disk Space Used

This command shows how much disk space is being used, assuming sda2 is your partition.

    df -h --total /dev/sda2 | tail -n 1 | awk '{ print $3 }'

Memory and Swap Space Used

Both of these commands rely on the free command to show you how much memory and swap space is being used.

Memory:

    free -h | awk 'NR == 2 { print $3 }'

Swap:

    free -h | awk 'NR == 3 { print $3 }'

Display

All of these commands can be used in multiple instances of the "CommandRunner" applet and multiple lines of the "Command result desklet" desklet (I don't know why the author added desklet to the title). The commands can be used as is for the desklet, but the applet requires them to be surrounded by sh -c and full quotes, example:

    sh -c "free -h | awk 'NR == 3 { print $3 }'"

There are desklets available that serve this purpose without any coding, in a GUI format, but you can't use desklets on a panel. I prefer only a single applet to show how much swap space I've used.