LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Is there a way to identify filesystem ext3 data mode ? (https://www.linuxquestions.org/questions/linux-newbie-8/is-there-a-way-to-identify-filesystem-ext3-data-mode-687476/)

sheelraj 12-01-2008 10:10 AM

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

jstephens84 12-01-2008 10:38 AM

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.

acid_kewpie 12-01-2008 10:39 AM

tune2fs will show you the fs features.

tommylovell 12-01-2008 11:09 AM

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.

sheelraj 12-01-2008 11:10 AM

If i use tunefs and set it to ordered mode. I won't loose any data right? or face any filesystem related problems?

tommylovell 12-01-2008 11:21 AM

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.

sheelraj 12-01-2008 02:04 PM

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.

acid_kewpie 12-01-2008 02:07 PM

just use the -l option

jstephens84 12-01-2008 02:30 PM

Quote:

Originally Posted by tommylovell (Post 3360633)
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

sheelraj 12-01-2008 02:47 PM

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.

syg00 12-01-2008 02:55 PM

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.

sheelraj 12-01-2008 03:05 PM

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 ??

acid_kewpie 12-01-2008 03:11 PM

it's both. if you read the tune2fs manpage you'll see the details there.

tommylovell 12-01-2008 04:04 PM

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.

jozik 12-01-2008 04:12 PM

Quote:

Originally Posted by sheelraj (Post 3360924)
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?


All times are GMT -5. The time now is 06:46 PM.