Mount options for a faster ext4

Here’s a line from /etc/fstab on one of my machines (for a non-SSD partition):

UUID={...} / ext4 noatime,data=writeback,barrier=0,nobh,errors=remount-ro 1 1

Here’s why:

  1. I don’t need to enable barriers for a fixed disk on a battery-backed laptop. (See the mount manpage for how a barrier works. There is a small risk associated.)
  2. The data=writeback option results in only metadata being journaled, but not actual file data. This does engender the risk of corrupting recently modified files in the event of a sudden failure. But if you’re willing to run with it, it provides a great boost to the filesystem’s performance.
  3. noatime disables the atime (access timestamp) feature, which would otherwise cause additional writes to record timestamps for every time an inode is accessed. You can safely enable this.
  4. nobh prevents association of buffer heads with data pagefiles (Only works with data=writeback).

The big impact options are nos. 2 and 3, whereas you can play it a bit safer by ignoring nos. 1 and 4.

Advertisements

, , ,

  1. #1 by Bosstiger on September 3, 2012 - 12:29 pm

    Reblogged this on Gigable – Tech Blog.

  1. Tips: Yocto project how to speed build time | 願~~

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: