Ubuntu服务器ext4达到65000子目录限制

我有一个Ubuntu 14.04服务器,无法在65,000目录之外创建一个新目录.我运行了tune2fs -l,可以看到dir_nlink标志已设置.有谁知道还有什么可以检查以允许这种情况发生?我有许多其他克隆的服务器配置都超过65,000标记,并按预期工作.我比较了tune2fs -l输出,它们看起来是一样的.我还有几百万个免费的inode和块.我已卸载并重新安装文件系统,没有任何更改.
Ext4目录限制

Ext4 supports two kinds of directories

>传统的几乎线性目录
>基于哈希的目录

线性目录具有65000个链接的限制,即大约可以使用许多子目录.基于哈希的目录没有限制.

创建新文件系统时,认为哈希目录.如果您的目录仍然是线性的,可能是因为您升级了旧的ext3分区. (Ext3稍后获得了基于哈希的目录功能.)

测试目录是近似线性还是基于散列

$sudo debugfs /dev/partition
$htree /
htree: Not a hash-indexed directory

转变

>卸载分区
>启用dir_index(基于哈希的dirs)和dir_nlink(无限链接)功能.

sudo tune2fs -O dir_index,dir_nlink /dev/partition

所有新创建的目录现在都能够保存无限的子目录.

如果要转换现有目录,请执行以下操作:

>卸载分区(防止数据丢失很重要)
>告诉fsck重建目录索引:

sudo e2fsck -f -D /dev/partition

-f强制fsck检查磁盘,即使磁盘处于干净状态

-D告诉e2fsck重建索引:

This option causes e2fsck to try to optimize all directories,either by reindexing them if the filesystem supports directory indexing,or by sorting and compressing directories for smaller directories,or for filesystems using Traditional linear directories.

相关文章

目录前言一、创建Hadoop用户二、更新apt和安装Vim编辑器三、...
原文连接:https://www.cnblogs.com/yasmi/p/5192694.html ...
电脑重启后,打开VirtualBox,发现一直用的虚拟机莫名的消失...
参见:https://blog.csdn.net/weixin_38883338/article/deta...
Ubuntu 18.04 LTS 已切换到 Netplan 来配置网络接口。Netpla...
介绍每个 Web 服务都可以通过特定的 URL 在 Internet 上访问...