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.
email@example.com:~$ 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.
firstname.lastname@example.org:~$ cd /email@example.com:/home$ pwd/home firstname.lastname@example.org:/home$ ls lost+found surendra email@example.com:/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)
- Online training on Linux Bash shell scripting - February 8, 2018
- 15 iostat command examples in Linux/Unix - December 4, 2017
- How to Installing and Configuring Firewalld on Linux - November 29, 2017
- 4 sleep command examples in Linux/Unix - November 2, 2017
- 5 SSH alias examples in Linux - October 16, 2017