[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Why is .journal file sometimes visible and sometimes not?



On Sep 19, 2001  09:09 -0600, David Richardson wrote:
> On Wed, 19 Sep 2001, John Hiemenz wrote:
> > This was an interesting tidbit.  I never thought to ask about visible
> > journal files, thought they always were.  I am assuming I could unmount
> > a partition, convert it to ext2 and then back to ext3 and the journal
> > would then become hidden.  I have a test system I'll be doing that with
> > shortly..
> 
> What I did to convert several partitions to hidden journals was:
> 
> umount /dev/whatever
> tune2fs -O ^has_journal /dev/whatever
> tune2fs -j /dev/whatever
> e2fsck -f /dev/whatever
> mount /dev/whatever
> rm </dev/whatever's mountpoint>/.journal
> 
> Obviously, you can't convert your root partition this way.
> 
> The forced e2fsck is there because the man page for tune2fs says a fsck is
> required after using 'tune2fs -O'.

If it really becomes an issue, it may be possible to convert a visible
journal to a hidden journal at e2fsck time.  It would probably be OK
for unmounted filesystems, where all you would need to do is copy the
visible journal inode contents to inode 8, change the superblock to have
s_journal_inode=8, and then zero the original inode and mark it unused.

This would still not be possible (or at least difficult) on the root fs
because the kernel already has the journal inode open at mount time,
and you don't want to mess with the inode numbers/blocks like that.

Once ext3 gets into the mainstream, and people start installing their
systems with ext3 from the beginning, then all of the journals will be
hidden.  If you are using ext2 dump to do backups, recent versions
know to ignore the journal inode during the backup.  If you use tar or
similar, you will backup/restore the journal but presumably you have
already created the filesystem as ext3 (probably with a hidden journal)
so at worst it is a waste of space.  Since the visible journal has the
immutable flag set and is read-only, you shouldn't be able to overwrite
it with the restore.

Cheers, Andreas
--
Andreas Dilger  \ "If a man ate a pound of pasta and a pound of antipasto,
                 \  would they cancel out, leaving him still hungry?"
http://www-mddsp.enel.ucalgary.ca/People/adilger/               -- Dogbert





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]