Rich Freeman on 28 Sep 2017 10:20:05 -0700

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

Re: [PLUG] Reclaiming inodes

On Thu, Sep 28, 2017 at 9:52 AM, Steve Litt <> wrote:
> On Thu, 28 Sep 2017 11:51:30 -0400
> "Gavin W. Burris" <> wrote:
>> It's also possible that files that have been deleted are still being
>> cached, not freed, because they are mapped by some process in
>> memory.  You can check with lsof, or just reboot to see if it
>> clears.  Cheers.
> On that same note, if the disk is an SSD, run fstrim on its partitions
> to reclaim deleted inodes.

I doubt that fstrim would have any impact on ext4 inodes.

First, fstrim doesn't have any effect on the filesystem itself.  It
trims unallocated blocks on the underlying device, so that the SSD can
more efficiently perform writes (which require block erasures).  If a
block has been trimmed then the SSD knows it can do a partial write to
that block without having to move the rest of the block contents to a
new block.

Second, I'm pretty sure the inode structures are completely fixed on
disk at the time of ext4 filesystem creation.  So, they're completely
allocated the moment the filesystem is created, and will never be
free.  So, fstrim would never trim those blocks anyway.

If this were another filesystem that dynamically allocated inodes then
fstrim still wouldn't have any impact on the number of free inodes,
but if a large number had been freed up it might trim some of the
blocks they were previously stored on, which would improve the
performance of the SSD.

Philadelphia Linux Users Group         --
Announcements -
General Discussion  --