当前时区为 UTC + 8 小时



发表新帖 回复这个主题  [ 33 篇帖子 ]  前往页数 1, 2, 3  下一页
作者 内容
1 楼 
 文章标题 : 9.04 能用ext4了, 大家用上了吗?
帖子发表于 : 2009-01-15 11:40 

注册: 2006-12-28 0:05
帖子: 63
送出感谢: 0 次
接收感谢: 0 次
9.04 能用ext4了, 大家用上了吗? :em03


页首
 用户资料  
 
2 楼 
 文章标题 : Re: 9.04 能用ext4了, 大家用上了吗?
帖子发表于 : 2009-01-15 11:44 

注册: 2007-12-31 8:35
帖子: 135
送出感谢: 0 次
接收感谢: 0 次
有什么不同? 能说说吗?


页首
 用户资料  
 
3 楼 
 文章标题 : Re: 9.04 能用ext4了, 大家用上了吗?
帖子发表于 : 2009-01-16 20:43 

注册: 2006-09-13 8:13
帖子: 24
送出感谢: 0 次
接收感谢: 0 次
呵呵,还没用上ext4
安装的时候貌似没有看到ext4的选项阿,我是直接安装的Ubuntu9.04


页首
 用户资料  
 
4 楼 
 文章标题 : Re: 9.04 能用ext4了, 大家用上了吗?
帖子发表于 : 2009-01-16 21:46 
头像

注册: 2007-11-29 9:41
帖子: 8455
送出感谢: 0 次
接收感谢: 0 次
性能有提升吗? 不过一般感觉不出来吧


页首
 用户资料  
 
5 楼 
 文章标题 : Re: 9.04 能用ext4了, 大家用上了吗?
帖子发表于 : 2009-01-17 8:28 

注册: 2008-05-15 21:11
帖子: 289
送出感谢: 0 次
接收感谢: 0 次
有助于提高启动速度,
减少写入次数,对 ssd 硬盘很好,忘了对普通硬盘是不是也有好处了。


页首
 用户资料  
 
6 楼 
 文章标题 : Re: 9.04 能用ext4了, 大家用上了吗?
帖子发表于 : 2009-01-17 10:55 
头像

注册: 2008-12-18 19:25
帖子: 40
送出感谢: 0 次
接收感谢: 0 次
donotaskwhoiam 写道:
有助于提高启动速度,
减少写入次数,对 ssd 硬盘很好,忘了对普通硬盘是不是也有好处了。

哦,听起来不错.


页首
 用户资料  
 
7 楼 
 文章标题 : Re: 9.04 能用ext4了, 大家用上了吗?
帖子发表于 : 2009-01-17 14:07 

注册: 2006-09-13 8:13
帖子: 24
送出感谢: 0 次
接收感谢: 0 次
楼主用上ext4了?说说看,呵呵
怎么用上的


页首
 用户资料  
 
8 楼 
 文章标题 : Re: 9.04 能用ext4了, 大家用上了吗?
帖子发表于 : 2009-01-17 14:21 

注册: 2006-09-13 8:13
帖子: 24
送出感谢: 0 次
接收感谢: 0 次
找到了,呵呵
转自:http://kernelnewbies.org/Ext4
1. Introduction

Ext4 is the evolution of the most used Linux filesystem, Ext3. In many ways, Ext4 is a deeper improvement over Ext3 than Ext3 was over Ext2. Ext3 was mostly about adding journaling to Ext2, but Ext4 modifies important data structures of the filesystem such as the ones destined to store the file data. The result is a filesystem with an improved design, better performance, reliability and features .

2. EXT4 features

2.1. Compatibility

Any existing Ext3 filesystem can be migrated to Ext4 with an easy procedure which consists in running a couple of commands in read-only mode (described in the next section). This means that you can improve the performance, storage limits and features of your current filesystems without reformatting and/or reinstalling your OS and software environment. If your need the advantages of Ext4 on a production system, you can upgrade the filesystem. The procedure is safe and doesn't risk your data (obviously, backup of critical data is recommended, even if you aren't updating your filesystem :). Ext4 will use the new data structures only on new data, the old structures will remain untouched and it will be possible to read/modify them when needed. This means, that, of course, that once you convert your filesystem to Ext4 you won't be able to go back to Ext3 again (although there's a possibility, described in the next section, of mounting a Ext3 filesystem with Ext4 without using the new disk format and you'll be able to mount it with Ext3 again, but you lose many of the advantages of Ext4).

