>> > If your system dosn't get shutdown properly and some errors occur
on the
>> > harddrive, linux puts the files there which have been damaged.

To understand the lost+found folder you need to understand a little of
how Unix handles the filesystems. (OK, GNU/Linux, but that's
hairsplitting for the lawyers.)

In order to speed up disk access so that a program may write out
something, then get back to whatever it was doing, the operating system
creates a number of write buffers for the disk. (Remember that most of
this stuff came about when a 95 ms access time was king of the hill.)
Basically the OS has a section of memory that it accepts bytes destined
to go on the hard drive, then lies to the requesting program that it's
been written so the user program will get back to its business. Then the
system really flushes the bytes out to the physical disk later when it
gets a chance. Part of the shutdown routine is to force the disk buffers
to sync all their data to the physical drive before the system halts. As
part of that sync procedure the systems writes a flag to the filesystem
that all the buffers are clean and the file system is intact. This flag
gets changed when the filesystem is used to indicate that the *LOGICAL*
state of the hard drive does not match the *PHYSICAL* state of the hard
drive. (Way over-simplified, but you get the idea.)

If you just reach out and kill the power or some terrible, bad, naughty
program crashes the system this flag says "DIRTY" and the startup
procedure runs the fsck (FileSystemChecK) program, which is somewhat
analogous to the windows scandisk program. Now, fsck does a whole bunch
of swell things, and you should probably read the documentation if you
really want to know the nuts and bolts details. But one of the things it
does, if it finds an intact (somewhat) file with no place to call home
it stuffs it into the lost+found directory and gives it a generic name
similar to the MS-DOS C:\FILE0000.CHK stuff. They might be trash, or
they might be treasures; it's up to you to look at them and decide.

The fact that GNU/Linux does this automagically is a remnant of the days
when the central host was a big box kept in a glass house and tended by
high priests called "system administrators" around the clock.

>> > > What is this folder for?  I've never seen anything in it.

It's good that you've never seen anything in it. I hope you never do.
Just remember to shut the system down properly. (And don't run any
naughty programs!)

MB

Reply via email to