- Linux Mint: Low disk space on Boot
- Step #1 Analyze low disk space on boot cause
- Step #2 Autoclean and Autoremove
- Step #3 Clean old kernel (not needed anymore)
- Step #4 Back up or move files — manually
- Step #5 Test the solution
- 12 Useful “df” Commands to Check Disk Space in Linux
- 1. Check File System Disk Space Usage
- 2. Display Information of all File System Disk Space Usage
- 3. Show Disk Space Usage in Human Readable Format
- 4. Display Information of /home File System
- 5. Display Information of File System in Bytes
- 6. Display Information of File System in MB
- 7. Display Information of File System in GB
- 8. Display File System Inodes
- 9. Display File System Type
- 10. Include Certain File System Type
- 11. Exclude Certain File System Type
- 12. Display Information of df Command.
- If You Appreciate What We Do Here On TecMint, You Should Consider:
- Linux / Unix – Checking Free Disk Space
- df command examples to check free disk space
- How to check free disk space in Linux
- du command examples for checking free and used disk space
- Say hello to ncdu command
- GUI program
- Conclusion
- 7+ Steps To Clean Space On Linux Mint
- Step 1: How to check free space on Linux Mint
- By terminal commands
- Disk Usage Analyzer — UI tool for checking disk space in Linux Mint
- Step 2. Empty Trash
- Step 3: Delete old and not required packages/kernels and APT cache
- Step 4. Delete systemd journal logs
- Step 5. Removing the Flatpak packages
- Step 6. Use tune2fs to save space
- Bonus Step 1: Find and delete Duplicate Files
- Bonus Step 2: Check Timeshift snapshots
- Bonus Step 3: Clear Browser cache
- Bonus Step 4: Check and clear cache folders
Linux Mint: Low disk space on Boot
There is a common warning message displayed after updates in Linux Mint:
The full text of the warning and details will be repeated at the start of Linux Mint like:
The volume «boot» has only 0 bytes disk space remaining.
You can free up disk space by removing unused programs or files, or by moving files to another disk or partition.
The volume «boot» has only 14.6 MB disk space remaining.
If you prefer you can watch a short How to solve low disk space on boot
Below you can find the steps to analyze and fix Low disk space on boot:
Step #1 Analyze low disk space on boot cause
With two options:
- Examine
- Ignore
Both options are not very useful in my opinion. The first one opens the Disk Usage analyzer without much info about the problem.
The message appear after connecting remote android device to my computer. Initially I thought that problem is related to the new added device. But after some investigation I found out that problem is related to the Linux Mint boot folder.
The original information from the examine button is not very useful. Instead of this you can use this command to find what is the current space under /boot:
the result will be something like:
Then you can list all files under this folder by ( The command du is for disk usage.):
result would be something like:
Or if you prefer the old ls command with sort by file size:
Step #2 Autoclean and Autoremove
Best option to solve the problem: low disk space on boot is by running next commands:
What these commands are doing:
- apt/apt-get autoclean → cleans obsolete deb-packages, less than clean
- apt/apt-get autoremove → removes orphaned packages which are not longer needed from
Step #3 Clean old kernel (not needed anymore)
Linux Mint keeps the old kernels which might help in future if you have problems after update of your system. This is really helpful. But some of the older kernels are not needed. In order to clean up those old not needed kernel images you use this command:
after the execution of this command this is the new space allocation in boot:
Note: if you want to check what is your Linux Kernel Version you can use this command:
Step #4 Back up or move files — manually
The last option is instead of auto clean of the old files/kernels to move some files manually with command like:
Step #5 Test the solution
No matter of the solution(step) you chose to deal with this problem you will need to verify that you have enough space on the boot device. This can be done by:
Источник
12 Useful “df” Commands to Check Disk Space in Linux
On the internet, you will find plenty of tools for checking disk space utilization in Linux. However, Linux has a strong built-in utility called ‘df‘.
The ‘df‘ command stands for “disk filesystem“, it is used to get a full summary of available and used disk space usage of the file system on the Linux system.
Using ‘ -h ‘ parameter with (df -h) will show the file system disk space statistics in “human-readable” format, means it gives the details in bytes, megabytes, and gigabyte.
Useful df Command Examples
This article explains a way to get the full information of Linux disk space usage with the help of the ‘df‘ command with their practical examples. So, you could better understand the usage of the df command in Linux.
1. Check File System Disk Space Usage
The “df” command displays the information of device name, total blocks, total disk space, used disk space, available disk space, and mount points on a file system.
2. Display Information of all File System Disk Space Usage
The same as above, but it also displays information of dummy file systems along with all the file system disk usage and their memory utilization.
3. Show Disk Space Usage in Human Readable Format
Have you noticed that the above commands display information in bytes, which is not readable at all because we are in a habit of reading the sizes in megabytes, gigabytes, etc. as it makes it very easy to understand and remember.
The df command provides an option to display sizes in Human Readable formats by using ‘-h’ (prints the results in human-readable format (e.g., 1K 2M 3G)).
4. Display Information of /home File System
To see the information of only device /home file systems in human-readable format use the following command.
5. Display Information of File System in Bytes
To display all file system information and usage in 1024-byte blocks, use the option ‘ -k ‘ (e.g. —block-size=1K ) as follows.
6. Display Information of File System in MB
To display information of all file system usage in MB (MegaByte) use the option ‘ -m ‘.
7. Display Information of File System in GB
To display information of all file system statistics in GB (Gigabyte) use the option as ‘df -h‘.
8. Display File System Inodes
Using ‘ -i ‘ switch will display the information of a number of used inodes and their percentage for the file system.
9. Display File System Type
If you notice all the above commands output, you will see there is no Linux file system type mentioned in the results. To check the file system type of your system use the option ‘ T ‘. It will display file system type along with other information.
10. Include Certain File System Type
If you want to display a certain file system type use the ‘ -t ‘ option. For example, the following command will only display the ext3 file system.
11. Exclude Certain File System Type
If you want to display a file system type that doesn’t belongs to the ext3 type use the option ‘ -x ‘. For example, the following command will only display other file systems types other than ext3.
12. Display Information of df Command.
Using ‘—help ‘ switch will display a list of available option that is used with df command.
Read Also :
If You Appreciate What We Do Here On TecMint, You Should Consider:
TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.
If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.
We are thankful for your never ending support.
Источник
Linux / Unix – Checking Free Disk Space
Tutorial details | |
---|---|
Difficulty level | Easy |
Root privileges | No |
Requirements | None |
Est. reading time | 1m |
(a) df command : Report file system disk space usage.
(b) du command : Estimate file space usage.
df command examples to check free disk space
Type df -h or df -k to list free disk space:
$ df -h
OR
$ df -k
Sample outputs that show disk space utilization:
The df utility displays statistics about the amount of free disk space on the specified file system or on the file system of which file is a part. Values are displayed in 512-byte per block counts. The -H option is called as “Human-readable” output. It use unit suffixes: Byte, Kilobyte, Megabyte, Gigabyte, Terabyte and Petabyte in order to reduce the number of digits to four or fewer using base 10 for sizes i.e. you see 30G (30 Gigabyte).
How to check free disk space in Linux
To see the file system’s complete disk usage pass the -a option:
df -a
Find out disk usage and filesystem type by passing the -T option:
df -T
Want to get used and free inodes information on Linux? Try:
df -i
du command examples for checking free and used disk space
The du command shows how much space one ore more files or directories is using, enter:
$ du -sh
Sample outputs:
Fig.01: Unix df and du command outputs from my FreeBSD server
Say hello to ncdu command
ncdu (NCurses Disk Usage) is a curses-based version of the well-known ‘du’, and provides a fast way to see what directories are using your disk space. One can install with the following apt command/apt-get command:
sudo apt install ncdu
For RHEL/CentOS, first enable EPEL repo (see CentOS 8 turn on EPEL repo and RHEL 8 enable epel repo) and type the following yum command:
sudo yum install ncdu
Now just type:
ncdu
ncdu [dir] ncdu /etc/
- No ads and tracking
- In-depth guides for developers and sysadmins at Opensourceflare✨
- Join my Patreon to support independent content creators and start reading latest guides:
- How to set up Redis sentinel cluster on Ubuntu or Debian Linux
- How To Set Up SSH Keys With YubiKey as two-factor authentication (U2F/FIDO2)
- How to set up Mariadb Galera cluster on Ubuntu or Debian Linux
- A podman tutorial for beginners – part I (run Linux containers without Docker and in daemonless mode)
- How to protect Linux against rogue USB devices using USBGuard
Join Patreon ➔
GUI program
Above programs are good if GUI is not installed or you are working with remote system over the ssh based session. Linux and UNIX-like oses comes with KDE and Gnome desktop system. You will find Free Disk Space Applet located under GUI menus. Here is a sample from Fedora Linux version 22 system:
Conclusion
You learned how to keep track of disk utilization, and disk space with various Linux and Unix commands.
🐧 Get the latest tutorials on Linux, Open Source & DevOps via
Источник
7+ Steps To Clean Space On Linux Mint
In this post you can find how to clean up disk space on your Linux Mint. Running out of space for Linux systems can cause different problems like login loop, performance and more.
Modern Operating Systems like Linux Mint and Ubuntu generated huge amounts of clutter, logs, archives and cache. For old and cheap laptops, virtual machines, small SSD disks and servers — space is essential — and in this article you will find how to free up disk space.
Step 1: How to check free space on Linux Mint
By terminal commands
There are two different ways to check disk space. The first one is by using terminal and check the space with commands like:
Disk Usage Analyzer — UI tool for checking disk space in Linux Mint
The second one is more user friendly and it’s by using the UI tool called Disk Usage Analyzer:
- Menu
- Disk Usage Analyzer
- Select folder — i.e. /home/user
- Analyze the results
- if you hover your mouse on a given segment you can see details about the folder and space
- by clicking you will analyze only this folder
Usually I’ve check and clean 3 — 5 big folders. After that I rescan the home folder again.
The interface is simple and interactive. You can select any folder or subfolder and check for more details:
Step 2. Empty Trash
Linux Mints automatically keep deleted items which are deleted only by: Delete . It stores those files in a hidden directory in your user account at the location
Over time, the number of files in Trash might increase significantly. Moreover, if you delete huge files. You can check the Trash by the command below:
or by opening it:
- Menu
- Files (or opening Nemo)
- from Bookmarks select Trash
- or Go ( from top menu ) / Trash
- Empty Trash — to delete files permanently
Deleted files might take a great amount of space -** so Trash can be cleaned frequently** or you can use Shift + Delete in order to permanently delete files.
Step 3: Delete old and not required packages/kernels and APT cache
Linux Mint installs dependencies for some packages. If such a package is deleted — some dependencies might stay on your machine. In this case commands like:
will remove automatically packages and dependencies which are not needed anymore.
This command will clean up old Kernels. Linux Mint keeps several versions of Kernel which is useful in some situations. This command doesn’t delete all Kernels but only really old ones.
Note if you want to clean only the APT cache in Linux Mint then you can use only:
can be used to clean old packages.
Step 4. Delete systemd journal logs
Linux Mint keeps logs registering different events and messages like:
The amount of logs is growing and might take a good amount of space. In order to clean disk space by cleaning logs you can use next command:
If you like the amount of disk space taken by log journal you can do:
This command might free 0.5 or 2.0 GB which might be nice for small disks.
Step 5. Removing the Flatpak packages
Flatpak is advertised as a utility for software deployment and package management for Linux. It contains many interesting and important apps and packages. But if you don’t use it or disk space is more important than you can remove it.
THe first step is to verify if any of your apps are installed with Flatpak:
- Software manager
- Click on Flatpak button — down left corner
- The apps with installed with Flatpak has green circle with tick
- remove the apps if any
Final step will save huge amount of disk space by removing Flatpak — run this command in terminal:
This command might save between 2 or 5.0 GB.
Step 6. Use tune2fs to save space
By default ext2, ext3, ex4 file systems allocate 5%-7% of the available blocks for use by the root user. This allows the system to continue running if non-root users fill up the file system. Use this only on extra partitions, data partitions or external drives formatted in ext2,3,4.
where the partition is: /dev/sda1
This might free 1.5 GB and more.
from man tune2fs:
Bonus Step 1: Find and delete Duplicate Files
Duplicate files are another way to waste time — especially for big files. It can be video, music or archives. If you want to find and remove duplicate files on your Linux Mint you can use tool — FSlint which is a utility to find and clean various forms of lint on a filesystem:
- Duplicate files
- Problematic filenames
- Temporary files
- Bad symlinks
- Empty directories
- Nonstripped binaries
It’s advertised as:
FSlint is a toolkit to clean filesystem lint. It includes a GTK+ GUI as well as a command line interface and can be used to reclaim disk space.
Bonus Step 2: Check Timeshift snapshots
Timeshift is a great tool which will come to the rescue when you have problems with your Linux Mint installation. This value comes at a price — disk space.
You can move your older snapshots to another drive or change the frequency on which they are taken.
Bonus Step 3: Clear Browser cache
Browsers can take considerable space for cache — especially for websites like Facebook and Youtube. Cleaning the cache might save up to 0.5 GB which is a considerable amount for smaller SSD disks which are common in laptops.
Bonus Step 4: Check and clear cache folders
There are some folders which cache or store back up information. In this section you can find many good candidates for cleaning like:
- trash:/// — the recycle bin
/.cache/pip/http — Python cache folder for virtual environments which contains GB of data.
/.cache/JetBrains — Tools like PyCharm, IntelliJ Idea — old versions and tools can be safely removed
Источник