2.2. Bigger filesystem/file sizes

Currently, Ext3 support 16 TB of maximum filesystem size, and 2 TB of maximum file size. Ext4 adds 48-bit block addressing, so it will have 1 EB of maximum filesystem size and 16 TB of maximum file size. 1 EB = 1,048,576 TB (1 EB = 1024 PB, 1 PB = 1024 TB, 1 TB = 1024 GB). Why 48-bit and not 64-bit? There're some limitations that would need to be fixed before making Ext4 fully 64-bit capable, which have not been addressed in Ext4. The Ext4 data structures have been designed keeping this in mind, so a future update to Ext4 will implement full 64-bit support at some point. 1 EB will be enough (really :)) until that happens. (Note: The code to create filesystems bigger than 16 TB is -at the time of witting this article- not in any stable release of e2fsprogs. It will be in future releases.)

2.3. Subdirectory scalability

Right now the maximum possible number of subdirectories contained in a single directory in Ext3 is 32.000. Ext4 breaks that limit and allows a unlimited number of subdirectories.

2.4. Extents

The traditionally Unix-derived filesystems like Ext3 use a indirect block mapping scheme to keep track of each block used for the blocks corresponding to the data of a file. This is inefficient for large files, specially on large file delete and truncate operations, because the mapping keeps a entry for every single block, and big files have many blocks -> huge mappings, slow to handle. Modern filesystems use a different approach called "extents". A extent is basically a bunch of contiguous physical blocks. It basically says "The data is in the next n blocks". For example, a 100 MB file can be allocated into a single extent of that size, instead of needing to created the indirect mapping for 25600 blocks (4 KB per block). Huge files are split in several extents. Extents improve the performance and also help to reduce the fragmentation, since a extent encourages continuous layouts on the disk.

2.5. Multiblock allocation

When Ext3 needs to write new data to the disk, there's a block allocator that decides which free blocks will be used to write the data. But the Ext3 block allocator only allocates one block (4KB) at a time. That means that if the system needs to write the 100 MB data mentioned in the previous point, it will need to call the block allocator 25600 times (and it was just 100 MB!). Not only this is inefficient, it doesn't allow the block allocator to optimize the allocation policy because it doesn't knows how many total data is being allocated, it only knows about a single block. Ext4 uses a "multiblock allocator" (mballoc) which allocates many blocks in a single call, instead of a single block per call, avoiding a lot of overhead. This improves the performance, and it's specially useful with delayed allocation and extents. This feature doesn't affect the disk format. Also, note that the Ext4 block/inode allocator has other improvements, described in detail in this paper.

2.6. Delayed allocation

Delayed allocation is a performance feature (it doesn't change the disk format) found in a few modern filesystems such as XFS, ZFS, btrfs or Reiser 4, and it consists in delay the allocation of blocks as much as possible, contrary to what traditionally filesystems (such as Ext3, reiser3, etc) do: allocate the blocks as soon as possible. For example, if a process write()s, the filesystem code will allocate immediately the blocks where the data will be placed - even if the data is not being written right now to the disk and it's going to be kept in the cache for some time. This approach has disadvantages. For example when a process is witting continually to a file that grows, successive write()s allocate blocks for the data, but they don't know if the file will keep growing. Delayed allocation, on the other hand, does not allocate the blocks immediately when the process write()s, rather, it delays the allocation of the blocks while the file is kept in cache, until it is really going written to the disk. This gives to the block allocator the opportunity to optimize the allocation in situations where the old system couldn't. Delayed allocation plays very nicely with the two previous features mentioned, extents and multiblock allocation, because in a many workloads when the file is written finally to the disk it will be allocated in extents whose block allocation is done with the mballoc allocator. The performance is much better, and the fragmentation is much improved in some workloads.

2.7. Fast fsck

Fsck is a very slow operation, especially the first step: checking all the inodes in the filesystem. In Ext4, at the end of each group's inode table it will be stored a list of unused inodes (with a checksum, for safety), so fsck will not check those inodes. The result is that total fsck time improves from 2 to 20 times, depending on the number of used inodes (http://kerneltrap.org/Linux/Improving_f ... ds_in_Ext4). It must be noticed that it's fsck, and not Ext4, who will build the list of unused inodes. This means that you must run fsck to get the list of unused inodes built, and only the next fsck run will be faster (you need to pass a fsck in order to convert a Ext3 filesystem to Ext4 anyway). There's also a feature that takes part on this fsck speed up - "flexible block groups" - that also speeds up filesystem operations.

2.8. Journal checksumming

The journal is the most used part of the disk, making the blocks that form part of it more prone to hardware failure. And recovering from a corrupted journal can lead to massive corruption. Ext4 checksums the journal data to know if the journal blocks are failing or corrupted. But journal checksumming has a bonus: it allows to convert the two-phase commit system of Ext3's journaling to a single phase, speeding the filesystem operation up to 20% in some cases - so reliability and performance are improved at the same time. (Note: the part of the feature that improves the performance, the asynchronous logging, is turned off by default and will be enabled in future releases)

2.9. Online defragmentation

(This feature is not available in 2.6.28, but will be probably available in the next release). While delayed allocation, extents and multiblock allocation help to reduce the fragmentation, with usage filesystems can still fragment. For example: You write three files in a directory and continually on the disk. Some day you need to update the file of the middle, but the updated file has grown a bit, so there's not enough room for it. You have no option but fragment the excess of data to another place of the disk, which will cause a seek, or allocate the updated file continually in another place, far from the other two files, resulting in seeks if an application needs to read all the files on a directory (say, a file manager doing thumbnails on a directory full of images). Besides, the filesystem can only care about certain types of fragmentation, it can't know, for example, that it must keep all the boot-related files contiguous, because it doesn't know which files are boot-related. To solve this issue, Ext4 will support online fragmentation, and there's a e4defrag tool which can defragment individual files or the whole filesystem.

2.10. Inode-related features

Larger inodes, nanosecond timestamps, fast extended attributes, inodes reservation...

* Larger inodes: Ext3 supports configurable inode sizes (via the -I mkfs parameter), but the default inode size is 128 bytes. Ext4 will default to 256 bytes. This is needed to accommodate some extra fields (like nanosecond timestamps or inode versioning), and the remaining space of the inode will be used to store extend attributes that are small enough to fit it that space. This will make the access to those attributes much faster, and improves the performance of applications that use extend attributes by a factor of 3-7 times.
* Inode reservation consists in reserving several inodes when a directory is created, expecting that they will be used in the future. This improves the performance, because when new files are created in that directory they'll be able to use the reserved inodes. File creation and deletion is hence more efficient.
* Nanoseconds timestamps means that inode fields like "modified time" will be able to use nanosecond resolution instead of the second resolution of Ext3.

2.11. Persistent preallocation

This feature, available in Ext3 in the latest kernel versions, and emulated by glibc in the filesystems that don't support it, allows applications to preallocate disk space: Applications tell the filesystem to preallocate the space, and the filesystem preallocates the necessary blocks and data structures, but there's no data on it until the application really needs to write the data in the future. This is what P2P applications do in their own when they "preallocate" the necessary space for a download that will last hours or days, but implemented much more efficiently by the filesystem and with a generic API. This have several uses: first, to avoid applications (like P2P apps) doing it themselves inefficiently by filling a file with zeros. Second, to improve fragmentation, since the blocks will be allocated at one time, as contiguously as possible. Third, to ensure that applications has always the space they know they will need, which is important for RT-ish applications, since without preallocation the filesystem could get full in the middle of an important operation. The feature is available via the libc posix_fallocate() interface.

2.12. Barriers on by default

This is an option that improves the integrity of the filesystem at the cost of some performance (you can disable it with "mount -o barrier=0", recommended trying it if you're benchmarking). From this LWN article: "The filesystem code must, before writing the [journaling] commit record, be absolutely sure that all of the transaction's information has made it to the journal. Just doing the writes in the proper order is insufficient; contemporary drives maintain large internal caches and will reorder operations for better performance. So the filesystem must explicitly instruct the disk to get all of the journal data onto the media before writing the commit record; if the commit record gets written first, the journal may be corrupted. The kernel's block I/O subsystem makes this capability available through the use of barriers; in essence, a barrier forbids the writing of any blocks after the barrier until all blocks written before the barrier are committed to the media. By using barriers, filesystems can make sure that their on-disk structures remain consistent at all times."

3. How to use Ext4

This is the first stable version of Ext4, so even if the whole development and release of this filesystems has been slowed down and delayed a lot to guarantee the same level of stability that you'd expect from the current Ext3 implementation, the usual rules of any ".0" software apply.

One very important thing to keep in mind is that there is NOT Ext4 GRUB support. Well, that wasn't exactly true: There is grub support, but the grub versions used by your current distro don't support it. There's support in the GRUB2 development branch, but only from this commit and ahead. There are available grub2 packages in Ubuntu and debian-derived distros as the grub-pc package. In the 0.9x branch, there's not official support, but there's a Google SoC project that developed support for it, and Google finds patches. So choose yourself. The next release of distros based in Linux 2.6.28 will probably have support in one way or another. The safe option is to keep your /boot directory in a partition formatted with Ext3.

You also need an updated e2fsprogs tool, of course, the latest stable version -1.41.3- is recommended.

NOTE: At least in debian-derived distros, including Ubuntu, converting your filesystem to Ext4 when using a initramfs results into a non-booting system, apparently even when you enable the "ext4dev compatibility" option". The problem is that the fstype klibc util detects the ext4 filesystem as ext3, and tries to mount it as ext3, and fails. The fix is to pass the "rootfstype=ext4" option (without the quotes) in the kernel command line.

Switching to Ext4 it's very easy. There are three different ways you can use to switch:

3.1. Creating a new Ext4 filesystem from the scratch

* The easiest one, recommended for new installations. Just update your e2fsprogs package to Ext4, and create the filesystem with mkfs.ext4.

3.2. Migrate existing Ext3 filesystems to Ext4

You need to use the tune2fs and fsck tools in the filesystem, and that filesystem needs to be unmounted. Run:

*

tune2fs -O extents,uninit_bg,dir_index /dev/yourfilesystem

After running this command you MUST run fsck. If you don't do it, Ext4 WILL NOT MOUNT your filesystem. This fsck run is needed to return the filesystem to a consistent state. It WILL tell you that it finds checksum errors in the group descriptors - it's expected, and it's exactly what it needs to be rebuilt to be able to mount it as Ext4, so don't get surprised by them. Since each time it finds one of those errors it asks you what to do, always say YES. If you don't want to be asked, add the "-p" parameter to the fsck command, it means "automatic repair":

*

fsck -pf /dev/yourfilesystem

There's another thing that must be mentioned. All your existing files will continue using the old indirect mapping to map all the blocks of data. The online defrag tool will be able to migrate each one of those files to a extent format (using a ioctl that tells the filesystem to rewrite the file with the extent format; you can use it safely while you're using the filesystem normally)

3.3. Mount an existing Ext3 filesystem with Ext4 without changing the format

You can mount an existing Ext3 filesystem with Ext4 but without using features that change the disk format. This means you will be able to mount your filesystem with Ext3 again. You can mount an existing Ext3 filesystem with "mount -t ext4 /dev/yourpartition /mnt". Doing this without having done the conversion process described in the previous point will force Ext4 to not use the features that change the disk format, such as extents, it will use only the features that don't change the file format, such as mballoc or delayed allocation. You'll be able to mount your filesystem as Ext3 again. But obviously you'll be losing the advantages of the Ext4 features that don't get used...


页首
 用户资料  
 
9 楼 
 文章标题 : Re: 9.04 能用ext4了, 大家用上了吗?
帖子发表于 : 2009-01-17 14:24 

注册: 2006-09-13 8:13
帖子: 24
送出感谢: 0 次
接收感谢: 0 次
现在用ext4对于我们普通用户作用可能不是很明显,不过等个半年,相信不少发行版本的Linux应该默认支持ext4了


页首
 用户资料  
 
10 楼 
 文章标题 : Re: 9.04 能用ext4了, 大家用上了吗?
帖子发表于 : 2009-01-17 18:01 
头像

注册: 2006-09-10 16:06
帖子: 1456
送出感谢: 0 次
接收感谢: 0 次
看洋文真是累人,虽然能看明白,但是还是看了两段就不想看了,不过ext4对于ssd硬盘有好处倒好像是真的有这么一说。


页首
 用户资料  
 
11 楼 
 文章标题 : Re: 9.04 能用ext4了, 大家用上了吗?
帖子发表于 : 2009-01-17 21:39 

注册: 2006-12-15 16:25
帖子: 37
送出感谢: 0 次
接收感谢: 0 次
alpha.gu 写道:
看洋文真是累人,虽然能看明白,但是还是看了两段就不想看了,不过ext4对于ssd硬盘有好处倒好像是真的有这么一说。

减少读取次数=对SSD有好处,因为SSD的寿命基本等同读取次数 :em01


页首
 用户资料  
 
12 楼 
 文章标题 : Re: 9.04 能用ext4了, 大家用上了吗?
帖子发表于 : 2009-01-18 14:27 
头像

注册: 2008-04-26 12:41
帖子: 10971
送出感谢: 11
接收感谢: 38
Shinwar 写道:
alpha.gu 写道:
看洋文真是累人,虽然能看明白,但是还是看了两段就不想看了,不过ext4对于ssd硬盘有好处倒好像是真的有这么一说。

减少读取次数=对SSD有好处,因为SSD的寿命基本等同读取次数 :em01

我印象中不是读取次数,而是写入次数吧?


_________________
[新手必读]wubi安装常见问题(FAQ)
[分享]装双系统的同学必看——Windows与Linux系统共享交换分区的方法
kde下唯美的暗黑内透主题(无需编译)
无穷老机上的Trinity Desktop Environment


页首
 用户资料  
 
13 楼 
 文章标题 : Re: 9.04 能用ext4了, 大家用上了吗?
帖子发表于 : 2009-01-18 14:45 
头像

注册: 2008-12-13 19:39
帖子: 13284
地址: 物华天宝人杰地灵
送出感谢: 1
接收感谢: 6
哪位兄弟能把楼上兄弟的关于Ext4的E文翻译过来,我好想用Ext4啊,刚下了904。准备明天装下。
哪位兄弟做下好事,我是万分感激,其他的兄弟们想必也是很想看中文版本的说明的。
感谢SW.d兄弟的机译,虽然读起来很别扭,但大体上明白了EXT4的特点。反正这次为了快速启动和EXT4,坚决做次小白。


_________________
行到水穷处,坐看云起时。
海内生明月,天涯共此夕。
--------------------吾本独!


最后由 wangdu2002 编辑于 2009-01-18 21:34,总共编辑了 1 次

页首
 用户资料  
 
14 楼 
 文章标题 : Re: 9.04 能用ext4了, 大家用上了吗?
帖子发表于 : 2009-01-18 20:06 

注册: 2009-01-18 19:37
帖子: 6
送出感谢: 0 次
接收感谢: 0 次
powerd by google
1 。导言

Ext4 是 Ext3 的演变 。从许多方面来说,Ext4相对于Ext3的进步要远超过Ext3相对于Ext2的进步。 Ext3主要是关于新增日志相对于 Ext2 ,Ext4 是文件系统数据结构方面的优化。结果是文件系统的设计与改进,更好的性能,可靠性和功能。

2 。 EXT4 功能

2.1 。兼容性

任何现有的 ext3文件系统都可迁移到 Ext4 。你只需要在只读模式下运行几条命令(详见下一节)。这意味着你可以提高性能,存储容量和功能 您目前不需要重新格式化和/或重新安装您的操作系统和软件环境。如果您需要Ext4 的优点,您可以升级文件系统。该程序是安全的,不会危及您的数据(当然,备份重要数据,建议,即使你不更新您的文件: ) 。 Ext4将使用新的数据结构 在新的数据,旧的数据结构将保持不变,并有可能在需要时读取/修改它们。这意味着,一旦你转换到Ext4, 就不能直接转换回 Ext 3(尽管有可能性,说明在下一节中, 挂载Ext3 和Ext4 不使用新的磁盘格式,你可以再挂载Ext4 和 Ext3 ,但是您会失去许多Ext4的好处 ) 。

2.2 。更大的文件系统/文件大小

目前, Ext3支持16 TB的最大文件大小,和2 TB的最大文件大小。 Ext4增加了48位块处理,因此将有1 EB 的最大文件系统大小和16 TB的最大文件大小。 1EB = 1,048,576 TB 1 EB = 1024 PB, 1 PB = 1024 TB, 1 TB = 1024 GB). 为什么是48位(Bit),而不是64位?在Ext4完全支持64位前,需要有限制直到修复Bug ,还没在 Ext4 中处理。Ext4的数据结构会保持这想法,所以未来的某时候会更新Ext4 全面支持64位,1EB 足够了(真的)直到情况改变。(代码在当时大于16TB ,写这篇文章时,不是在 e2fsprogs 正式版,它将会在将来的版本)

