2014-02-16 159 views
0

我需要一些关于Linux“FileSystem”体系结构和设计模式的很好的参考资料。请参考文章或“how to articles”等文档。我想从零开始构建FileSystem(ext3/ext4/btrfs等)。Linux文件系统体系结构

回答

2

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

你可以找到示例代码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$ 
+0

谢谢你,可是你知道内核模块?可以添加到一些Linux Distro的东西? – Sensor