一封有趣的邮件列表
2010-04-25 11:19
211 查看
Hi, ext3 can have only 32000 files/folders under a folder and I hit that limit. Which file system can I use to over come it? I am planning for JFS Does anybody has any recommendations? Thanks --Siju
我的第一反应是使用ext4文档系统。 正如Siju George <sgeorge.ml@gmail.com
> :(该问题的提出者)一样, 我也没有考虑这个问题是否正确。
可能他也是看了某些书, 然后提了这个问题:目录里面最多能建立32000 个文件/文件夹(直译)。
然后, 邮件列表里面的讨论很热闹。
比如:
ext4 is unlimited. http://en.wikipedia.org/wiki/Ext4 is wrong in the section "Break 32,000 subdirectory limit". SOmeone should correct it, because https://ext4.wiki.kernel.org/ind ... rectory_scalability clearly tells " Ext4 breaks that limit and allows unlimited number of sub directories". There is also an ext3 -> ext4 howto in the same page I gave above.
还有一个人使用用perl和bash测试了一下, 以显示 一个目录(文件夹)下面可以有无**的文件,
There is no such limit. ext3 can handle as many files per folder as you've got space for. $ mkdir /tmp/foo $ cd /tmp/foo $ perl -e 'for ($i=0; $i<50000; ++$i) { open(F, ">$i"); close(F); }' $ ls | wc -l 50000 $ mount | grep md1 /dev/md1 on / type ext3 (rw,errors=remount-ro) $ mount | grep /tmp $ cd $ rm -rf /tmp/foo
我不懂perl
,于是就用bash写了一个小脚本测试一下:
1 #/bin/bash 2 i=0; j=0 3 while [ $i -le 50000 ] 4 do 5 mkdir dir$i 6 i=$[$i + 1] 7 8 done 9 10 while [ $j -le 50000 ] 11 do 12 touch file$j 13 j=$[$j + 1] 14 15 done ~
chmod 711 test.sh ./test.sh
标准输出上是(slice):
mkdir: 无法创建目录 “dir49991”: 过多的连接
.
.
.
mkdir: 无法创建目录 “dir50000”: 过多的连接
wolf@debian:/tmp/tmp$ ls dir* | wc 63995 31998 340867 wolf@debian:/tmp/tmp$ ls file* | wc 50001 50001 488900
注意到, 第二个数值
时间比较的长,众所周知, bash脚本的执行速度是很慢,更何况是50000(达不到,呵呵) + 50000个操作。
事实证明了, 一个目录下面可以建立无穷个file(s), 但是目录不会超过32000(包含本目录, 和对父目录的链接,可建立的只有31998)
至于ext4,可以参考**上面的资料
:摘取片段如下:
Break 32,000 subdirectory limit In ext3 the number of subdirectories that a directory can contain is limited to 32,000. This limit has been raised to 64,000 in ext4, and with the "dir_nlink" feature it can go beyond this (although it will stop increasing the link count on the parent). To allow for continued performance given the possibility of much larger directories, Htree indexes (a specialized version of a B-tree) are turned on by default in ext4. This feature is implemented in Linux kernel 2.6.23. Htree is also available in ext3 when the dir_index feature is enabled.
http://en.wikipedia.org/wiki/Ext4
#参考wikipedia, debian用户组邮件列表
相关文章推荐
- 一个很有趣的问题:那些用QQ邮箱发应聘邮件的人啊(附:怎样写一封得体的电子邮件)
- VIM邮件列表移到Google Group!
- Nutch 0.8最近更新的邮件列表
- 用python发一封邮件
- 如何写一封稍微像样的求职邮件
- 最近收到了一封国际诈骗邮件
- Dojo interest邮件列表八月Q&A精选
- 著名的邮件列表存档网站(Famous Mailing lists archive sites)
- 中国机器学习邮件列表
- (go邮件列表问题记录2)
- 其实邮件列表网站还是值得一做的
- C#实现按数据库邮件列表发送邮件的方法
- Python里有趣的列表解析和生成器表达式
- 邮件组织维护的列表
- python-cn(华蟒用户组,CPyUG 邮件列表)
- 免费的C/C++学习邮件列表终究靠不住,内容都没有了
- 邮箱遭到邮件列表攻击
- Linux内核中文邮件列表的一个讨论
- C# 使用TcpClient 获取邮件列表
- Linux内核邮件列表发送和回复格式研究