Does the ext4 filesystem need defragmentation? The answer, in short, is yes. The ext4 filesystem is robust and gets fragmented in a few scenarios (like pidgin chat logs or browser cache) or on prolonged usage (but much less than FAT or NTFS). ext4 comes with its own defrag tool – e4defrag which is present in some distros including Ubuntu.
- To check for fragmentation:
sudo e4defrag -c /
- To defragment:
sudo e4defrag /