My Profile Photo

Sheogorath's Blog

Depending on the time of the day a friend, a colleague, a wise guy. The beauty of the world is its sense of humor to show humans their way by letting them search their own.

Cover image for this blog post


Today I learned that one can’t recreate a functional lost+found directory using mkdir but has to use mklost+found1. The lost+found directory is a special purpose directory that is used as part of file recoveries by fsck. Everything that looks like a file but has no inode will be created as file in the lost+found directory of the partition. This allows to recover all possible data, which otherwise wouldn’t be accessible. As this is not how regular directories work, it can’t be recreated like a normal directory.

I’m not fully sure where I saw a link to the StackOverflow posting, but it was open in my browser and rather interesting to read. Sorry to whoever shared it with me, you share awesome stuff. I was already aware of the purpose of lost+found but entirely unaware of the fact that a mklost+found command exists as I luckily never deleted that directory anywhere.2

  1. Yes, this command has a + sign in it. 

  2. And if I did, I didn’t need it yet.