Sunday, May 5, 2024
 Popular · Latest · Hot · Upcoming
25
rated 0 times [  25] [ 0]  / answers: 1 / hits: 51636  / 1 Year ago, wed, may 10, 2023, 11:00:07

I cannot update Ubuntu because I have 99% inode usage. What is the easiest way for me to alleviate this problem?



Thanks for your help.


More From » disk-usage

 Answers
4

The number of inodes is set at the time the partition is formatted. Normally the number of inodes created is sufficient for almost any purpose; however, if you have a great number of very small files then you can use up the inodes before the disk is full.



You need to find the many thousands of small files you have on the system that are using up inodes and either delete them, or move them to a partition that has been specifically set up with a very large number of inodes available. It is not possible to change the number of inodes available on a partition after it has been formatted.



The script written by paxdiablo on stackoverflow might be handy way to check for excessive small file use that you may not be aware of. Here it is again:



#!/bin/bash
# count_em - count files in all subdirectories under current directory.
echo 'echo $(ls -a "$1" | wc -l) $1' >/tmp/count_em_$$
chmod 700 /tmp/count_em_$$
find . -mount -type d -print0 | xargs -0 -n1 /tmp/count_em_$$ | sort -n
rm -f /tmp/count_em_$$


Put this script in the text file ~/bin/count_em and then issue the command



chmod +x ~/bin/count_em


to make it executable. If you had to make the directory ~/bin then it won't be in the executable path yet, so just log out and back in again.



To run the program you just type



count_em


and it will list the numbers of all files in the current directory and subdirectories by directory, with the highest count last. Very handy!


[#33562] Thursday, May 11, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
trousransla

Total Points: 285
Total Questions: 112
Total Answers: 113

Location: Spain
Member since Thu, Dec 23, 2021
2 Years ago
;