2.3 。子目录的可扩展性

现在,单个目录下的子目录数目 Ext3是32.000 个。 Ext4突破限制和允许无限数量的子目录。

2.4 。(Extents) (程度减轻?)

传统的Unix衍生文件系统例如 Ext3 文件系统使用一个间接块映射表来记录每个区块用于块相应的数据文件。这对于大文件是低效率的,特别是对大文件删除和截断 (truncate) 动作,因为映射表会使用很多区块,大文件会使用很多区块,因此会很慢。  现在的文件系统使用不同的方法被称为“Extents”。一个Extents是一个地址连续的数据块的集合。比如一个100MB的文件将被分配给一个 单独的Extents,这样就不用像Ext3那样新增25600个数据块的记录(一个数据块是4KB)。而超大型文件会被分解在多个extents里。

2.5 .多块分配

当 Ext3需要新的数据写入到磁盘,有块分配器的决定空闲块将用于数据写入。但是, 它一次只能够分配一个数据块。这意味着,如果系统需要100 MB的写入的数据中所提到的前点,这将需要调用块分配器25600次(这只是100 MB的!)。是低效率的,它不允许块分配器优化分配政策,因为它不知道有多少总数据正在分配,它只知道一个单一的块。 Ext4 ,使用了“多块分配器”( mballoc ),即一次调用可以分配多个数据块。这提高了性能,而且特别有用延迟分配和程度。此功能不会影响磁盘格式。另外请注意, Ext4块/ inode上配置了其他改进,

2.6 。延迟分配(Delayed allocation)

延迟分配是一个高性能的功能(不改变磁盘格式)是一项仅仅少数现代文件系统才具有的优秀特性,比如XFS、ZFS、btrfs(better FS)以及Reiser4。,它能够尽可能的积累更多的数据块再分配出去,相对比,传统的文件系统则会尽快的将数据块分配出去,如Ext3,reiser3 等。

这项特性会和Extents特性以及多块分配特性相结合,使得磁盘IO性能得到显著提高。

2.7.快速 fsck

Fsck是一个非常缓慢的行动,特别是第一步:检查所有的档案 inodes 。在Ext4结束时,每个组的inode,将被储存的清单未使用的inodes ( 校验,以策安全),所以fsck不会检查这些inodes 。其结果是,总fsck时间提高2至20倍,这取决于使用的数量inodes 。但必须注意到,这是fsck ,而不是Ext4 ,谁建立的清单未inodes 。这意味着,您必须运行fsck获得名单未inodes建立,只有在未来fsck运行将更快(你需要通过fsck以转换提供ext3文件系统支持,以 Ext4反正) 。还有一个功能,参加关于这个fsck加快- “"flexible block groups" -这也加快了文件的行动。

2.8 .日志校验 (Journal checksumming)

该杂志是最常用的一部分磁盘,从而使模块的一部分,它更容易硬件故障。和恢复已损坏的杂志可能导致大规模的腐败。Ext4提供校验日志数据的功能,可以查看其潜在错误。但是日志校验有一个好处:它可以让转换两阶段提交系统Ext3的日志到一个单一的阶段,加快了文件运行了20 %在某些情况下-这样的可靠性和性能得到改善的同时。(注:该部分的功能,提高了性能,异步采伐,默认情况关闭了,以后的版本将启用)

2.9 .在线碎片整理

(此功能在 2.6.28 核心不可用,可能未来的版本可以)。虽然推迟分配,程度和多块分配有助于减少碎片,并使用文件仍然可以片段。例如:您写的三个文件的目录中,并不断在磁盘上。有一天,您需要更新的文件,中东,但更新的文件增加一点,所以没有足够的空间了。你别无选择,只能片段过剩的数据到另一个地方的磁盘,这将导致寻求,或分配不断更新的文件在另一个地方,远离其他两个文件,从而谋求如果应用程序需要读取所有文件中的某个目录(例如,一个文件管理器做缩略图的某个目录,全面的图像)。此外,文件可以只关心某些类型的分散,它可以不知道,例如,它必须让所有的启动有关的文件毗连,因为它不知道哪些文件是启动有关。解决这一问题,将支持在线Ext4分裂,并有一个e4defrag工具,它可以整理个别文件或整个文件。

2.10. inode上相关的功能

放大inodes ,纳秒的时间戳记,快速扩展属性, inodes保留...

* 放大inodes : Ext3支持配置inode上规模(通过我mkfs参数) ,但默认的inode上大小为128字节。 Ext4将默认设置为256字节。这是必要的,以适应一些额外的领域(如纳秒的时间戳记或inode上的版本),其余的空间索引节点将被用来存储扩展属性,小到适合它的空间。这将使获得这些属性快得多,提高了性能的应用程序,使用扩展属性的系数3-7次。
*索引节点组成,在保留保留几个inodes时创建的目录,希望它们将被用于未来。这提高了性能,因为当新文件被创建该目录中,他们就可以使用保留inodes 。文件创建和删除,因此更有效率。
*纳秒时间戳意味着inode上领域,如“修改时间”将能够利用纳秒 ,而不是第二个 的Ext3 。

2.11. Persistent preallocation

一直要等到一個處理所需要的所有資源都配置好以後,才開始執行處理的一種技術
此功能,可在Ext3在最新版本的内核,并仿效的glibc中的文件,不支持,使应用软件preallocate磁盘空间:申请文件,以告诉 preallocate空间,以及必要的文件preallocates模块和数据结构,但是没有数据,直到应用真正需要的数据写入未来。这就是P2P应用做自己当“ preallocate ”必要的空间下载将持续数小时或数天,但实施更有效的文件系统和一个通用的API 。这有几种用途:第一,以避免应用(如P2P网络应用服务)做自己的低效填写档案为零。第二,改善支离破碎的,因为这些区块将被分配在同一时间,作为 contiguously越好。第三,以确保应用始终空间他们知道他们需要,这是非常重要的应用RT -杂交申请,因为没有preallocation的文件可以完全在中东的一个重要行动。这一功能是可通过LIBC的posix_fallocate ()接口。

2。12.。壁垒对默认 (Barriers on by default)

这是一个选择,提高了完整的档案,但代价是一些业绩(您可以禁用它 "mount -o barrier=0", 建议试一试) 。从这个LWN文章: “必须的文件系统代码,然后写[日志]承诺的记录,绝对肯定,所有的交易信息,使该杂志。只需做写在按照正确的顺序是不够的;当代硬盘维护巨大的内部高速缓存,并重新安排业务有更好的表现。因此,文件必须明确指示磁盘获得的所有数据杂志媒体上的承诺之前书面记录,如果记录得到书面承诺第一,杂志可能会损坏。该内核的块I / O子系统使这种能力可以通过使用障碍;从本质上来说,一个障碍禁止任何书面块后的障碍,直到所有区块书面前障致力于媒体。利用的障碍,可以使文件确保他们的磁盘上的结构保持一致在任何时候。 “

3 。如何使用Ext4

这是第一个稳定版本的Ext4 ,因此,即使整个开发和发布这一文件已经放慢,并推迟了很多保证同样水平的稳定,您希望从目前的Ext3执行,通常的规则任何“ 0.0 ”软件适用。

