Encountering a "disk full" error on your Manjaro Linux system can be frustrating, especially when you're not sure what's hogging all the space. You might be surprised when seemingly small files accumulate and eat away at your storage. This article will guide you through troubleshooting steps to identify the space-consuming culprits and reclaim valuable disk space on your Manjaro system.
Before diving into the solutions, let's consider a few common reasons why your Manjaro disk might be filling up unexpectedly:
pacman
package manager caches downloaded packages, which can accumulate over time.Here's a structured approach to identifying the files and directories consuming the most space on your Manjaro system:
du
and sort
The command-line is your friend when it comes to disk space analysis. The du
(disk usage) command, combined with sort
, can reveal the largest directories. Open a terminal and run the following commands:
sudo du -hsx /* | sort -rh | head -20
Explanation:
sudo
: Executes the command with superuser privileges, ensuring access to all directories.du -hsx /*
: Calculates disk usage.
-h
: Prints sizes in human-readable format (e.g., 1K, 234M, 2G).-s
: Displays only the total for each argument.-x
: Skips directories on different filesystems. This is important if you have separate partitions (e.g., /boot
, /home
)./*
: Specifies that all top-level directories should be analyzed.sort -rh
: Sorts the output in reverse numerical order (largest to smallest).head -20
: Displays the top 20 largest directories.This command provides a quick overview of the largest directories on your system.
Once you've identified potential space hogs, you can drill down further. For example, to investigate the /var/log
directory (a common culprit):
sudo du -hsx /var/log/* | sort -rh | head -20
This will show you the largest files and subdirectories within /var/log
.
Once you have identified what is using up space, you can then decide what to remove.
pacman
Cache: Pacman keeps a cache of downloaded packages. You can safely remove older versions with:sudo pacman -Sc
To remove all cached packages (use with caution):
sudo pacman -Scc
pacman -Qdt
sudo pacman -Rs $(pacman -Qdtq)
sudo journalctl --vacuum-size=1G
While the built-in "Disk Usage Analyzer" can be helpful, it might not always provide the most detailed information. Explore alternative graphical tools like:
.
). Make sure you're viewing hidden files when analyzing disk usage. Check your file manager settings on how to display hidden files.sudo
when running commands to ensure you can access all relevant directories.By following these steps, you should be able to quickly identify what's filling up your Manjaro disk and take appropriate action to reclaim your space, ensuring a smoother and more efficient system. Remember to always double-check before deleting any files, especially system files, to avoid potential problems.