Questions tagged [lost-found]

The “lost+found” directory at the root of a filesystem is where the filesystem repair command, “fsck” puts chunks of data that do not belong to any file. Use this tag for questions relating to this directory and/or how it’s used by the filesystem repair process. Do not use this tag for questions about files or directories that are somehow missing from the filesystem.

The lost+found directory at the root of a filesystem is a preallocated directory for data that is present on the filesystem, but not attached to any file. This can only happen if the filesystem is damaged due to a system crash or malfunctioning media. When , the filesystem repair command, finds chunks of data that do not seem to belong to any file, it attaches this data to the /lost+found directory.

Further reading

15 questions
752
votes
3 answers

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

There is a folder at the root of Linux and Unix operating systems called /lost+found/ What is it for? Under what circumstances would I interact with it? How would I interact with it?
Wesley
  • 13,563
  • 12
  • 34
  • 49
11
votes
4 answers

Can you have multiple lost and found directories?

I was unaware of the mklost+found command until I read this question. The mklost+found command will make a new lost+found directory in the pwd. Why would you ever need to run this command? The lost+found directory already exists in / on every…
spuder
  • 16,792
  • 34
  • 89
  • 119
8
votes
5 answers

Restore from lost+found

There was a problem on an EXT4 FS/memorycard and after and fsck all the files were put in the lost+found. Question: how can I restore the old filename/hierarchy from the lost+found? Or it is impossible? Not counting a restore from backup.
user90825
5
votes
1 answer

Why is the directory /lost+found 16K instead of 4K bytes?

I was in the root direction, /, and I did ls -lah for whatever reason and looked at the folder sizes. I noticed that the folder lost+found has a size of 16K, while all of the other directories has a size of 4K. /dev, /proc, and /sys are different…
cutrightjm
  • 4,678
  • 4
  • 20
  • 31
3
votes
2 answers

Should lost+found directories always be owned by root?

I'm using a script that creates file systems for specific users. One of the last operations of the script is a chown -R of the mount point to the user. This has the side effect to make the user the owner of the lost+found directory. Is this a…
xenoid
  • 8,074
  • 1
  • 21
  • 43
3
votes
1 answer

Busybox NAS appliance

I have a NAS appliance that crashed last weekend. The IT guys apparently / maybe didn't recover it in the right way? There's about 50,000 directories in a "lost+found" directory each with a numeric name like "#4289756". It looks as if all the…
nedpwolf
3
votes
3 answers

File missing after fsck

Recently, my HDD crashed and I had to run a fsck command. Many files were moved to the lost+found folder and I've retrieved the important ones using find and grep, but I can't find my SQL databases. Questions How can I find InnoDB databases in my…
John
  • 133
  • 1
  • 4
2
votes
1 answer

/var/lib/dpkg/ disappeared after fsck

All apt-like commands failed to create the lock file, because /var/lib/dpkg/ doesn't exist. Also, /lost+found/ has contents: pi@pi-top:~ $ sudo ls -al /lost+found/ total 102456 drwx------ 11 root root 16384 Apr 3 16:26 . drwxr-xr-x 23 root…
wizzwizz4
  • 497
  • 4
  • 19
2
votes
1 answer

What are the conditions that qualify a file as lost and found?

For files that fsck places in lost+found directory, under what circumstances does fsck consider a file to be lost, I have the following in my mind: For regular files: 1) If the inode links count is 0. As described in this answer: "an inode with no…
direprobs
  • 864
  • 14
  • 27
1
vote
3 answers

Where are my saved files in home folder?

I reinstalled my UBUNTU 12.04 after facing some crashing issues with my software. I have separate partitions for / and /home. Output of df -h: root@sougata-SATELLITE-L750:/home# df -h Filesystem Size Used Avail Use% Mounted on /dev/sda1 …
SougataPal
  • 11
  • 4
0
votes
1 answer

Does rsync process the lost+found directory by default?

I updated my rsync ignore file and used the --delete-excluded flag to remove now-redundant files from the destination side. rsync can't complete the task since I have the line lost+found/ in the said file: rsync: [generator] opendir…
user598527
  • 287
  • 1
  • 14
0
votes
1 answer

Is there a way to automatically restore system files from lost+found

I am running Debian Buster, and out of nowhere the file system of the root partition got corrupted. I wasn't doing anything out of the ordinary, just surfing the net basically, and at some point i find out that the root partition is remounted as…
0
votes
2 answers

lost folder from /mnt and recovering

I'm running Ubuntu 14.04.2 LTS (GNU/Linux 3.13.0-48-generic x86_64) on Amazon AWS. I had a folder "foo" in the /mnt and after few modification I had to recover to previous backup of the instance . after restore "/mnt/foo" folder is missing ,…
Ruwan Ranganath
  • 214
  • 2
  • 11
-1
votes
1 answer

If a directory is put in lost+found after running fsck, will it contain all of the original contents?

Let's say I have the following directory structure, in an ext4 filesystem: a/b/{1..9} (in other words, a/b/1, a/b/2, ... a/b/9) Suppose I am writing to a/b, and then I lose power. fsck runs and finds some files (a/b/1, a/b/2, etc.) and puts them in…
jj172
  • 303
  • 1
  • 4
  • 11
-1
votes
1 answer

What is inode number of lost + found directory in Linux?

I used this to find the inodes, but can't locate lost + found in it find . -printf '%i\n' | sort -u | wc -l
lsbmsb
  • 37
  • 1
  • 9