Linux文件系统架构

时间:2014-02-16 08:45:16

标签: linux linux-kernel linux-device-driver

我需要一些关于Linux“FileSystem”架构和设计模式的很好的参考资料。请参考文章或一些文档,如“如何撰写文章”。我想从头开始构建类似(ext3 / ext4 / btrfs等)的FileSystem。

1 个答案:

答案 0 :(得分:2)

您可以通过FUSE(用户空间中的文件系统)实现自己的文件系统。这种方式相对简单,因为您不需要实现内核模块。

您可以找到示例代码here。这是一个“哑”文件系统,在安装时,将包含一个带有(硬编码)内容“Hello World!”的文件。不过,这是一个很好的起点。

您可以按如下方式使用它(来自主项目页面):

~/fuse/example$ mkdir /tmp/fuse
~/fuse/example$ ./hello /tmp/fuse
~/fuse/example$ ls -l /tmp/fuse
total 0
-r--r--r--  1 root root 13 Jan  1  1970 hello
~/fuse/example$ cat /tmp/fuse/hello
Hello World!
~/fuse/example$ fusermount -u /tmp/fuse
~/fuse/example$
相关问题