一个非常重要的事情要记住的是,没有Ext4蛴螬的支持。嗯,这是不完全正确的:有蛴螬的支持,但grub对您所使用的版本目前发行不支持它。有支持 GRUB2发展科,但只有从这个承诺和未来。有可用grub2中的软件包Ubuntu和Debian的衍生发行的蛴螬电脑包。在0.9x处,有没有官方支持,但有一个谷歌的SoC项目,发达国家的支持,和谷歌认定补丁。因此,选择自己。下一个版本的发行基于2.6.28的Linux可能会支持这种或那种方式。安全的选择是保持您的文件/ boot目录中的一个分区格式化,提供ext3 。

您还需要更新的e2fsprogs工具,当然,建议最新的稳定版本1.41.3.

注意:至少在Debian衍生发行,包括Ubuntu ,转换的文件,以Ext4在使用initramfs成果转化为一个非启动系统,显然即使您启用“ ext4dev兼容性”选项“ 。现在的问题是, fstype klibc公用事业检测ext4文件系统为ext3 ,并尝试挂载为ext3 ,和失败。伦敦定盘价是通过了“ rootfstype = ext4 ”选项(不含引号)在内核命令行。

切换到Ext4很容易。有三种不同的方法您可以使用切换:

3.1 。创建一个新的Ext4文件

*最简单的一个,建议新的设施。只是更新您的 e2fsprogs 包到 Ext4 ,并建立 文件系统 mkfs.ext4 。

3.2 。迁移现有的Ext3文件系统,以Ext4

您需要使用tune2fs和fsck工具的文件,而且文件需要未经。运行:

*

tune2fs -O extents,uninit_bg,dir_index /dev/yourfilesystem


运行此命令后,您必须运行fsck 。如果你不这样做, Ext4将无法安装您的文件。这fsck运行需要返回的文件一致状态。它会告诉你,它认为校验错误集团描述-它的预期,这也正是它需要重建能够挂载它作为 Ext4 ,所以不会感到惊讶他们。由于每次发现其中的错误,它要求你做什么,总是说Yes 。如果你不想被要求,新增了 "-p" 参数的fsck命令,这意味着“自动修复” :

*

fsck -pf /dev/yourfilesystem


还有另一件事,必须要提到。所有您现有的文件将继续使用旧的间接映射到地图的所有数据块。联机碎片整理工具将能够迁移每一个档案到程度格式(使用ioctl告诉重写的文件的文件格式的程度,你可以用它安全,而您使用的文件系统通常)

3.3 。使用Ext4来挂载一个Ext3文件系统。

你可以使用mount -t ext4 /dev/yourpartition /mnt来将一个Ext3文件系统用Ext4来挂载,但你将享受不到那些需要改变磁盘格式才可以享受得到的特性,比如Extents。你可以享受到的只有那些不需要改变磁盘格式即可享受得到的特性,比如多块分配、延迟分配等。我们当然不建议您这么做,因为Ext4的优秀特性,您将无法体会….



大量参考了 此blog

《Linux大棚》博客,博客地址为http://roclinux.cn。文章作者为rocrocket。


最后由 sw.d 编辑于 2009-01-20 17:59,总共编辑了 4 次

页首
 用户资料  
 
15 楼 
 文章标题 : Re: 9.04 能用ext4了, 大家用上了吗?
帖子发表于 : 2009-01-19 21:32 

注册: 2006-12-28 0:05
帖子: 63
送出感谢: 0 次
接收感谢: 0 次
哈, 明天我试试上一上 :em01


页首
 用户资料  
 
显示帖子 :  排序  
发表新帖 回复这个主题  [ 33 篇帖子 ]  前往页数 1, 2, 3  下一页

当前时区为 UTC + 8 小时


在线用户

正在浏览此版面的用户:没有注册用户 和 3 位游客


不能 在这个版面发表主题
不能 在这个版面回复主题
不能 在这个版面编辑帖子
不能 在这个版面删除帖子
不能 在这个版面提交附件

前往 :  
本站点为公益性站点,用于推广开源自由软件,由 DiaHosting VPSBudgetVM VPS 提供服务。
我们认为:软件应可免费取得,软件工具在各种语言环境下皆可使用,且不会有任何功能上的差异;
人们应有定制和修改软件的自由,且方式不受限制,只要他们自认为合适。

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
简体中文语系由 王笑宇 翻译