LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-01-2008, 11:10 AM   #1
sheelraj
LQ Newbie
 
Registered: Dec 2008
Posts: 7

Rep: Reputation: 0
Is there a way to identify filesystem ext3 data mode ?


I am trying to identify which data mode is being set for my ext3 filesystem. I didn't install my OS. So is there a way that using some command or tool I can use to get info about my ext3 filesystem and which data mode (Ordered. journal, writeback) is being used.

The purpose of this is to then find out a reliable solution to secure delete/erase files on my system.

Thanks in advance
 
Old 12-01-2008, 11:38 AM   #2
jstephens84
Senior Member
 
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098

Rep: Reputation: 102Reputation: 102
try looking into your /etc/fstab or menu.lst to see if you see anything like data=[option here] you can also use options like this to set it to what you want.
Code:
tune2fs -o journal_data_writeback /dev/hda2
just change the writeback to ordered and the hda2 to what ever you want.

Last edited by jstephens84; 12-01-2008 at 11:40 AM.
 
Old 12-01-2008, 11:39 AM   #3
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
tune2fs will show you the fs features.
 
Old 12-01-2008, 12:09 PM   #4
tommylovell
Member
 
Registered: Nov 2005
Distribution: Fedora, Redhat
Posts: 372

Rep: Reputation: 101Reputation: 101
I found in http://batleth.sapienti-sat.org/proj.../ext3-faq.html a description of the journaling modes (which you clearly already know, since you are asking this advanced a question).

If you look in your /var/log/messages, you should see something like this:

Nov 22 17:01:55 athlon4k6 kernel: EXT3 FS on sda2, internal journal
Nov 22 17:01:55 athlon4k6 kernel: EXT3-fs: mounted filesystem with ordered data mode.
Nov 22 17:01:55 athlon4k6 kernel: kjournald starting. Commit interval 5 seconds
Nov 22 17:01:55 athlon4k6 kernel: EXT3 FS on sda1, internal journal
Nov 22 17:01:55 athlon4k6 kernel: EXT3-fs: mounted filesystem with ordered data mode.
Nov 22 17:01:55 athlon4k6 kernel: kjournald starting. Commit interval 5 seconds
Nov 22 17:01:55 athlon4k6 kernel: EXT3-fs warning: maximal mount count reached, running e2fsck is recommended
Nov 22 17:01:55 athlon4k6 kernel: EXT3 FS on md0, internal journal
Nov 22 17:01:55 athlon4k6 kernel: EXT3-fs: mounted filesystem with ordered data mode.
Nov 22 17:01:55 athlon4k6 kernel: kjournald starting. Commit interval 5 seconds
Nov 22 17:01:55 athlon4k6 kernel: EXT3-fs warning: maximal mount count reached, running e2fsck is recommended
Nov 22 17:01:55 athlon4k6 kernel: EXT3 FS on md2, internal journal
Nov 22 17:01:55 athlon4k6 kernel: EXT3-fs: mounted filesystem with ordered data mode.

That'll tell you how the mount was done.
 
Old 12-01-2008, 12:10 PM   #5
sheelraj
LQ Newbie
 
Registered: Dec 2008
Posts: 7

Original Poster
Rep: Reputation: 0
If i use tunefs and set it to ordered mode. I won't loose any data right? or face any filesystem related problems?
 
Old 12-01-2008, 12:21 PM   #6
tommylovell
Member
 
Registered: Nov 2005
Distribution: Fedora, Redhat
Posts: 372

Rep: Reputation: 101Reputation: 101
I've removed and re-added journals a few times with no problems, but it gave me the "creeps" each time I had to do it.

Unless I had a good reason to change it, I'd leave it as-is.
 
Old 12-01-2008, 03:04 PM   #7
sheelraj
LQ Newbie
 
Registered: Dec 2008
Posts: 7

Original Poster
Rep: Reputation: 0
How do you use tunefs to get info about filesystem, instead of setting any data mode ?

I checked /etc/fstab and /var/log/messages but couldn't find any info.
 
Old 12-01-2008, 03:07 PM   #8
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
just use the -l option
 
Old 12-01-2008, 03:30 PM   #9
jstephens84
Senior Member
 
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098

Rep: Reputation: 102Reputation: 102
Quote:
Originally Posted by tommylovell View Post
I found in http://batleth.sapienti-sat.org/proj.../ext3-faq.html a description of the journaling modes (which you clearly already know, since you are asking this advanced a question).

If you look in your /var/log/messages, you should see something like this:

