Encountering a "disk full" notification when you know you haven't been hoarding files can be a frustrating experience. It's like a digital scavenger hunt where you're trying to locate the culprit hogging all your storage space. This article aims to shed light on how to effectively diagnose and resolve disk space issues in Manjaro Linux, even when graphical tools seem to fall short.
If you have faced the problem of slow performance on Manjaro, it might be related to disk usage. Here’s we will explore alternative solutions.
You're not alone if you've been puzzled by a sudden influx of "disk full" warnings. Often, the usual suspects (large media files, bulky downloads) aren't to blame. Instead, the storage drain might be caused by:
Graphical disk usage analyzers are helpful, but they occasionally have limitations or don't paint the complete picture. Let's dive into terminal-based tools that provide a more comprehensive view.
du
(Disk Usage): This command is your best friend when trying to pinpoint which directories are consuming the most space.
du -hsx /* | sort -rh | head -20
: This command will list the top 20 largest directories on your root partition, excluding files on other filesystems. Run it from the terminal to quickly identify space hogs. Here breakdown of commands:
du -hsx /*
: Calculates the disk usage of each directory under the root directory (/
), displaying the results in human-readable format (-h
), summarizing directory sizes (-s
), and staying within the same filesystem (-x
).sort -rh
: Sorts the output from du
numerically in reverse order (-r
), based on the human-readable numbers (-h
).head -20
: Displays the top 20 lines of the sorted output, showing the largest directories.sudo du -sh /home/*
will display the total size of each user's home directory. Very useful to find out which user is occupying the biggest space.df
(Disk Free): Shows overall disk space usage for all mounted file systems. Very helpful when the space is full
df -h
: Displays disk space usage in a human-readable format.Once you've located the space-consuming culprits, you can start reclaiming lost storage:
/var/log
) and identify any excessively large log files. Use caution when deleting log files. Consider archiving older logs instead of deleting them outright.pacman
as its package manager. Clean up the package cache with:
sudo pacman -Scc
: This command removes all cached packages, freeing up space.pacman -Rns $(pacman -Qtdq)
: This command removes orphaned packages. Be careful when using the -Rns
flags, as they remove dependencies and configuration files.snap list --all
: This command list installed snap packages and their revisionssudo snap remove <package_name> --revision=<revision_number>
Replace <package_name>
and <revision_number>
with the specific package and revision you want to remove.logrotate
to automatically archive and compress old log files to prevent them from growing excessively.By understanding the potential causes of disk space issues and mastering the command-line tools to diagnose and resolve them, you can regain control of your Manjaro system and keep those "disk full" notifications at bay. Remember to always exercise caution when deleting files and packages, and back up important data before making significant changes to your system.