• 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

What are the mount options to improve ext4 filesystem performance in Linux

by admin

The default mount options are deployed usually for maximum performance while maintaining safety for general usage. There are some mount options to optimize ext4 file system according to the needs of the target usage.

barrier=0

This disables the write barriers in Journaling Block Device(JBD). Ext4 file system has barrier=1 by default where ext3 has barrier=0.

Write barriers are used to enforce proper on-disk ordering of journal commits, but they will degrade the performance of the file system. However, if the system does not have battery-backed disks, there is a risk of file system corruption.

data=writeback

By default (data=ordered), all data is forced directly out to the main file system before its metadata (file size, time, owner etc.) being committed to the journal. By changing this option to data=writeback, data ordering will not be preserved, data may be written to the file system after its metadata has been committed to the journal. Only metadata will be journaled.

In order to use this option on the root filesystem, a kernel boot parameter is entered:

rootflags=data=writeback

According to ext4 filesystem documentation on Linux Kernel source, the writeback mode can allow old data to appear in files after a crash and journal recovery. The only supported journaling mode is “data=ordered” which is the default setting.

commit=60

This is the number of seconds for each data and meta data sync. Default setting is 5. In case of a power loss, the last 5 seconds of data stored will be lost, but the file system will not be damaged since journaling is active. Increasing this number to large values will increase performance at a cost of data safety.

Filed Under: Linux

Some more articles you might also be interested in …

  1. gnome-extension Command Examples in Linux
  2. How to install and configure “setroubleshootd” on CentOS/RHEL
  3. CentOS / RHEL 6 : How to force a NTP sync with the NTP server(s)
  4. chattr Command Examples to Change File Attributes (Make files immutable)
  5. pidof: command not found
  6. latte-dock Command Examples in Linux
  7. Reducing/Limiting the CPUs in CentOS/RHEL 5,6
  8. paru Command Examples in Linux
  9. Understanding the /proc/mounts, /etc/mtab and /proc/partitions files
  10. CentOS / RHEL 7 : How to configure kdump using GUI

You May Also Like

Primary Sidebar

Recent Posts

  • powertop Command Examples in Linux
  • powertop: command not found
  • powerstat: command not found
  • powerstat Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright