Michael Lazin on 28 Sep 2017 09:45:51 -0700


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Reclaiming inodes


I work at a hosting company and we set file limits for this reason.  I have run into occasions where I have wanted to find the directory with the most files and have used something like this which I shamelessly took from stack exchange:

find / -xdev -type d -size +100k

This will find the directories that contain the most files.   If you find a directory that is very full you can note the date stamps of the files and grep your logs for the date stamps to get an idea of how they got there.  I hope this helps.

Michael Lazin

On Thu, Sep 28, 2017 at 9:23 AM, prushik <prushik@gmail.com> wrote:
Also, I don't know if anybody mentioned it, but each directory uses an inode too, so excessive directories for whatever reason can be a problem too.

Sent from my device.
 
---- Original message ----
From: Rich Freeman <r-plug@thefreemanclan.net>
Sent: 09/28/2017 12:07:28
To: Philadelphia Linux User's Group Discussion List <plug@lists.phillylinux.org>
Subject: Re: [PLUG] Reclaiming inodes

On Thu, Sep 28, 2017 at 9:01 AM, Thomas Delrue <delrue.thomas@gmail.com> wrote:
> On Thursday, September 28, 2017 3:34:08 PM EDT Joe Rosato wrote:
>>I doubt you actually have this problem, it is possible, but my guess is
>>there are a lot of tiny files somewhere... Maybe spool because mail issue??
>>Find the directory and you will find your problem.
>
> This was exactly what was going on. cron was trying to send mail (MAILTO=""
> was NOT part of my crontab file) and thus these things were accumulating in my
> /var/spool/exim4 folder)

Yeah, unintended small files would certainly cause this problem.  I
didn't even think to question whether you actually needed all those
inodes in the first place.

In general though anytime you're creating a relatively small ext4
filesystem you should probably pause to think about how many inodes
you will need though.  I wouldn't create them just in case something
like this happens (sooner or later you'd run out even if you allocated
all the space to inodes).  However, inode starvation can happen on
smallish ext4 filesystems with the default settings if you aren't
careful.

If you read the manpage and check your defaults in /etc you'll see
that ext4 has reasonable defaults based on the size of the filesystem,
but if your use case isn't normal, or if your filesystem size is
towards the boundary of the settings changes, you might want to adjust
things.  That might also mean allocating fewer inodes - if you had a
multimedia storage filesystem you might want far fewer inodes per byte
of storage.

-- 
Rich
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug


___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug




--
Michael Lazin

to gar auto estin noein te kai ennai
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug