You are not logged in.

#1 2010-09-04 09:21:52

Mr. Alex
Member
Registered: 2010-08-26
Posts: 623

ext4 journal level and managing it

As far as I know, ext4 has
* writeback mode
* ordered mode
* journal mode

How do I know what mode is used now on my HDD?
If I change it with "tune2fs -o ...", will the chnage be permanent or just until reboot?

Thanks!

Last edited by Mr. Alex (2010-09-04 11:00:01)

Offline

#2 2010-09-04 15:27:43

ctrl
Member
Registered: 2010-08-30
Posts: 11

Re: ext4 journal level and managing it

How do I know what mode is used now on my HDD?
Maybe, you find something with tune2fs -l /dev/...

If I change it with "tune2fs -o ...", will the chnage be permanent or just until reboot?
I guess, you also have to change the /etc/fstab setting. I.e. if you use writeback:
/dev/... /home ext4 data=writeback(and other options if you want) 0 1

Last edited by ctrl (2010-09-04 18:26:33)

Offline

#3 2010-09-04 15:33:25

flamelab
Member
From: Athens, Hellas (Greece)
Registered: 2007-12-26
Posts: 2,160

Re: ext4 journal level and managing it

It is permanent if you choose a different mode through tune2fs. You can change it anytime of course with tune2fs again.

Last edited by flamelab (2010-09-04 15:33:47)

Offline

#4 2010-09-04 15:47:25

Mr. Alex
Member
Registered: 2010-08-26
Posts: 623

Re: ext4 journal level and managing it

> Maybe, you find something with tune2fs -l /dev/...

Filesystem features:      has_journal ext_attr resize_inode dir_index filetype needs_recovery extent flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize

Does "has_journal" mean that I have "journal mode"? I mean "ordered mode" also should have a journal I believe...

Offline

#5 2010-09-04 15:50:53

flamelab
Member
From: Athens, Hellas (Greece)
Registered: 2007-12-26
Posts: 2,160

Re: ext4 journal level and managing it

tune2fs -o journal_data_writeback for writeback, tune2fs -o journal_data_ordered for ordered.

Offline

#6 2010-09-04 16:03:33

Mr. Alex
Member
Registered: 2010-08-26
Posts: 623

Re: ext4 journal level and managing it

flamelab, thanks; do I understand correct: (?)

"writeback mode" - best performance, worst protection
"ordered mode" - agerage
"journal mode" - worst performance, best protection

And seriously - how to find out what mode is set now?

Last edited by Mr. Alex (2010-09-04 16:16:04)

Offline

#7 2010-09-05 12:22:53

harryNID
Member
From: P3X-1971
Registered: 2009-06-12
Posts: 117

Re: ext4 journal level and managing it

You could try:

dmesg | grep 'mounted filesystem'

Output for me:
EXT4-fs (sda3): mounted filesystem with ordered data mode. Opts: (null)
EXT4-fs (sda4): mounted filesystem with ordered data mode. Opts: barrier=0
EXT4-fs (sdb1): mounted filesystem with ordered data mode. Opts: barrier=0

If you've never done anything then the default is journal mode. So it can be a safe bet that's what you're using now.


In solving a problem of this sort, the grand thing is to be able to reason backward. That is a very useful accomplishment, and a very easy one, but people do not practice it much. In the everyday affairs of life it is more useful to reason forward, and so the other comes to be neglected. There are fifty who can reason synthetically for one who can reason analytically.  --Sherlock Holmes

Offline

#8 2010-09-05 12:26:27

Mr. Alex
Member
Registered: 2010-08-26
Posts: 623

Re: ext4 journal level and managing it

Mine is:

EXT4-fs (sda2): mounted filesystem with ordered data mode. Opts: (null)

So it's not "journal" by default.

Offline

#9 2010-09-05 13:22:09

Mr. Alex
Member
Registered: 2010-08-26
Posts: 623

Re: ext4 journal level and managing it

And this mode only influences to write performance, not read performance. Right?

Offline

#10 2010-09-05 13:28:10

harryNID
Member
From: P3X-1971
Registered: 2009-06-12
Posts: 117

Re: ext4 journal level and managing it

I should have specified that most Distros set it to journal mode as a sane default.  It was an assumption. I have mine specifically set in fstab to ordered mode so I expected to see that result.  This is an interesting question!!


In solving a problem of this sort, the grand thing is to be able to reason backward. That is a very useful accomplishment, and a very easy one, but people do not practice it much. In the everyday affairs of life it is more useful to reason forward, and so the other comes to be neglected. There are fifty who can reason synthetically for one who can reason analytically.  --Sherlock Holmes

Offline

#11 2010-09-05 13:57:20

Mr. Alex
Member
Registered: 2010-08-26
Posts: 623

Re: ext4 journal level and managing it

By the way, "tune2fs -o journal_data /dev/sda1" really does its purpose.
You can set either

- journal_data
- journal_data_ordered
- journal_data_writeback

That's what I figured out.

Offline

#12 2010-09-06 10:25:37

rwd
Member
Registered: 2009-02-08
Posts: 664

Re: ext4 journal level and managing it

This also gives details about all current mounts:

cat /proc/mounts

Last edited by rwd (2010-09-06 10:29:03)

Offline

#13 2010-09-06 16:09:03

harryNID
Member
From: P3X-1971
Registered: 2009-06-12
Posts: 117

Re: ext4 journal level and managing it

Disregard what I said earlier. You are correct  "journal_data_ordered" is the default under EXT3 and apparently EXT4 as well. Sorry for giving the wrong info.

Enable Full Journaling


In solving a problem of this sort, the grand thing is to be able to reason backward. That is a very useful accomplishment, and a very easy one, but people do not practice it much. In the everyday affairs of life it is more useful to reason forward, and so the other comes to be neglected. There are fifty who can reason synthetically for one who can reason analytically.  --Sherlock Holmes

Offline

#14 2010-09-06 16:19:51

Mr. Alex
Member
Registered: 2010-08-26
Posts: 623

Re: ext4 journal level and managing it

That's OK. I found needed info.

tune2fs -o journal_data /dev/sda1
tune2fs -o journal_data_ordered /dev/sda1
tune2fs -o journal_data_writeback /dev/sda1

Offline

Board footer

Powered by FluxBB