su-journal and lost+found sharing inodes?
Ivan Voras
ivoras at freebsd.org
Sat Feb 22 09:55:43 UTC 2014
On 21 February 2014 17:54, Kirk McKusick <mckusick at mckusick.com> wrote:
> > To: freebsd-fs at freebsd.org
> > From: Ivan Voras <ivoras at freebsd.org>
> > Subject: su-journal and lost+found sharing inodes?
> > Date: Fri, 21 Feb 2014 12:15:03 +0100
> >
> > After a crash which required manual fsck, I've enabled SUJ and rebooted.
> > Everything seemed fine until I (as a part of normal, unrelated work)
> > noticed that "lost+found" is not a file. But the details are very
> curious:
> >
> > (ls -ali)
> >
> > 3 drwxrwxr-x 2 root operator 512 Jan 17 14:25 .snap/
> > 4 -r-------- 1 root wheel 33554432 Feb 21 10:29 .sujournal
> > 4 -r-------- 1 root wheel 33554432 Feb 21 10:29 lost+found
> >
> > Am I seeing what I think I'm seeing? lost+found sharing an inode with
> > .sujournal, but the hardlink count staying "1" for both files?
> >
> > SUJ was enabled after a fsck -y run on the file system.
>
> That is wrong. You will need to run fsck -f to force it to do a full
> fsck on the filesystem to get that cleaned up. Journalling (like all
> journalling systems) only fixes things that break while it is running.
> It does not fix up pre-existing conditions. Note that fsck -y does not
> always make good decision on how to handle things. It is really designed
> as a last-ditch effort to recover the filesystem.
>
I didn't want to suggest that journaling would fix anything, I was
describing the sequence of operations I did: first fsck -y then turning on
journaling - the inode mixup could have happened either in fsck or in
tunefs where it re-used an inode which it shouldn't have.
More information about the freebsd-fs
mailing list