Nov 22 17:01:55 athlon4k6 kernel: EXT3 FS on sda2, internal journal
Nov 22 17:01:55 athlon4k6 kernel: EXT3-fs: mounted filesystem with ordered data mode.
Nov 22 17:01:55 athlon4k6 kernel: kjournald starting. Commit interval 5 seconds
Nov 22 17:01:55 athlon4k6 kernel: EXT3 FS on sda1, internal journal
Nov 22 17:01:55 athlon4k6 kernel: EXT3-fs: mounted filesystem with ordered data mode.
Nov 22 17:01:55 athlon4k6 kernel: kjournald starting. Commit interval 5 seconds
Nov 22 17:01:55 athlon4k6 kernel: EXT3-fs warning: maximal mount count reached, running e2fsck is recommended
Nov 22 17:01:55 athlon4k6 kernel: EXT3 FS on md0, internal journal
Nov 22 17:01:55 athlon4k6 kernel: EXT3-fs: mounted filesystem with ordered data mode.
Nov 22 17:01:55 athlon4k6 kernel: kjournald starting. Commit interval 5 seconds
Nov 22 17:01:55 athlon4k6 kernel: EXT3-fs warning: maximal mount count reached, running e2fsck is recommended
Nov 22 17:01:55 athlon4k6 kernel: EXT3 FS on md2, internal journal
Nov 22 17:01:55 athlon4k6 kernel: EXT3-fs: mounted filesystem with ordered data mode.

That'll tell you how the mount was done.
Worked also on my test debian vm.
Code:
cat /var/log/messages | grep EXT3
 
Old 12-01-2008, 03:47 PM   #10
sheelraj
LQ Newbie
 
Registered: Dec 2008
Posts: 7

Original Poster
Rep: Reputation: 0
So if something says like this

Quote:
EXT3-fs: mounted filesystem with ordered data mode.
EXT3 FS on hda3, internal journal
EXT3 FS on hda1, internal journal
EXT3-fs: mounted filesystem with ordered data mode.
what does this mean ? hda3 is ordered or journal ??
Sorry if the questions sound silly, am just confused about the logs.
 
Old 12-01-2008, 03:55 PM   #11
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,950

Rep: Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210
If you can't see the mount messages in messages (or kern.log or ...) check if they have been rotated. Tune2fs shows "features" - ordered mode ain't a feature (it's default), so it doesn't show.
 
Old 12-01-2008, 04:05 PM   #12
sheelraj
LQ Newbie
 
Registered: Dec 2008
Posts: 7

Original Poster
Rep: Reputation: 0
I found this in /var/log/messages.1

Quote:
EXT3-fs: mounted filesystem with ordered data mode.
EXT3 FS on hda3, internal journal
EXT3 FS on hda1, internal journal
EXT3-fs: mounted filesystem with ordered data mode
.

what does this mean ? hda3 is ordered or journal ??
 
Old 12-01-2008, 04:11 PM   #13
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
it's both. if you read the tune2fs manpage you'll see the details there.
 
Old 12-01-2008, 05:04 PM   #14
tommylovell
Member
 
Registered: Nov 2005
Distribution: Fedora, Redhat
Posts: 372

Rep: Reputation: 101Reputation: 101
In ext3 v2, which is a journalling filesystem, there are three journalling methods:

- Journal mode
- Ordered mode
- Writeback mode

Yours is Ordered mode (the default).

Clearly, whoever wrote the code could have chosen better terms for the three modes.
Journal mode should have been renamed something like "Full mode".

Even so, I am grateful for the countless hours (days?, weeks?) that the authors have
put in, and am happy to use, for free, the results of their hard work... And I'd
chose elegant bulletproof code over documentation prose any day.
 
Old 12-01-2008, 05:12 PM   #15
jozik
LQ Newbie
 
Registered: Jul 2008
Posts: 7
Blog Entries: 2

Rep: Reputation: 0
Quote:
Originally Posted by sheelraj View Post
I found this in /var/log/messages.1

.

what does this mean ? hda3 is ordered or journal ??
I think it means that the hda3 is in good order and that the journal is ordered. But as said by the previous replier: maybe reading the manpage will help....
BTW: is this question something for the newbie thread?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to mount ext3 filesystem kkpal Linux - Newbie 13 10-23-2008 02:36 PM
resize ext3 filesystem DaWallace Slackware 8 10-10-2007 07:15 AM
Confusing USB Filesystem Problem (Can't Wipe Ext3 Filesystem) dkaplowitz Linux - Hardware 3 04-14-2007 07:30 PM
Identify current mode of a file scbops Programming 2 07-03-2006 09:41 AM
Cant make linux to identify my 56k internal data fax modem Nik0s Linux - Hardware 7 01-05-2004 03:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:40 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration