LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Idenitfying current ext3 journal mode. (https://www.linuxquestions.org/questions/linux-newbie-8/idenitfying-current-ext3-journal-mode-698738/)

Chrysalis 01-20-2009 10:14 PM

Idenitfying current ext3 journal mode.
 
I got a server supplied to me with the filesystem on sda1 drive created by datacentre techs.

I created the filesystems on md0 md1 and sdc1 myself.

When these are mounted in /var/log/messages I see the current journal type like these below.

Jan 21 01:20:38 kernel: EXT3 FS on dm-2, internal journal
Jan 21 01:20:38 kernel: EXT3-fs: mounted filesystem with ordered data mode

However this is what I see for sda1

Jan 19 16:45:06 kernel: EXT3 FS on sda1, internal journal

Thats it, no journal type information.

tune2fs -l shows this

Default mount options: (none)

No help either.

Ordered data mode is the default, I suspect my sda1 is using writeback mode or maybe no journaling at all, if my sda1 is using ordered then why doesnt it say so like all my other drives.

Thanks in advance.

JZL240I-U 01-21-2009 03:17 AM

AFAIR the mount mode is determined in "/etc/fstab". To make sure
Code:

man mount
man fstab
man tune2fs


Chrysalis 01-21-2009 12:25 PM

Have read all them before I even made the post they dont answer my question.

fstab tells me its ext3 but no other info.

If the partition is formatted as ext3 with all default settings then journal is enabled in ordered mode as evident in my new drives. However I didnt format sda1 so I dont know if default settings were used, all I know is it is ext3. Fstab can overide these default settings but isnt, so all I know is that sda1 is been mounted using the settings that were defined on the format.

So you have pointed me to man files that dont help. All they do is tell me how to overide the defaults (I not asking how to do this), tell me how fstab works (already know this), and how to change current settings on the device, however sda1 is my boot device so I cant unmount it and the only useable tune2fs command I can run on it is tune2fs -l /dev/sda1 which I have already done and it does 'not' tell me the journal configuration as I stated in my first post.

/dev/sda1 / ext3 errors=remount-ro 0 1

JZL240I-U 01-22-2009 01:44 AM

Quote:

Originally Posted by Chrysalis (Post 3416363)
Have read all them before I even made the post they dont answer my question....

What is your problem then with this (from man tune2fs):
Code:

      -o [^]mount-option[,...]
              Set or clear the indicated default mount options in the filesys-
              tem.  Default mount options can be overridden by  mount  options
              specified  either  in /etc/fstab(5)
or on the command line argu-
              ments to mount(8).  Older kernels may not support this  feature;
              in  particular,  kernels  which  predate 2.4.20 will almost cer-
              tainly ignore the default mount options field in the superblock.

              More  than  one mount option can be cleared or set by separating
              features with commas.  Mount options prefixed with a caret char-
              acter  (’^’)  will  be  cleared  in the filesystem’s superblock;
              mount options without a prefix character or prefixed with a plus
              character (’+’) will be added to the filesystem.

              The following mount options can be set or cleared using tune2fs:

                  debug  Enable debugging code for this filesystem.

                  bsdgroups
                          Emulate BSD behaviour when creating new files:  they
                          will  take  the  group-id  of the directory in which
                          they were created.  The standard System V  behaviour
                          is  the  default,  where newly created files take on
                          the fsgid of the current process, unless the  direc-
                          tory  has the setgid bit set, in which case it takes
                          the gid from the parent directory, and also gets the
                          setgid bit set if it is directory itself.

                  user_xattr
                          Enable user-specified extended attributes.

                  acl    Enable Posix Access Control Lists.

                  uid16  Disables 32-bit UIDs and GIDs.  This is for interop-
                          erability with older kernels which  only  store  and
                          expect 16-bit values.

                  journal_data
                          When  the  filesystem  is  mounted  with journalling
                          enabled, all data (not just metadata)  is  committed
                          into  the  journal  prior  to being written into the
                          main filesystem.

                  journal_data_ordered
                          When the  filesystem  is  mounted  with  journalling
                          enabled, all data is forced directly out to the main
                          file system prior to its metadata being committed to
                          the journal.


                  journal_data_writeback
                          When  the  filesystem  is  mounted  with journalling
                          enabled, data may be written into the main  filesys-
                          tem  after  its  metadata  has been committed to the
                          journal.  This may increase throughput, however,  it
                          may  allow old data to appear in files after a crash
                          and journal recovery.


Chrysalis 01-22-2009 09:05 PM

I was asking how to "view" not "set" the current journal settings.

If I understand you right it seems there is no answer and the only thing I can do is just set a new default setting so I will do that.

JZL240I-U 01-26-2009 03:42 AM

Quote:

Originally Posted by Chrysalis (Post 3418120)
I was asking how to "view" not "set" the current journal settings...

Sorry, that was not clear to me.

Funny, that this should be possible at all, I mean your machine must handle the file system without defaults now?!?

I have never seen the output from "tune2fs -l" the way you posted it, normally tune2fs seems rather garrulous. Is this the latest version of tune2fs? Maybe "dump2fs" or "debugfs" could help but I never tried, so there is no experience here...

JZL240I-U 01-26-2009 04:46 AM

Quote:

Originally Posted by Chrysalis (Post 3415690)
I got a server supplied to me with the filesystem on sda1 drive created by datacentre techs.

I created the filesystems on md0 md1 and sdc1 myself.

...

Just had an idea ... perhaps they created sda1 as ext2 ... after all, the difference between ext2 and ext3 is mainly the journal.

colucix 01-26-2009 05:02 AM

Here is an excerpt form the ext3 FAQ:
Quote:

Q: I updated ext3 today. Got all of my mounts converted. Now on boot, I see: "EXT3-fs: mounted filesystem with ordered data mode". Is this normal?
Nigel Metheringham answered this on the ext3-users mailing list as follows:

That's fine. The EXT3-fs message is just telling you it mounted the fs OK. It's also telling you what form of journaling you are using.

ext3 has 2 formats of journal:

* version 1 - default and only possibility for ext3 releases 0.0.3* and earlier
* version 2 - default for filesystems created with 0.0.4 and later

Version 2 journals support additional semantics required to allow metadata journaling, and provide 2 new forms of journaling - ordered and writeback. Both V1 & V2 journals support data journaling (where everything that would go to disk is journaled).

The CHANGES file in the distribution says this:

New mount options:

"mount -o journal=update"
Mounts a filesystem with a Version 1 journal, upgrading the
journal dynamically to Version 2.

"mount -o data=journal"
Journals all data and metadata, so data is written twice. This
is the mode which all prior versions of ext3 used.

"mount -o data=ordered"
Only journals metadata changes, but data updates are flushed to
disk before any transactions commit. Data writes are not atomic
but this mode still guarantees that after a crash, files will
never contain stale data blocks from old files.

"mount -o data=writeback"
Only journals metadata changes, and data updates are entirely
left to the normal "sync" process. After a crash, files will
may contain stale data blocks from old files: this mode is
exactly equivalent to running ext2 with a very fast fsck on reboot.

Ordered and Writeback data modes require a Version 2 journal: if you do
not update the journal format then only the Journaled data will be
allowed.

The default data mode is Journaled for a V1 journal, and Ordered for V2.

Since the 0.0.4 version of ext3 was introduced in early 2000s, I guess recent distributions have a quite newer release of ext3 filesystem, so I'd stick with the fact that the default is ordered data mode. If the filesystem had a value other than the default it should be viewed by tune2fs -l as:
Code:

Default mount options:    journal_data_writeback

trindflo 09-30-2010 08:57 PM

Answer to original question: dmesg
 
As the original question, how to read/view the settings, was not answered I am adding to this old post.

dmesg | grep ext3

or

dmesg | grep sda

If you want to get additional information, use 'dmesg | less' then search for your drive. Things like "ordered data" will show up nearby.

Tijn 01-21-2012 08:12 AM

Quote:

Originally Posted by Chrysalis (Post 3418120)
I was asking how to "view" not "set" the current journal settings.

If I understand you right it seems there is no answer and the only thing I can do is just set a new default setting so I will do that.

May be too late for this thread - but it can help someone googling for this...

sudo tune2fs -l | grep features

if has_journal is listed, it's there, otherwise not.

JZL240I-U 01-23-2012 01:35 AM

Thanks for coming back and clarifying things. Nice to learn this even when I've long since switched to ext4. It is just good to know anyhow :).


All times are GMT -5. The time now is 02:04 PM.