Knowledge Base:What is the lost+found directory?

From Gentoo Wiki
Jump to:navigation Jump to:search

Synopsis

After creating a file system, a directory called "lost+found" is created.

Environment

Any Gentoo Linux system with an ext2, ext3, or ext4, or f2fs[1] file system.

Analysis

The lost+found directory is used by file system check tools (fsck). When a system crashes and there is some inconsistency, fsck might be able to (partially) recover lost information (files or directories). It might not know where these files should reside, so it places them in the lost+found directory so that the administrator can move them back to their original location(s).

The lost+found directory is not vital. If the administrator decides to delete it, on the next run of fsck will be recreated.

Resolution

Using ext or f2fs filesystem the lost+found directory is to be expected. Move away from ext or f2fs-based filesystems to avoid automatic creation of this directory.

References