Q. One of our blog reader asked.. why lost+found directory is created after a fresh installation and what information it contains ? Please let me know about this directory?
This is an important directory which is useful for recovering files which are not properly closed due to many reason such as power failure. Lost+Found is created by system at the time of Linux OS installation for each partition we create. In other words we can say the mounted folder contains this lost+found folder. This folder contains the files with no links and files to be recovered. Any file to be recovered is kept in this folder. fsck command is used to recover these files.
This folder is not present in all the folders. Here is my HDD df command output.
firstname.lastname@example.org:~$ df -h Filesystem Size Used Avail Use% Mounted on /dev/sda1 37G 9.8G 26G 29% /udev 3.9G 4.0K 3.9G 1%
/devtmpfs 1.6G 920K 1.6G 1% /runnone 5.0M 0 5.0M 0% /run/lock none 3.9G 1.8M 3.9G 1% /run/shm none 100M 44K 100M 1% /run/user cgroup 3.9G 0 3.9G 0% /sys/fs/cgroup /dev/sda5 37G 8.5G 27G 25% /home /dev/sda7 499G 298G 177G 63% /opt
If I go in to / or /home or /opt folder I can see this folder.
email@example.com:~$ cd /firstname.lastname@example.org:/home$ pwd/home email@example.com:/home$ ls lost+found surendra firstname.lastname@example.org:/home$
So in other words we can say for each partition this folder is present so that what ever files to be recovered with fsck can be kept in this folder. This folder is not accessible by normal user.
Latest posts by Surendra Anne (see all)
- Review: Whizlabs Practice Tests for AWS Certified Solutions Architect Professional (CSAP) - August 27, 2018
- How to use ohai/chef-shell to get node attributes - July 19, 2018
- wget download a file to a directory in Linux/Unix - June 4, 2018
- GIT: How to compare two GIT branches? - June 3, 2018
- Online training on Linux Bash shell scripting - February 8, 2018