[Novalug] where are they?

Jon LaBadie novalugml@jgcomp.com
Tue Mar 10 18:55:52 EDT 2015


On Tue, Mar 10, 2015 at 06:27:16PM -0400, pereira via Novalug wrote:
> List,
> 
> Jim makes an interesting point that I have long wondered about:
> how do files get into lost+found?
> 
> It has happened mainly, or maybe exclusively, on memory sticks
> (on my system, "sudo ls /home/lost+found gives nothing").
> 
> Does fsck put files with zero links into lost+found? But, when I 'delete'
> them,  I just learned, I reduce the number of links.
> 
> What am I missing?

What fsck finds is an inode which seems to still be valid
but which no directory claims (i.e. there is not directory
entry for that inode number).  "still valid" used to be
the first 16 bits, 4 for file type and 12 for permissions,
are not zeroed out.  I believe it also must still have
data blocks associated with the inode.

In that case, an entry for it is made in the lost+found
directory, the name probably made up from its inode index
number, and the link count is set to 1.  Doesn't matter
what it was before, now only 1 directory entry points to
that inode.

> 
> On 03/10/2015 05:24 PM, James Ewing Cottrell, III via Novalug wrote:
> >In the distant past, you *could* have hard links to directories. The powers that be decided that was more trouble than it was worth.
> >
> >As for your statements below, it is entirely possible that the existing link could be removed before the new link was made, so that there would be zero links rather than two. When fsck found it, it would end up in lost+found.
> >
> >JIM
> >
> 
> **********************************************************************
> The Novalug mailing list is hosted by firemountain.net.
> 
> To unsubscribe or change delivery options:
> http://www.firemountain.net/mailman/listinfo/novalug
>>> End of included message <<<

-- 
Jon H. LaBadie                  novalugml@jgcomp.com
 11226 South Shore Rd		(703) 787-0688 (H)
 Reston, VA  20190		(703) 935-6720 (C)



More information about the Novalug mailing list