參考文献:

Harley Hahns:Guide to Unix and Linux。 Chap 24

——》首先要有的关键概念:the amount of "disk space" used by a file is not the same as the amount of data in the file.

——》其次,理解在file system和disk(or other storage medium)中都存在各自的最小空间单元:file system中叫“block”;disk中叫“allocation unit”。

这两个最小空间单元关系:The size of "allocation unit" depends on the filesystem and the storage device。

比方參考文献作者计算机中,filesystem的最小占用单元block为1K Bytes,而disk allocation units 为8K Bytes。所以,有一个文件含有1B的data,则在filesystem中占用1个block(1K),在disk中占用8K的disk
space

******************************************************************************

于是以下的问题:怎样detemine size of block? 怎样determine size of allocation unit?

——size of allocation units:

*先创建一个非常小的文件

*再用ls -l file查看这个文件含有的实际data有多少(Byte为单位)。显示在时间前面

*再用du -h file查看how much "disk space" the file takes up

这查出来的disk space就是你的disk中最小占用单元的大小。我的计算机上查出是4K

——size of block in filesystem:

思路是通过在管理员权限下用dumpe2fs命令查看在filesystem中存在的一个block:SUPERBLOCK的性质。查看它的Block size来确定在filesystem中一个block有多大

*先用df命令来find out the name of the special file that represents the filesystem, 如/dev/hda1

*再用su取得superuser的权限

*在superuser的权限在使用dumpe2fs,并用grep命令搜集“Block size”信息:dumpe2fs /dev/hda1 | grep "Block size"

这查出来的Block size就是在你的file system中一个block的最小占用空间,我的计算机上查出是1024

最新文章

  1. 笔记:程序内存管理 .bss .data .rodata .text stack heap
  2. .NET C# 将 mdb 中数据读为 list<string[]> 其中 path 为数据库地址 ,sql 为查询语句
  3. 在datagrid中实现单击行选择整行
  4. SQL Server合并版本
  5. javascript: return return false
  6. python中遇到的各种问题
  7. RFID第二次作业
  8. MySQL外键约束On Delete、On Update各取值的含义
  9. Python算术运算符
  10. 动态添加试题选项按钮 radioButton(一)
  11. Convert.ToInt32()和int.Parse()区别
  12. Error: spawn Unknown system errno 203
  13. AngularJS中监视Scope变量以及外部调用Scope方法
  14. BZOJ2208: [Jsoi2010]连通数(tarjan bitset floyd)
  15. "android.uid.systemandroid.view.InflateException: Binary XML file line #7: Error inflating class android.webkit.WebView
  16. Splay和LCT的复杂度分析
  17. eclipse 编码设置【转】
  18. iOS-沙盒路径
  19. 【算法笔记】B1029 旧键盘
  20. CALayer层的属性(转)

热门文章

  1. 启动Apache出现问题:一直停留在启动界面
  2. visual filters 滤镜 ie
  3. 远程调用服务框架-CXF(WebServic)
  4. 【OpenCV】通过ROI区域以及掩码实现图像叠加
  5. js判断对象为空 JSON.stringify(obj)
  6. 二:Maven中pom.xml元素详解
  7. android wear开发:为可穿戴设备创建一个通知 - Creating a Notification for Wearables
  8. linux kernel态下使用NEON对算法进行加速
  9. 2017年当下最值得你关注的前端开发框架,不知道你就OUT了!
  10. IdentityServer4(10)- 添加对外部认证的支持之QQ登录