免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3422 | 回复: 7
打印 上一主题 下一主题

新手关于 data block & sector 的区别 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-03-15 22:20 |只看该作者 |倒序浏览
我在看书的时候发现三点 让我感觉挺挺矛盾的 ():

1. 小于96k的文件将使用 fragementation 存储;
2 一个data block 一般是由 8个 1024bytes的fragement 存成.
3.ufs system 不允许在两个不同的data blocks 中存储同一个文件.

  我就想到 如果一个文件  刚好是 12k bytes的文件, 一个block 不够,两个blocks 不满的情况. 但是按照前面1点的说法 必须使用fragementation 存储  但是又不满足 第 3 点的 的要求了 ...
  
    我实在想不好,哪位有空给咱答疑解惑一下 谢谢

论坛徽章:
0
2 [报告]
发表于 2007-03-15 22:38 |只看该作者
3.ufs system 不允许在两个不同的data blocks 中存储同一个文件.
The above statement is wrong. It should be:
ufs system 不允许在两个不同的data blocks 的 fragementation 中存储同一个文件

[ 本帖最后由 briangao 于 2007-3-15 09:39 编辑 ]

论坛徽章:
0
3 [报告]
发表于 2007-03-15 22:54 |只看该作者
楼上说意思是: 一个文件A    放在 两个不同的datablock 的fragementation    是不允许的.
但是一个小于 96k的文件B 可以垮 datablock 的存储``` 储满一个datablock ,剩下的数据再往另外的datablock里面放,,直到file B 的数据存储完毕... 是这样吗?~`

论坛徽章:
0
4 [报告]
发表于 2007-03-15 23:02 |只看该作者
楼上说意思是: 一个文件A    放在 两个不同的datablock 的fragementation    是不允许的.
但是一个小于 96k的文件B 可以垮 datablock 的存储``` 储满一个datablock ,剩下的数据再往另外的datablock里面放,,直到file B 的数据存储完毕... 是这样吗?~`

That is correct.

For example, you have a file which is 18K (=8K+8K+2K), it will storage the first 8K in datablock 1, the next 8K in datablock 2 and the last 2K in two fragements in datablock 3.

I don't know where your 96K limitation is coming from. Files larger than 96K is storaged the same way.

论坛徽章:
0
5 [报告]
发表于 2007-03-15 23:09 |只看该作者
Files larger than 96K  的限制 是出自 pdf文档 <solaris 10 中级系统管理  > 的第p184
原文如下:
' Fragmentation is the method used by the ufs file system to allocate disk space efficiently. Files less than 96 Kbytes in size are stored using fragmentation '

论坛徽章:
0
6 [报告]
发表于 2007-03-16 00:27 |只看该作者
Files larger than 96K  的限制 是出自 pdf文档 <solaris 10 中级系统管理  > 的第p184
原文如下:
' Fragmentation is the method used by the ufs file system to allocate disk space efficiently. Files less than 96 Kbytes in size are stored using fragmentation '

The book messed it up. It is an error. The 96KB is coming from 12 direct pointers (12x8KB = 96KB). When a file is smaller than 96KB, inode uses only direct pointers to access the data blocks, thus very fast.  However, the fragmentation has NOTHING to do with 96KB. So the sentence should be corrected to:

Fragmentation is the method used by the ufs file system to allocate disk space efficiently. Files less than 8 Kbytes in size are stored using fragmentation.

论坛徽章:
0
7 [报告]
发表于 2007-03-16 10:41 |只看该作者
原帖由 tzpi2000 于 2007-3-15 22:20 发表
我在看书的时候发现三点 让我感觉挺挺矛盾的 ():

1. 小于96k的文件将使用 fragementation 存储;
2 一个data block 一般是由 8个 1024bytes的fragement 存成.
3.ufs system 不允许在两个不同的data blocks 中 ...


是说通常,小于1K的文件,将使用fragementation存储。

论坛徽章:
0
8 [报告]
发表于 2007-03-17 12:29 |只看该作者
If file 1 requires more space than is currently available in the shared
data block, then the entire contents of that expanding file are moved
by ufs into a free data block. This is a requirement of ufs to assure
that all the same file fragments are contained in a whole data block.
The ufs file system will not allow fragments of the same file to be
stored in two different data blocks.

我想这个是原文吧,出自SA238文档292页,这几天正好看到
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP