删除丢失+找到的文件夹是否安全?

chr*_*lee 42 filesystem delete directory

我有一个空的单独分区用于我的 vhd/virtualbox。安装在/mount/win7.

我现在已经删除了所有内容,还剩下一个 lost+found 文件夹。它需要大约 5gigs

删除丢失和找到的文件夹是否安全?

Lnx*_*lck 43

如果丢失了,fsck 将重新创建 lost+found 目录。

在启动时,如果检测到文件系统没有被干净地卸载,大多数发行版都会运行 fsck。

由于 fsck 创建 lost+found 目录(如果丢失),它将创建它并将找到的任何内容放入该目录中。

所以你可以删除它但不推荐(根据 Marcelo 评论)。

  • 根据 serverfault ( https://serverfault.com/a/9909/486260 ) 中的这个答案,删除它不是一个好主意,因为在文件系统问题的情况下,当 fsck 在检查期间重新创建目录时,它可能覆盖其他可挽救的数据,因为它无法将孤立的 inode 绑定到目录条目。在文件系统检查期间,预先创建的 lost+found 目录为回收的文件保留目录条目 (4认同)

Gru*_*bel 18

到目前为止,我的印象是删除lost+found是完全安全的,因为它会在需要时由 fsck 重新创建。但是在 Ubuntu 12.10 升级之后,我从 cron 收到了这封邮件:

/etc/cron.daily/standard:

Some local file systems lack a lost+found directory. This means if the
file system is damaged and needs to be repaired, fsck will not have
anywhere to put stray files for recovery. You should consider creating
a lost+found directory with mklost+found(8).

The following lost+found directories were not available:

/home/lost+found
Run Code Online (Sandbox Code Playgroud)

的手册页mklost+found说:

mklost+found pre-allocates disk blocks to the lost+found directory
so that when e2fsck(8) is being run to recover a filesystem, it does 
not  need to allocate blocks in the filesystem to store a large number
of unlinked files.  This ensures that e2fsck will not have to allocate
data blocks in the filesystem during recovery.
Run Code Online (Sandbox Code Playgroud)

我不确定这到底是什么意思,但它似乎表明没有lost+found可能会导致恢复问题。此外,它表明lost+found与常规目录的不同之处在于它具有与其相关联的预分配块。