文件系统块大小的意义是什么?如果我的文件系统块大小设置为8K,是否意味着所有读/写I / O都将以8K大小发生?因此,如果我的应用程序想读取偏移量4097处的16个字节,那么将从偏移量4096开始的4K块将被读取?
在这种情况下,写工作如何?假设我要写64个字节。
最佳答案
你是对的。块大小是文件系统的工作单位。每次读取和写入均以块大小的整数倍完成。
块大小也是文件在磁盘上可以拥有的最小大小。如果块大小为16字节,则文件大小为16字节的文件将占据磁盘上的整个块。
书"Practical file system design"指出:
Block: The smallest unit writable by a disk or file system. Everything a file system does is composed of operations done on blocks. A file system block is always the same size as or larger (in integer multiples) than the disk block size.
关于filesystems - 文件系统 block 大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8537579/