Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: extra Lost+Found folder (NOT the one in / directory)

  1. #1
    Join Date
    Aug 2011
    Beans
    18

    Arrow extra Lost+Found folder (NOT the one in / directory)

    I've done a search here and on google and can't seem to find the answer.

    Background:

    I have a separate partition that is mounted in /home via the fstab under a custom folder name. We'll call it the "store" folder, and it automounts during every startup. Now I use this folder for storage only. I don't have any programs or scripts run from this folder. It's owned by me of course, the user.

    Problem:

    Every time I delete or move a file from within this directory a Lost+Found folder is created. I find this extremely annoying as I already have one under /. I'm not looking to "hide" it because that's not solving my problem. Furthermore, the .Trash-1000 folder appears too when something is deleted or moved. I don't need these folders. They already exist under the user name's home folder.

    When I do remove both the Lost+Found folder and .Trash-1000 folder from /home/store they reappear after doing what I described above.

    What can I do to permanently stop these folders from being "auto-created"? (for lack of a better term)


    Just for clarification
    So the directory looks like this:

    /home

    store/
    john/

    (while inside /home)

    $ ls -lsha

    4.0K drwxr-xr-x 20 user user 4.0K 2012-07-24 07:14 store
    4.0K drwxr-xr-x 41 user user 4.0K 2012-07-24 12:00 john

  2. #2
    Join Date
    Jul 2008
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: extra Lost+Found folder (NOT the one in / directory)

    Quote Originally Posted by jatwood View Post
    I've done a search here and on google and can't seem to find the answer.

    Background:

    I have a separate partition that is mounted in /home via the fstab under a custom folder name. We'll call it the "store" folder, and it automounts during every startup. Now I use this folder for storage only. I don't have any programs or scripts run from this folder. It's owned by me of course, the user.

    Problem:

    Every time I delete or move a file from within this directory a Lost+Found folder is created. I find this extremely annoying as I already have one under /. I'm not looking to "hide" it because that's not solving my problem. Furthermore, the .Trash-1000 folder appears too when something is deleted or moved. I don't need these folders. They already exist under the user name's home folder.

    When I do remove both the Lost+Found folder and .Trash-1000 folder from /home/store they reappear after doing what I described above.

    What can I do to permanently stop these folders from being "auto-created"? (for lack of a better term)


    Just for clarification
    So the directory looks like this:

    /home

    store/
    john/

    (while inside /home)

    $ ls -lsha

    4.0K drwxr-xr-x 20 user user 4.0K 2012-07-24 07:14 store
    4.0K drwxr-xr-x 41 user user 4.0K 2012-07-24 12:00 john
    There is a lost+found directory in the root of any partition. It's part of the file recovery system. It will be recreated if you delete it. See here.

    The .Trash-1000 folder is also at the root of a partition. It is created by Nautilus. This will also be recreated if you Nautilus.

  3. #3
    Join Date
    Jan 2006
    Location
    Sunny Southend-on-Sea
    Beans
    5,686
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: extra Lost+Found folder (NOT the one in / directory)

    Quote Originally Posted by jatwood View Post
    I don't need these folders. They already exist under the user name's home folder.
    Not true. The folders you're thinking of are on a different partition. Copying data to a different partition when you delete something would be stupidly pointless; what actually happens is that the location pointer gets changed to indicate that the file is considered to be in the Trash. Nice and cheap and quick, and almost nothing needs to be written.

    Just stick Lost+Found in a text file at the base of that partition called .hidden and forget about it. And don't send things on that partition to the Trash.
    None but ourselves can free our minds

  4. #4
    Join Date
    Aug 2011
    Beans
    18

    Re: extra Lost+Found folder (NOT the one in / directory)

    Quote Originally Posted by redmk2
    There is a lost+found directory in the root of any partition.
    What about USB thumb drives or external HD? I don't see lost+found folders on them. The same should apply to a separate partition. Also, I don't see how there is a "root" directory under this partition or any other like an external HD or USB. It's a device and should be mounted as such.


    Quote Originally Posted by CatKiller View Post
    ...hidden and forget about it. And don't send things on that partition to the Trash.
    That's an awkward workaround don't you think? So I can't delete anything on that partition unless I use a bash command like rm.

    My guess is that this has something to do with fstab or nautilus.

  5. #5
    Join Date
    Jan 2006
    Location
    Sunny Southend-on-Sea
    Beans
    5,686
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: extra Lost+Found folder (NOT the one in / directory)

    Quote Originally Posted by jatwood View Post
    What about USB thumb drives or external HD? I don't see lost+found folders on them. The same should apply to a separate partition.
    I don't think removable drives get fsck'd, and so a lost+found directory would never be used, AIUI, but I could be wrong. And I guess one would have to be created if you ran a manual fsck on a removable drive.

    You definitely get .Trash directories on removable drives if you send something to the Trash from them, though.

    Also, I don't see how there is a "root" directory under this partition or any other like an external HD or USB. It's a device and should be mounted as such.
    That's because you aren't thinking about it. A partition gets mounted to a mount point. That directory is the root directory of the mounted partition. If you mounted that partition somewhere else, the files you'd created in that root directory would appear at the new mount point.

    Your main partition is mounted at /, which is why / is often called the root directory, although then people get confused with /root, which is the user root's Home directory.

    Your idea of "mounting a partition as a device" would be doing file operations on /dev/sda2, which would be stupid. Partitions are mounted into the filesystem hierarchy to serve a particular purpose.

    That's an awkward workaround don't you think? So I can't delete anything on that partition unless I use a bash command like rm.

    My guess is that this has something to do with fstab or nautilus.
    No, you can delete things. You just can't send them to Trash, since that will cause a Trash folder to be created to hold them (obviously).

    It's Nautilus that creates the Trash folder when you implicitly tell it to. I'm not sure what creates the Lost+Found directory.

    Hide them, forget about them and stop fiddling with them is my advice, but you know that already.
    None but ourselves can free our minds

  6. #6
    Join Date
    Jul 2008
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: extra Lost+Found folder (NOT the one in / directory)

    Quote Originally Posted by jatwood View Post
    What about USB thumb drives or external HD? I don't see lost+found folders on them. The same should apply to a separate partition. Also, I don't see how there is a "root" directory under this partition or any other like an external HD or USB. It's a device and should be mounted as such.
    The lost+found directory is a consequence of fsck. It is recreated every time the fsck command is run. Although there is both a fsck.vfat and a fsck.ntfs I can't tell you they make a lost+found directory. The command fsck for EXT2/3/4 certainly does.

    It's the 'root of the partition" on a "root" directory. Yes there is a .Trash-1000 folder created when you use Nautilus on any partition. Here is file listing of one of my USB sticks mounted at /media/STICK
    Code:
    /media/STICK$ ls -la
    total 9
    drwx------ 1 red red 4096 2012-07-24 12:32 .
    drwxr-xr-x 4 root  root  4096 2012-07-24 12:32 ..
    -rwxrwxrwx 1 red red   19 2012-07-11 09:57 test.doc
    -rwxrwxrwx 1 red red    0 2012-07-24 12:32 testing
    drwx------ 1 red red    0 2012-07-11 09:44 .Trash-1000
    ...As you can see the .Trash-1000 directory is hidden.
    That's an awkward workaround don't you think? So I can't delete anything on that partition unless I use a bash command like rm.
    Speaking for myself, it's not a workaround at all. You can delete the files with Nautilus.
    My guess is that this has something to do with fstab or nautilus.
    Nothing to do with fstab. Nautilus creates the .Trash directory. I have a script that I run that cleans out the .Trash files on the various partition I have.


    Edit: Now you have the same answer twice
    Last edited by redmk2; July 24th, 2012 at 08:53 PM.

  7. #7
    Join Date
    Aug 2011
    Beans
    18

    Re: extra Lost+Found folder (NOT the one in / directory)

    Quote Originally Posted by CatKiller View Post
    ...
    Your idea of "mounting a partition as a device" would be doing file operations on /dev/sda2, which would be stupid.
    Could you elaborate on that? Calling it stupid doesn't really help or give a deeper explanation.

    Quote Originally Posted by CatKiller View Post
    ...Partitions are mounted into the filesystem hierarchy to serve a particular purpose...
    In this case, I simply store my files here instead of the user's /home folder. The main logic behind this is that I have a bunch of directories in my storage folder and I don't want them to be in the same directory as the /home/user folder. There are already a bunch of extraneous folders that ubuntu puts in the /home/user directory such Pictures, Documents, etc.--I don't want any intermixing of those directories. That's why I've chosen to put my files on a separate partition.

    I also don't want to simply "hide" this folder or the trash folder. I indicated this in my original post.

    Quote Originally Posted by CatKiller View Post
    ...No, you can delete things. You just can't send them to Trash...
    That's the same thing. Yes, I know that the trash serves as a temporary place for deleted files. Who goes around deleting files without nautilus or a window manager though? I want to delete my files or move them, or do whatever I want without all these extra folders being created. I don't think that's unreasonable or impossible thing to ask for in a partition. If it were a partition that were mounted at / then I could understand because / has it's own Lost+Found in it, but my storage partition is not mounted at that level. It's mounted under the home folder.

  8. #8
    Join Date
    Jan 2006
    Location
    Sunny Southend-on-Sea
    Beans
    5,686
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: extra Lost+Found folder (NOT the one in / directory)

    Quote Originally Posted by jatwood View Post
    Could you elaborate on that? Calling it stupid doesn't really help or give a deeper explanation.
    Imagine if Windows had only drive letters, and every time you used a different machine (and occasionally on a re-boot) the letters were different. Like that.

    I also don't want to simply "hide" this folder or the trash folder. I indicated this in my original post.
    Yes, you did. It doesn't stop it being the sensible option. If fsck never finds any corrupted data and you don't move anything to the Trash, they'll never have anything in so why does it matter if they're there but hidden? (This is a rhetorical question; I don't actually care why you care)

    That's the same thing.
    No, it really isn't.
    Last edited by CatKiller; July 25th, 2012 at 02:48 AM.
    None but ourselves can free our minds

  9. #9
    Join Date
    Jan 2006
    Location
    Sunny Southend-on-Sea
    Beans
    5,686
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: extra Lost+Found folder (NOT the one in / directory)

    Quote Originally Posted by jatwood View Post
    In this case, I simply store my files here instead of the user's /home folder. The main logic behind this is that I have a bunch of directories in my storage folder and I don't want them to be in the same directory as the /home/user folder. There are already a bunch of extraneous folders that ubuntu puts in the /home/user directory such Pictures, Documents, etc.--I don't want any intermixing of those directories. That's why I've chosen to put my files on a separate partition.

    I also don't want to simply "hide" this folder or the trash folder. I indicated this in my original post.
    I have thought of another solution, although it does have it's limitations so you might not like it.

    So far we have:

    • Simply hiding the directories that you don't want to see, which is quick & easy.
    • Allowing the directories that you don't want to see to be created and automatically deleting them. redmk2 has said that he does this. A crude method would be something like a cron job to delete them (if they exist) at specified times. A more elegant method would be to use something like DBus notifications to only delete them when they are created, rather than running a script that does nothing most of the time. If you're going to nuke your Trash file from orbit anyway, though, you might as well just delete things rather than moving them to Trash in the first place. IMO.
    • The new idea I had, which is to mount your partition somewhere else (/mnt/something would be the usual place) and then symlink the directories in that partition to directories in your Home folder. The advantages are that you don't need to see or otherwise fiddle with the directories that bother you so much, whilst still having them exist for the Trash folder and fsck functionality. The disadvantage is that you'd need to make new symlinks whenever you created a new directory in the root directory of that partition that you also wanted in your Home folder. That might take about 3 seconds, if you're slow.

    Just a thought.
    None but ourselves can free our minds

  10. #10
    Join Date
    Jan 2006
    Location
    Sunny Southend-on-Sea
    Beans
    5,686
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: extra Lost+Found folder (NOT the one in / directory)

    Quote Originally Posted by jatwood View Post
    What about USB thumb drives or external HD? I don't see lost+found folders on them. The same should apply to a separate partition. Also, I don't see how there is a "root" directory under this partition or any other like an external HD or USB. It's a device and should be mounted as such.
    I'm not sure that you've really got the hang of the filesystem hierarchy. I'll contrast it with Windows because the chances are that you're at least somewhat familiar with the way that behaves.

    When you have multiple partitions in Windows, they each get a different drive letter. That is, one partition might be mounted at C: and another might be mounted at D:. The root directory of each of those partitions would be C:\ and D:\, respectively. The root directory of a partition is the one that contains everything else, be that files or sub-directories.

    Let's imagine that you're using Windows and your C: partition is getting a bit full, so you want to use another partition to hold your documents and settings. You're scuppered, though, because everything want to save in C:\Docume~1\ rather than D:\whatever.

    Let's also imagine that Windows wasn't made by Microsoft and so your choice of filesystem format wasn't simply between the old-and-rubbish-filesystem and the really-old-and-really-rubbish filesystem. You might instead have an option of a filesystem that's blindingly fast with a very large number of small files (say, dynamically-generated web pages) or with some insulation against sudden power loss. Or perhaps there's a server somewhere that has information you'd like to use, but when that wasn't available you'd like to use a local drive instead. With Windows you need to have a drive letter for each partition and you don't really get to pick which filesystem gets used for each task because everything assumes you want it to write to C:. And you didn't even get to choose which partition got which letter for two decades.

    You still end up with directories getting created automatically on each partition (System Volume Information and Recycle Bin are the ones that I remember) because to do otherwise would be madness, but you don't get to delete them from within Windows. To see why it's not a good idea, imagine that you have a small C: drive and a large D: drive that contains large files. You "delete" a large file from the D: drive - the Ubuntu DVD iso, say. Since D: has no Recycle Bin, because there's only the one Recycle Bin and that's on C:, the file has to be copied from one partition to another, which takes some amount of time, then actually deleted from D:. You've now wasted some non-zero period and processor cycles (copies between partitions have been notoriously bad in Windows) and taken up precious space on your small C: drive, that every program wants to write to, for a file that you don't even want any more. And if you do decide that you want it after all you have to go through the whole process again.

    The UNIX-like method is to have a unified filesystem hierarchy; there are no drive letters because everything is mounted somewhere under /. Directories are arranged by function. Any directory within the hierarchy can be a mount point for any filesystem. So if, say, you had a teeny-tiny SSD which is perfect for fast access to files that don't change very often then you might choose to mount that at /boot. If you had a large hard drive you might put your /home on it. You might want your /var/www to be a different filesystem to the rest of the machine. If you wanted to have some kind of thin client, you might have /usr and /var on a network machine. And so on. It's all very flexible.
    None but ourselves can free our minds

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

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