Is it possible to hide lost+found?

27,956

Solution 1

Create a subdirectory in that filesystem and share/symlink that instead of the filesystem root directory.

It's a bad idea to remove the lost+found directory. When recovering, fsck needs an existing multi-sector directory in which to create directory entries for lost files. If there is no lost+found directory, then it has to create one, potentially overwriting data.

Solution 2

For Gnome2/Mate Nautilus/Caja based desktops, create a file called .hidden in the root folder of the drive.

Edit the contents to read:

lost+found

Nautilus will now hide the lost+found folder if you refresh. Press 'ctrl-h' to toggle the hidden items visible/invisible.

Solution 3

$ ls --ignore=lost+found

So make that an alias

$ alias ls='ls --ignore=lost+found'

With the updated ls that is part of GNU coreutils 8.15

re: http://www.askapache.com/linux-unix/bash_profile-functions-advanced-shell.html

Solution 4

Nautilus (and Konq?) will interpret a .hidden file in a directory as a list of files to hide. Otherwise, as others have suggested, use XFS or ReiserFS.

Solution 5

No. But you can delete it (it'll be recreated at the next fsck), or you can use a different file system which doesn't need a lost+found. ext2/3 does.

Share:
27,956

Related videos on Youtube

jldugger
Author by

jldugger

DevOps Engineer

Updated on September 17, 2022

Comments

  • jldugger
    jldugger over 1 year

    Given a partition intended solely for storing music, video and so-on, is it possible to hide the lost+found directory?

  • BobbyShaftoe
    BobbyShaftoe almost 15 years
    Yeah, but you could have a script that deletes it after fsck runs. I don't really know what the point of this would be though.
  • Naveed Abbas
    Naveed Abbas almost 15 years
    Any sources on that?
  • Steve Townsend
    Steve Townsend almost 15 years
    By "sources on that" I assume you mean references? It's not mentioned in any manpages that I can find, but it's mentioned here (thanks, Google): aplawrence.com/SCOFAQ/FAQ_scotec1fsck_lostfound.html
  • Tonny
    Tonny over 12 years
    Real bad idea to remove it. FSCK will recreate, but as said above potentially causing more damage.
  • kasperd
    kasperd about 9 years
    Strictly speaking it is only the fsck command, which need the lost+found directory. The file system itself doesn't need it. I couldn't find any mention of the lost+found directory within the file system source code. From the file system's point of view, it is no different from all other directories.
  • Manu Järvinen
    Manu Järvinen about 9 years
    Too bad this doesn't seem to work for KDE's Dolphin or even Thunar. However, Thunar hides lost+found by default since it's a system folder, it seems
  • kasperd
    kasperd over 8 years
    @ManuJärvinen What is system folder supposed to mean? As far as the kernel is concerned lost+found is an ordinary directory just like any other directory. It is only fsck which has a need for this specific directory name. Any other tool treating that name special only does so to match the convention used by fsck.
  • emvidi
    emvidi about 2 years
    works on Thunar, thks
  • Pawel Cioch
    Pawel Cioch about 2 years
    The best answer