文件系统块大小 [英] File system block size

查看:200
本文介绍了文件系统块大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

文件系统块大小的意义是什么?如果我的文件系统块大小被设置为8K,这是否意味着所有的读/写I / O都会发生在8K的大小?所以如果我的应用程序想要读取偏移4097处的16个字节,那么从偏移量4096开始的4K块将被读取?

在这种情况下写入是如何工作的?假设我想写64字节。 解决方案

你是对的。块大小是文件系统的工作单元。每个读写都以块大小的整数倍完成。

块大小也是文件可以具有的最小磁盘大小。如果你有一个16字节的块大小,那么一个16字节大小的文件占用磁盘上的一个完整的块。

这本书Practical file system design指出:


块:可由磁盘或文件系统写入的最小单位。
文件系统所做的每件事都是由在块上完成的操作组成的。一个文件系统
块的大小总是和
磁盘块的大小相同或者更大(以整数倍数为单位)。



What is the significance of the file system block size? If my Filesystem block size is set at say 8K does that mean that all read/write I/O will happen at size 8K? So if my application wants to read say 16 bytes at offset 4097 then a 4K block starting from offset 4096 will be read?

How do writes work in this case? Suppose I want to write say 64 bytes.

解决方案

You are right. The block size is the unit of work for the file system. Every read and write is done in full multiples of the block size.

The block size is also the smallest size on disk a file can have. If you have a 16 byte Block size,then a file with 16 bytes size occupies a full block on disk.

The book "Practical file system design" states:

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.

这篇关于文件系统块大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