• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

e4defrag: command not found

by Deepika

The e4defrag command in Linux is a command-line utility that is used to defragment ext4 file systems. This command can be used to optimize the performance of an ext4 file system by rearranging the files and directories on the file system to improve the efficiency of read and write operations. The e4defrag command can defragment both regular files and directories, and it can be run on unmounted file system.

If you encounter the below error while running the command e4defrag:

e4defrag: command not found

you may try installing the below package as per your choice of distribution:

Distribution Command
Debian apt-get install e2fsprogs
Ubuntu apt-get install e2fsprogs
Alpine apk add e2fsprogs
Arch Linux pacman -S e2fsprogs
Kali Linux apt-get install e2fsprogs
CentOS yum install e2fsprogs
Fedora dnf install e2fsprogs
OS X brew install e2fsprogs
Raspbian apt-get install e2fsprogs

e4defrag Command Examples

1. Defragment the filesystem:

# e4defrag /dev/sdXN

2. See how fragmented a filesystem is:

# e4defrag -c /dev/sdXN

3. Print errors and the fragmentation count before and after each file:

# e4defrag -v /dev/sdXN

Filed Under: Linux

Some more articles you might also be interested in …

  1. cut Command Examples in Linux
  2. How to add header and trailer line to a file in Linux
  3. killall Command Examples in Linux
  4. emerge Command Examples in Gentoo Linux
  5. Linux OS Service ‘haldaemon’
  6. Understanding iscsiadm Utility in CentOS / RHEL
  7. OpenLDAP Server and Client Utilities list
  8. CentOS / RHEL : How to Change the login shell of the user
  9. How to Setup a squid proxy server on CentOS/RHEL 7
  10. brightnessctl: command not found

You May Also Like

Primary Sidebar

Recent Posts

  • fprintd-delete Command Examples in Linux
  • fprintd-delete: command not found
  • foreman: command not found
  • foreman Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright