• 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 Examples in Linux

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.

It is important to note that the use of e4defrag command requires root or superuser access. Also, the defragment process may take a while depending on the size of the file system and it may not always improve the performance. It’s recommended to backup important data before running the command.

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. kill: command not found
  2. How to Configure Device File owner/group with udev rules
  3. How to install git on ubuntu 16.04
  4. How to identify the HBA cards/ports and WWN in Linux
  5. Linux OS Service ‘nfslock’
  6. The System Activity Reporter (sar) Command in Linux
  7. e4defrag: command not found
  8. Beginners Guide to Udev in Linux
  9. groupadd: command not found
  10. dget: command not found

You May Also Like

Primary Sidebar

Recent Posts

  • nixos-rebuild Command Examples in Linux
  • nixos-option: Command Examples in Linux
  • nixos-container : Command Examples in Linux
  • nitrogen Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright