You are not logged in.

#1 2011-05-07 05:41:56

amadar
Banned
Registered: 2011-04-15
Posts: 147

Improving hard disk performance in fstab!

Hey all, I just wanted to say that by adding "relatime" as options for my filesystems in /etc/fstab, I noticed that jbd indexing now uses about half the IO it did previously and that page-cached files open with no IO at all. This is awesome!
See the wiki for the relevant details.

Offline

#2 2011-05-07 05:51:02

hauzer
Member
From: Belgrade, Serbia
Registered: 2010-11-17
Posts: 279
Website

Re: Improving hard disk performance in fstab!

Try using noatime.


Vanity of vanities, saith the Preacher, vanity of vanities; all is vanity.
What profit hath a man of all his labour which he taketh under the sun?
All the rivers run into the sea; yet the sea is not full; unto the place from whence the rivers come, thither they return again.
For in much wisdom is much grief: and he that increaseth knowledge increaseth sorrow.

Offline

#3 2011-05-07 06:33:27

neurolysis
Member
Registered: 2011-02-23
Posts: 112
Website

Re: Improving hard disk performance in fstab!

noatime is usually ok. A few applications (mutt, for example) still have some reliance on it, but even their needs are limited and can be ignored to some degree.

If you're using ext*, I highly recommend data=writeback. You'll have to set your FS up correctly, though:

# tune2fs -o journal_data_writeback /dev/sdxN
# tune2fs -O ^has_journal /dev/sdxN
# e2fsck -f /dev/sdxN

And then use the data=writeback mount option (if you don't do this and just use the mount option, bad things will happen).

I personally use the following mount options on my / (ext4):

defaults,noatime,data=writeback,barrier=0,nobh,errors=remount-ro

The big one is data=writeback, though.

Offline

#4 2011-05-07 15:00:24

bwat47
Member
Registered: 2009-10-07
Posts: 638

Re: Improving hard disk performance in fstab!

neurolysis wrote:

noatime is usually ok. A few applications (mutt, for example) still have some reliance on it, but even their needs are limited and can be ignored to some degree.

If you're using ext*, I highly recommend data=writeback. You'll have to set your FS up correctly, though:

# tune2fs -o journal_data_writeback /dev/sdxN
# tune2fs -O ^has_journal /dev/sdxN
# e2fsck -f /dev/sdxN

And then use the data=writeback mount option (if you don't do this and just use the mount option, bad things will happen).

I personally use the following mount options on my / (ext4):

defaults,noatime,data=writeback,barrier=0,nobh,errors=remount-ro

The big one is data=writeback, though.

Thanks for the tips. Definitely seems faster after doing those. I had just installed arch and my only option was defaults.

Offline

#5 2011-05-07 15:01:52

bwat47
Member
Registered: 2009-10-07
Posts: 638

Re: Improving hard disk performance in fstab!

EDIT: Forum timed out on me hmm

Last edited by bwat47 (2011-05-07 15:04:46)

Offline

#6 2011-05-07 15:28:20

Lothium
Member
Registered: 2009-10-10
Posts: 192

Re: Improving hard disk performance in fstab!

Little question: Did you do this only with your / or also with your /home directory?

Best regards!

Offline

#7 2011-05-07 15:35:40

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 9,815
Website

Re: Improving hard disk performance in fstab!

neurolysis wrote:

noatime is usually ok. A few applications (mutt, for example) still have some reliance on it, but even their needs are limited and can be ignored to some degree.

If you're using ext*, I highly recommend data=writeback. You'll have to set your FS up correctly, though:

# tune2fs -o journal_data_writeback /dev/sdxN
# tune2fs -O ^has_journal /dev/sdxN
# e2fsck -f /dev/sdxN

And then use the data=writeback mount option (if you don't do this and just use the mount option, bad things will happen).

I personally use the following mount options on my / (ext4):

defaults,noatime,data=writeback,barrier=0,nobh,errors=remount-ro

The big one is data=writeback, though.

Did you get this advice from http://blog.loxal.net/2009/04/tuning-ex … -with.html?

Might wanna read this too: http://www.kernel.org/doc/Documentation … s/ext4.txt

* writeback mode
In data=writeback mode, ext4 does not journal data at all.  This mode provides
a similar level of journaling as that of XFS, JFS, and ReiserFS in its default
mode - metadata journaling.  A crash+recovery can cause incorrect data to
appear in files which were written shortly before the crash.  This mode will
typically provide the best ext4 performance.

* ordered mode
In data=ordered mode, ext4 only officially journals metadata, but it logically
groups metadata information related to data changes with the data blocks into a
single unit called a transaction.  When it's time to write the new metadata
out to disk, the associated data blocks are written first.  In general,
this mode performs slightly slower than writeback but significantly faster than journal mode.

Last edited by graysky (2011-05-07 15:41:13)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#8 2011-05-07 18:24:38

neurolysis
Member
Registered: 2011-02-23
Posts: 112
Website

Re: Improving hard disk performance in fstab!

It was a few years ago that I first saw it, so I don't remember where I first got it from.

And I already knew about the second. It doesn't bother me that much, because I use it on laptops (battery backup).

Offline

#9 2011-05-07 18:36:38

amadar
Banned
Registered: 2011-04-15
Posts: 147

Re: Improving hard disk performance in fstab!

Cool, thanks for that info guys. I'll skip on data=writeback for now since I'm on a desktop and am not sure if I have battery backup (don't think I do). I guess noatime is a little faster than relatime, but  I chose relatime just in case my user decides to add a program like mutter.

@neurolysis So with errors it remounts as read only? What type of errors might those be?

Offline

#10 2011-05-07 18:58:45

Army
Member
Registered: 2007-12-07
Posts: 1,784

Re: Improving hard disk performance in fstab!

I'd still prefer relatime over noatime!

Offline

#11 2011-05-07 20:09:46

Lothium
Member
Registered: 2009-10-10
Posts: 192

Re: Improving hard disk performance in fstab!

Ok I activated it on /. Is it useful to activate it also on /home ?

Best regards!

Offline

#12 2011-05-20 21:20:50

cypherinside
Member
Registered: 2011-04-22
Posts: 34

Re: Improving hard disk performance in fstab!

I think I made a mistake on my ext3 filesystem:
# tune2fs -o journal_data_writeback /dev/sda6
# tune2fs -O ^has_journal /dev/sda6
# e2fsck -f /dev/sda6

But on reboot i have the error "wrong fs type, bad option, bad superblock on /dev/sda6, missing codepage or helper program, or other error..." and /dev/sda6 is umoounted.
The output of "dmesg | grep ext3" is "EXT3-fs (sda6): error: no journal found. mounting ext3 over ext2?"
The output of "tune2fs -l /dev/sda6 | grep features" is "resize_inode dir_index filetype sparse_super large_file".
Is use this partition as archive fot music, videos and oter files.
What can I do? Can I fix it without lose my files?

Last edited by cypherinside (2011-05-20 21:28:41)


To be or not to be? ...Not to be! (Last Action Hero)

Offline

#13 2011-05-20 21:41:40

trusktr
Banned
From: .earth
Registered: 2010-02-18
Posts: 907
Website

Re: Improving hard disk performance in fstab!

@cypherinside I believe you can... You might want to make a new thread for this though.


joe@trusktr.io - joe at true skater dot io.

Offline

#14 2011-05-20 21:58:34

cypherinside
Member
Registered: 2011-04-22
Posts: 34

Re: Improving hard disk performance in fstab!

Already done, but in italian forum.
Can you tell me how I can fix my fs?


To be or not to be? ...Not to be! (Last Action Hero)

Offline

#15 2011-05-21 04:47:30

cypherinside
Member
Registered: 2011-04-22
Posts: 34

Re: Improving hard disk performance in fstab!

never mind, I fixed it:

# tune2fs -O +has_journal /dev/sda6

Bye.


To be or not to be? ...Not to be! (Last Action Hero)

Offline

Board footer

Powered by FluxBB