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

From: Tommi Kyntola (kynde@ts.ray.fi)
Date: Mon Nov 19 2001 - 20:20:52 EST


> > I'm using kernel 2.4.15-pre6 and I can see my journal file
> > on '/'. Should I worry ?
> No, apparently the .journal file is visible if you created while the
> filesystem is mounted, but invisible if you create it when the filesystem is
> unmounted.

Minor corrections though, atleast on my 2.4.15-pre6 with tune2fs 1.23
the .journal is visible even when created as unmounted.
And it is not immutable, the only ext2 file attribute set is the "d"
(which refers to making it not a candidate for backup for dump,
 immutable would be "i", the source of all those funny
 # whoami
 root
 # ls foobar
 foobar
 # rm foobar
 rm: cannot unlink `foobar': Operation not permitted
 # echo "wtf?").

I was a bit surprised when the 'rm .journal' succeeded and removed it but
I take it that just hides it and the inode is still kept for the journal.

(This removal would've happened anyway when my /tmp sweeps would've erased
 it had I not known it's there to begin with)

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?

--------------- 8< ----------------- 8< -----------------

root@behemoth / # grep /tmp /etc/fstab
/dev/hda2 /tmp auto defaults 1 2
root@behemoth / # grep /tmp /etc/mtab
/dev/hda2 /tmp ext3 rw 0 0
root@behemoth / # umount /tmp
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
tune2fs 1.23, 15-Aug-2001 for EXT2 FS 0.5b, 95/08/09
Creating journal inode: done
This filesystem will be automatically checked every -1 mounts or
0 days, whichever comes first. Use tune2fs -c or -i to override.
root@behemoth / # mount /tmp
kjournald starting. Commit interval 5 seconds
EXT3 FS 2.4-0.9.15, 06 Nov 2001 on ide0(3,2), internal journal
EXT3-fs: mounted filesystem with ordered data mode.
root@behemoth / # ls -la /tmp | grep journal
-rw------- 1 root root 8388608 Oct 23 17:10 .journal
root@behemoth / # lsattr /tmp/.journal
-----d------- /tmp/.journal
root@behemoth / # tune2fs
tune2fs 1.23, 15-Aug-2001 for EXT2 FS 0.5b, 95/08/09
...

--------------- 8< ----------------- 8< -----------------

root@behemoth / # cd /tmp
root@behemoth /tmp # rm .journal
root@behemoth /tmp # ls -la | grep journal
root@behemoth /tmp # cd ..
root@behemoth / # umount /tmp
root@behemoth / # tune2fs -j /dev/hda2
tune2fs 1.23, 15-Aug-2001 for EXT2 FS 0.5b, 95/08/09
The filesystem already has a journal.

-- 
  Tommi "Kynde" Kyntola      
     /* A man alone in the forest talking to himself and 
        no women around to hear him. Is he still wrong?  */

- 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:22 EST