是否有ext2 / ext3 / ext4文件系统的官方规范? [英] Is there an official specification for the ext2/ext3/ext4 filesystems?

查看:290
本文介绍了是否有ext2 / ext3 / ext4文件系统的官方规范?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道,对于蓝牙,我们有IEEE 802.15.1标准,由蓝牙特别兴趣小组管理。对于Wifi,我们有IEEE 802.11标准,也有Wifi联盟。对于PCIe上的NVMe固态硬盘,我们有nvmexpress来管理和发布它的官方文档。所以,通常有一个管理机构来决定事情,并标准化一些事情应该是允许几个不同的实现之间的互操作性。但是对于ext2 / ext3 / ext4文件系统,除了Linux内核代码,我没有找到任何官方标准。



这些文件系统是否基本由内核社区规定?他们是否承诺不改变他们,所以它仍然会与其他操作系统兼容?

或者有什么地方的官方说明?和谁提供的?

谢谢

解决方案

系统通过标准委员会进行标准化。实际上,不打破兼容性的承诺是因为我们需要保持与旧版本Linux的向后兼容性。 MacOS,Windows等也是如此。使用MacOS 10.1编写的文件系统无法被MacOS 10.3等读取时,用户会变得胡思乱想。



在ext4的情况下,我们在超级块中有特征位掩码。当我们添加一个新功能时,我们在三个功能位掩码中的一个中定义一个新位:compat,r /​​ o compat,incompat。如果内核在r / o compat位掩码中看到了一些它不知道的信息,现在它将允许文件系统以读/写的方式挂载,但是它将允许它以只读方式挂载文件系统。如果内核在incommat bitmask中看到了一些它不能理解的内容,那么它将不允许文件系统被挂载。如果在compat文件系统中有一些内核不理解的话,那么内核就会知道安装文件系统是安全的。但是,文件系统一致性检查程序(e2fsck)和某些其他文件系统实用程序(例如resize2fs)可能需要更严格的兼容性检查,因此它们不会尝试对具有某些compat功能的文件系统进行更改它不理解。



实际上,当我们添加一个新功能时,我们需要等待一段时间才会启用mke2fs实用程序。这允许更多冒险的用户在我们为每个人默认启用之前测试文件系统功能。在实践中,其他操作系统只实现ext4特性的一小部分 - 最常见的是ext2 / ext3 / ext4的非Linux实现大致对应于通过 mke2fs -t ext2 / dev / disk。

