How to interpret the contents of /lost+found after serious filesystem corruption?
Linux - KernelThis forum is for all discussion relating to the Linux kernel.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Many file-repair utilities do this, including Windows' old chkdsk.exe. The objective is to be sure that there are no "in-use" physical files ("inodes ...") that do not have a directory-entry associated with them somewhere. A dummy directory-entry is built in "lost+found," basically so that the file can be "removed." (If you're curious what the orphaned inode contains, you can look at that now, too.)
But, the bottom line: "if a filesystem is hosed ... it's ... ... ... hosed."
OK, thanks sundialsvcs... Does anyone know of a quick way to break a filesystem so that I can play around with fsck and recovery attempts?
I have a system I can use to do this, but want to try and reproduce the corruption as close to the original issue as possible!
OK, thanks sundialsvcs... Does anyone know of a quick way to break a filesystem so that I can play around with fsck and recovery attempts?
I have a system I can use to do this, but want to try and reproduce the corruption as close to the original issue as possible!
Can you "dd"-duplicate the original corrupted system, before attempts at recovery?
OK, thanks sundialsvcs... Does anyone know of a quick way to break a filesystem so that I can play around with fsck and recovery attempts?
I have a system I can use to do this, but want to try and reproduce the corruption as close to the original issue as possible!
Well, you can dismount one, then use dd to zero out a few MB scattered around... (use count= for the number of blocks to zero out, and skip= to position to where you want to erase).
Then use fsck to analyze the filesystem.
This isn't as effective on filesystems using RAIDs. It can work, but errors would be harder to generate.
Well, part of the problem with that approach is that, in my experience, filesystem corruption is usually the side-effect of a hardware failure that has-happened or that is about-to-happen. It is very difficult to simulate that.
Well, part of the problem with that approach is that, in my experience, filesystem corruption is usually the side-effect of a hardware failure that has-happened or that is about-to-happen. It is very difficult to simulate that.
Such errors can occur due to loose cables (signal cable specially, sometimes power cable - but the cache in the disk helps save from power failures).
Not powering off properly (system lockup due to kernel crash) has created those files on my system using ext2. My directory listing is different than your examples here. Seems like just pulling the power plug out of the wall would sufficiently crash the disk to create those, but I wouldn't do it on purpose unless on a test system whose data you don't care about.
Some of the numbers may be inodes. It seems that char/block major and minor numbers also appear in your examples, but not in mine.
It is possible to find "lost" files with really strange flags on disks that have only been partially initialized via a dd restore...
Finding the sticky bit set on files, block devices with only group execute and world write/execute bits that have huge UID/GID numbers, dates before Dec 31,1969 (unix creation date/epoch), pipes the same way; all point to random values stuck in inodes.
All the files in "lost+found" will be numbers - taken from the inode number of the file (a ls -i will show that).
All the files in "lost+found" will be numbers - taken from the inode number of the file (a ls -i will show that).
If you're lucky, some of those numbered entries will be directories with their contents intact, complete with names. Usually that happens only if the filesystem damage was from something overwriting part of the device, not from uncontrolled shutdown unless the directory was newly created.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.