• 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. module: command not found
  2. amass enum – Find subdomains of a domain (Command Examples)
  3. Inconsistent Device Names Across Reboot Cause Mount Failure Or Incorrect Mount in Linux
  4. ltrace: command not found
  5. How to remove unwanted entries in /etc/shadow file
  6. lpr: command not found
  7. id: command not found
  8. How to use nomodeset to Troubleshoot Boot Issues
  9. Linux OS Service ‘kudzu’
  10. How to troubleshoot iSCSI issues in CentOS / RHEL 6,7

You May Also Like

Primary Sidebar

Recent Posts

  • “az storage blob” Command Examples (Manage blob storage containers and objects in Azure)
  • “az storage account” Command Examples (Manage storage accounts in Azure)
  • “az sshkey” Command Examples (Manage ssh public keys with virtual machines)
  • “az redis” Command Examples

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright