How to check the fragmentation and do defragmentation on ext4? Helpful check for home directory of application

    Today, I got a question about how to check the fragmentation of ext4 filesystems, as most common for the Data Center edition or Server edition setups. 

    That article is the next step of a previous story about the  improvement of latency for volumes.

    Of course, some users can ask why we need to do defragmentation on ext4 as it’s not fragmented. As an answer, I would recommend checking out the presentation from LinuxCon 2010  with the name Outline of Ext4 File System & Ext4 Online Defragmentation Foresight  and watch the small video with fragmentation

So let’s start to use one small command line utility e4defrag. 

Online man page you can find here:

  1. Get report of fragmentation:

    $ sudo e4defrag -c /location

  1. After checking the results you can run the defragmentation:

$ sudo e4defrag /location

  1. If you want extra info:

$ man e4defrag

This is result on out test env:



Popular posts from this blog

Overview and practical use cases with open source tracing tool for Java Apps. Glowroot. Installation

How only 2 parameters of PostgreSQL reduced anomaly of Jira Data Center nodes

Atlassian Community, let's collaborate and provide stats to vendors about our SQL index usage