Re: Kernel 2.4.15-pre6 / EXT3 / ls shows '.journal' on root-fs.

From: Stephen C. Tweedie (sct@redhat.com)
Date: Thu Nov 22 2001 - 15:39:10 EST


Hi,

On Tue, Nov 20, 2001 at 03:20:52AM +0200, Tommi Kyntola wrote:
 
> Minor corrections though, atleast on my 2.4.15-pre6 with tune2fs 1.23
> the .journal is visible even when created as unmounted.

There is absolutely no code in e2fsprogs to create that file on an
unmounted filesystem. The only mention of the ".journal" name in
e2fsprogs-1.23 is in the code where it opens a regular file with that
name using normal syscalls to access mounted filesystems. A
".journal" file might be an artifact resulting from doing a recursive
copy from an online-upgraded ext3 filesystem to the new one, though.

> Is the 'rm .journal' the way preferred way to "hide" it?
> Are there any side-effects caused by removal?
> Could someone shed a little more light on this subject.
> What would happen if root were to write to it?

The .journal is an immutable file. Root will get -EPERM.

> root@behemoth / # tune2fs -O ^has_journal /dev/hda2
> tune2fs 1.23, 15-Aug-2001 for EXT2 FS 0.5b, 95/08/09
> root@behemoth / # mount /tmp
> root@behemoth / # grep /tmp /etc/mtab
> /dev/hda2 /tmp ext2 rw 0 0
> root@behemoth / # umount /tmp
> root@behemoth / # tune2fs -j /dev/hda2
> root@behemoth / # ls -la /tmp | grep journal
> -rw------- 1 root root 8388608 Oct 23 17:10 .journal

Just clearing the "has_journal" flag from an online-upgraded
filesystem won't be enough to delete the .journal file.

"dumpe2fs" will tell you what inode the filesystem is actually using
for the journal: I suspect it won't be using that .journal file.

Cheers,
 Stephen
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Nov 23 2001 - 21:00:31 EST