Live data from Hacker News

What is the purpose of the lost+found folder in Linux and Unix? (2014)

unix.stackexchange.com

11–20 of 95 posts

Re: What is the purpose of the lost+found folder in Linux and Unix? (2014)

#11

In a couple of decades running Linux installations of all flavours, I have never seen anything in lost+found!

Same here. And I had some pretty f**ed up file systems.

At one point, I had one where the directory structure was completely broken and had circles in it (broken SSD). To be fair, in that particular case, I did not look for lost+found and just wrote a tool to extract the data manually that I was looking for.

Re: What is the purpose of the lost+found folder in Linux and Unix? (2014)

#14
post #5

In a couple of decades running Linux installations of all flavours, I have never seen anything in lost+found!

You need to use worse hardware and bad power :)

Umm .. how about a Raspberry Pi Zero 2W powered by a 2000MaH " lipstick style" powerbank?

Re: What is the purpose of the lost+found folder in Linux and Unix? (2014)

#17

In a couple of decades running Linux installations of all flavours, I have never seen anything in lost+found!

Yea, run an old kernel with ext2 on a busy system writing a bunch of small files and have a power supply fail and you'll end up with something there.

fsck on large hard drives was scary on how long it could take to finish.

Re: What is the purpose of the lost+found folder in Linux and Unix? (2014)

#20
post #2

I had a lost+found folder in all Unix file systems I used since the 80s. It's where fsck places files that it found during a scan and can't figure out to which directory they belong. Sometimes I found stuff in there. From what I googled XFS, Btrfs and ZFS don't use lost+found. It's a thing of the old not journaled filesystems and of the ext family.

XFS does use /lost+found, it calls it the "orphanage directory" and xfs_repair reparents children of corrupt directories there.

Based on comments in the kernel source, it seems like the userspace fsck for JFS and F2FS will also sometimes create /lost+found. There might be more that do.

Post reply on HN