这些功能自从几乎四分之一世纪以来首次实现以来一直没有改变。而且他们也不会改变,原因很明显,仍然有很多企业仍在使用RHEL 5,而RHEL 5使用十年前发布的内核,我们关心的是向后兼容自己以及其他操作系统。所以你可以看看Ext2的设计和实现( http:// web .mit.edu / tytso / www / linux / ext2intro.html ),发表于1994年,至于基础知识,他们并没有改变。
$ b $当然,我们还在增加新的功能 - 例如,最近我们增加了文件系统级别的加密(在Android中很快使用,希望是Chrome OS),项目配额和元数据校验和等等。到ext4。这些新功能中的每一个都受到功能标志的保护,并且在e2fsprogs源代码发行版中分发的当前版本的mke2fs中,所有这些功能都未默认启用。一些社区发行版(如Debian)可能会启用某些出血性功能,例如元数据校验和,以便在所有人(包括企业Linux发行版的更保守的企业用户)启用之前,获得更多的曝光和测试。 p>

当然,其他操作系统不会支持这些最新的出血功能。但是没关系,因为你也可以使用mke2fs -t ext2来创建一个文件系统,这个文件系统将更为基础,而且应该很容易地用于互操作性。一般来说,人们将使用具有高级功能的文件系统作为本地使用,以及具有关闭所有高级功能以进行交换的非常基本的文件系统。这就是为什么许多U盘使用FAT ---因为Linux,Windows和MacOS可以读取FAT文件系统而不需要任何特殊的处理。另外一种可能是最新的版本的e2fsprogs附带一个名为fuse2fs的ext4的用户空间文件系统实现。对于支持FUSE(包括大多数BSD系统以及MacOS)的操作系统,这可以是读取ext4文件系统的一种方便的方式。它不会是一个高性能的读/写实现,而是一个只想从ext4文件系统映像中获取数据的人,fuse2fs工作得很好。


I was wondering, for Bluetooth we have IEEE 802.15.1 standard, managed by Bluetooth Special Interest Group. For Wifi we have the IEEE 802.11 standards and also the Wifi Alliance. For NVMe SSDs on PCIe we have nvmexpress that regulate and publish its official documentation.

So, usually there is a regulatory agency who decides things and standardize how some things should be to allow interoperability between several different implementations.

But for the ext2/ext3/ext4 filesystems I didn't find any official standard besides the Linux Kernel code.

Are these filesystems basically dictated by the kernel community? And do they commit to not change them so it will still be compatible with other operating systems?

Or is there some official specification somewhere? And who provides it?

Thank you

解决方案

Very few file systems are standardized via standards committees. In practice, the commitment not to break compatibility is due to the fact that we need to maintain backwards compatibility with older versions of Linux. The same is true for MacOS, Windows, etc. Users get cranky when a file system that was written using MacOS 10.1 can't be read by MacOS 10.3, etc.

In the case of ext4, we have feature bitmasks in the superblocks. When we add a new feature, we define a new bit in one of three feature bitmasks: compat, r/o compat, incompat. If the kernel sees a bit which it does not know about in the r/o compat bitmask, it will now allow the file system to be mounted read/write, but it will allow it mount the file system read/only. If there the kernel sees a bit which it does not understand in the incompat bitmask, then it won't allow the file system to be mounted at all. And if there is a bit set in the compat file system that the kernel does not understand, the kernel knows that it is safe to mount the file system regardless. However, the file system consistency checker (e2fsck), and some of the other file system utilities (e.g., resize2fs) may require a more stringent compatibility check, and so they will not try to make changes to a file system that has some compat feature that it doesn't understand.

In practice, when we add a new feature, we wait quite a while before mke2fs utility will be enable the feature by default. This allows more adventurous users to test the file system feature before we enabled by default for everyone. In practice, other operating systems only implement a very small subset of the ext4 features --- most commonly, the set of features that a non-Linux implementation of ext2/ext3/ext4 roughly corresponds to the file system features that are enabled via "mke2fs -t ext2 /dev/disk".

These features haven't changed since they were first implemented almost a quarter of a century ago. And they won't change for the obvious reason that there are still lots of enterprises still using RHEL 5, which uses a kernel that was released over ten years ago, and we care an awful lot about backwards compatibility with ourselves as well as with other operating systems. So you can look at "The Design and Implementation of Ext2" (http://web.mit.edu/tytso/www/linux/ext2intro.html) paper, published in 1994, and as far as the basics are concerned they haven't changed.

Of course, we are still adding new features --- for example, most recently we have added file-system level encryption (used in Android and soon, hopefully, Chrome OS), project quota, metadata checksums, etc. to ext4. Each of these new features are protected by feature flags, and all of these features are not enabled by default in the current version of mke2fs as distributed in the e2fsprogs source distributions. Some community distributions (such as Debian) may enable certain bleeding edge features, such as metadata checksums, just so they get more exposure and testing before it gets enabled for everyone, including the more conservative, corporate users of the enterprise Linux distributions.

Naturally, other operating systems won't have support for these latest bleeding-edge features. But that's OK, because you can also create a file system using "mke2fs -t ext2" which will be much more basic, and that should be easily used for interoperability. In general people will use a file system with advanced features for native use, and a very basic file system with all of the advanced features turned off for interchange purposes. This is why many USB sticks use FAT --- since Linux, Windows, and MacOS can read FAT file systems without needing any special handling.

Another possibility is that the latest version of e2fsprogs ships with a userspace file system implementation of ext4, called fuse2fs. For operating systems that support FUSE (which includes most BSD systems as well as MacOS), this can be a handy way of reading an ext4 file system. It won't be a high-performance read/write implementation, but someone who just wants to get data off of an ext4 file system image, fuse2fs works quite well.

这篇关于是否有ext2 / ext3 / ext4文件系统的官方规范?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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