[lkml]   [2001]   [Jan]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Renaming lost+found
H. Peter Anvin writes:
> Hello people... the original question was: can lost+found be
> *renamed*, i.e. does the tools (e2fsck &c) use "/lost+found" by name,
> or by inode? As far as I know it always uses the same inode number
> (11), but I don't know if that is anywhere enforced.

Bzzt. /lost+found just happens to use inode 11 on 99.9% of filesystems
because it is the first inode available when mke2fs is creating the
filesystem. If you check <linux/ext2_fs.h>, it has:


It is perfectly acceptable to delete lost+found, and create it again
with mklost+found, and chances are it will have a different inode...
Just tested it, and sure enough, I got inode 612 for lost+found this time.
I'm pretty sure that e2fsck looks for the name /lost+found, rather than
inode 11.

This means that with stock e2fsck, mke2fs, mklost+found, you can't rename
lost+found and expect anything to work. However, I would imagine it isn't
_too_ hard to change these tools to create a different directory, and for
e2fsck to look for the standard or the new directory to put nameless inodes.

Looking at the e2fsck source, there only appears to be a single instance of
the string "lost+found", in e2fsck/pass3.c:get_lost_and_found():

static const char name[] = "lost+found";

Same with misc/mke2fs.c:create_lost_and_found() and misc/mklost+found.

Cheers, Andreas

PS - don't blame me if you never find your files after a bad crash. At
least when it is called "lost+found" you occasionally have a look
in there.
Andreas Dilger \ "If a man ate a pound of pasta and a pound of antipasto,
\ would they cancel out, leaving him still hungry?" -- Dogbert
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:24    [W:0.067 / U:26.168 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site