Find the answer to your Linux question:
Results 1 to 9 of 9
Sticking stuff in Lost+Found, and then deleting it (once I found a way via elevated rights/live CD), seemed to have resulted in all my directories and files (but not any ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Mar 2014
    Posts
    5

    Lost+Found folder confusing & a threat to Home?


    Sticking stuff in Lost+Found, and then deleting it (once I found a way via elevated rights/live CD), seemed to have resulted in all my directories and files (but not any hidden directories or files) being wiped from my Home directory.

    Inbetween i got a load of error messages about the file system being full - because apparently although lost+found appears next to the Home directory on that partition (I have a separate one) if showing hidden files is checked, it actually resides on the linux file system partition? (and has reserved blocks there or something weird?)

    Although there is a hint that the lost+found folder is special since you have to unlock permissions etc, there isn't really any warning sign that it's quite so unique and potentially damaging. Although it takes quite some stupidity to mess up as I did, it does undermine my trust in Linux, since people are supposed to have the freedom to mess around on it a bit, and shouldn't ever be a risk of losing all their personal files ever through the OS (unless manually editing configs or something or deleting without trash / confirming to do so), especially when on a separate partition.

    appendum: it's just possible something else caused the home files deletion. I had just been running photorec from the command line to check for some photos I couldn't find any more - that's what put the stuff into the lost+found folder even though I terminated it 'cos I hadn't meant it to do that en masse). When I got the file system full errors I had also tried run bleachbit. Linux Mint 13 (with 16 update), ext 4, standard recent Intel type laptop. Also a separate Windows NTFS partition.
    Last edited by curumba; 03-09-2014 at 02:45 PM.

  2. #2
    Linux Guru
    Join Date
    Dec 2013
    Location
    Victoria, B.C. Canada
    Posts
    1,658
    Lost+found is used to store files that have a inode but no associated file name - they may have been unlinked and are scheduled for deletion or may have been damaged after some form of crash. If there has been some corruption of your filesystem fsck will have created the directory and placed files in it you may want/be able to recover. If it is empty it means nothing has been found that was corrupted. You aren't meant to delete it but I've never heard of it causing problems.

    On the other hand I don't know where you heard you wouldn't be at risk of losing you files because of things you've done but it's just patently not true. Files removed using rm are gone. Not in some sort of temporary haven but gone. If you are inclined to accidently delete files I'd recommend scripting something to copy and delete files. Any file that has special permissions should never be touched unless you understand what you are doing. Like any computer system it is quite easy to render it unusable if you ignore this advice. UNIX and Linux is in many ways an experts system. You get to be an expert by using it but not by carelessly using it.

  3. #3
    Just Joined!
    Join Date
    Mar 2014
    Posts
    5
    Thanks for replying. I take your point about there always being risks in messing with system files, and it's true I had selected to view hidden files and thus could see the lost+found directory. And I did then set Photorec to stick a load of large files in there lol.

    However, Linux especially Mint is often billed as an alternative to Windows that's user-friendly but also gives more freedom to tweak - and instructions regarding the latter often entail choosing to show hidden files. And I didn't mean never risk of losing any files - of course that can be done - but risk of the entire user contents of home vanishing when nothing was done by the user to command it (I only deleted the files in lost+found that photorec had copied there).

    And the thing is, I did Google across someone else reporting they'd used lost+found to temporarily put files in. Because it kinda makes sense given the name of the directory (like 'trash' or 'wastebasket' which you are ok to use and people are familiar with), and because it appears to be right there next to the home directory. That person didn't have the same problem I did they just couldn't see the files then even though they were there (this happened to me too initially without elevated permissions).

    I did wonder about filing a bug report to try to help but I don't think I could be clear enough and perhaps it's too core to the Linux OS to be able to do anything about it. But I guess what I would suggest if I could - would be rename the goddam folder to something a bit more specific and less inviting, fsck-recovered or something...

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru
    Join Date
    Dec 2013
    Location
    Victoria, B.C. Canada
    Posts
    1,658
    That's not a bug - it's a user mistake. There would be no point to filing a bug report. The fix is - don't do that again.

    Linux gives you complete freedom to tweak - you can completely rewrite the kernel if you wish but that doesn't mean it is easy.

  6. #5
    Just Joined!
    Join Date
    Mar 2014
    Posts
    5
    I appreciate the comment. Though of course it goes without saying someone wouldn't do that again once it had happened. But it's not a bug for some system process associated with the lost+found directory to go off and delete all a users' files off a separate partition?

    For the record here is the link I mentioned to someone who installed Ubuntu and for some reason (presumably partly because if system files are unhidden it appears right there on the home directory) stored all their files in the lost+found folder, and then two months later is in a panic about seemingly not being able to retrieve them. (ok well search web for cannot-find-my-data-in-lostfound-folder-in-home-folder)

    While you may choose to simply take this as evidence of the stupidity of that and this particular human, it could also be taken as evidence that some percentage of the potential userbase of Linux will do things like this.

  7. #6
    Linux Guru
    Join Date
    Dec 2013
    Location
    Victoria, B.C. Canada
    Posts
    1,658
    Quote Originally Posted by curumba View Post
    I appreciate the comment. Though of course it goes without saying someone wouldn't do that again once it had happened. But it's not a bug for some system process associated with the lost+found directory to go off and delete all a users' files off a separate partition?
    If that was what happened I would think it a bug but I'm quite confident in saying it isn't what happened.

    Quote Originally Posted by curumba View Post
    For the record here is the link I mentioned to someone who installed Ubuntu and for some reason (presumably partly because if system files are unhidden it appears right there on the home directory) stored all their files in the lost+found folder, and then two months later is in a panic about seemingly not being able to retrieve them. (ok well search web for cannot-find-my-data-in-lostfound-folder-in-home-folder)

    While you may choose to simply take this as evidence of the stupidity of that and this particular human, it could also be taken as evidence that some percentage of the potential userbase of Linux will do things like this.
    I don't take it as evidence of stupidity at all - though I think it foolishness to presume that when something as complex as an OS builds into a protection mechanism someone overrides it without learning the purpose for the protection. There are lots of ways to learn and one valid one is to try things and see what happens. Doing it with a system that has data on it that you aren't prepared to lose is a mistake though. Another way to learn is to study the usage and possible effects of various parts of the system you are using. This is possible a slower way to learn but less likely to mean loss of data and more likely to result in correct understanding.

    Operating systems do there best to build protection systems into their systems but when it is your own system you need to be able to access system files from time to time. Linux isn't a toy - it's a commercial grade operating system most frequently used in server installations. If you are reading someone who is suggesting otherwise then read someone else. It can be a lot of fun to use and is n excellent desktop as well but don't expect it to hold your hand.

  8. #7
    Just Joined!
    Join Date
    Mar 2014
    Posts
    5
    [QUOTE=gregm;946088]If that was what happened I would think it a bug but I'm quite confident in saying it isn't what happened.

    Ok well that's interesting and thank you. It makes me wonder then if it was something to do with the file system partition filling up, triggering some kind of attempt to regain space. Or probably just something else I did in the midst of it all trying to regain space/restarting/getting mixed up with /root & /home (partition) & 'home' link (user directory). Anyway something did it without asking.

    [QUOTE=gregm;946088]I don't take it as evidence of stupidity at all - though I think it foolishness to presume that when something as complex as an OS builds into a protection mechanism someone overrides it without learning the purpose for the protection.

    As there's lots of protections in Linux that routinely have to be over-ridden with your password I guess it becomes a habit. But I accept the point that going behind the desktop into by-default-hdden system files is done at own risk.

  9. #8
    Linux Engineer docbop's Avatar
    Join Date
    Nov 2009
    Location
    Woodshed, CA
    Posts
    949
    In your first post your said... "(once I found a way via elevated rights/live CD)".

    You have to remember Unix was written in C programming language, I used to do C developer support and as we'd point out to new programmers. C is a language is like this... if you want to take a loaded shotgun, point it at your foot and pull the trigger it won't stop you. So in C you're responsible for the code you write, in Unix if you drop down to root level you're responsibe for every command you type.

    Feel lucky one new C developer called he wrote some sloppy pointer code and wiped out his entire hard drive in a couple seconds. Of course he want to blame the compiler I was supporting, but it was just his code that did him in.

  10. #9
    Just Joined!
    Join Date
    Mar 2014
    Posts
    5
    Quote Originally Posted by docbop View Post
    In your first post your said... "(once I found a way via elevated rights/live CD)".
    Well that's a good point - as I recall if I just opened lost+found as administrator the files wouldn't show, I had to use gksudo nautilus. But then although I could see them I couldn't delete them, they'd just pop back. But I read that it should be possible to delete them, so I figured the file system partition being full was stopping it being able to delete. I booted in from live CD and did delete them from there I think. I guess that could confuse a system when rebooted, shrug.

    Quote Originally Posted by docbop View Post
    Feel lucky one new C developer called he wrote some sloppy pointer code and wiped out his entire hard drive in a couple seconds. Of course he want to blame the compiler I was supporting, but it was just his code that did him in.
    Oops....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •