ext4: Still being tested or already working?
In the announcement of Fedora 9 , one of the first lines mentions experimental support for the ext4 file system .
In this article I will talk about how it can be useful to replace ext3 file with ext4 and what additional risks you will have if you decide on this step.
Better ext4
- ext4 is faster, especially when working with large files (very noticeable when deleting).
- file size - up to 16T , file system - up to 1024Р
- “extended attributes in inode” appeared for SElinux, beagle, samba. In certain situations, mkfs and fsck can speed up .
- You can simply mount existing ext3 partitions as ext4
- A defragmenter is being developed, similar to the one available in XFS . He will be able to: collect a file in a continuous area, collect files from one directory together, collect empty space in a continuous area. Productivity should increase
Read the technical details here: ext4 in Russian ,
New ext4 features .
How to switch from ext3 to ext4
In the production version, ext3 can be mounted as ext4 . Now the procedure is a little more complicated.
Let ext3 be installed on / dev / sdc1 . Using blkid, we see how the kernel identifies the file system.
[root @ ad mnt] # blkid / dev / sdc1 / dev / sdc1: LABEL = "/ var / www / img" UUID = "77d69541-cd2e-47d5-91fc-bdb5606aa8fb" SEC_TYPE = "ext2" TYPE = "ext3"
As long as we have TYPE = "ext3", we will not be able to mount the drive under ext4. Fix this problem
[root @ ad mnt] # debugfs -w / dev / sdc1 debugfs 1.40.8 (13-Mar-2008) debugfs: set_super_value s_flags 4 debugfs: quit
check:
[root @ ad mnt] # blkid / dev / sdc1 / dev / sdc1: LABEL = "/ var / www / img" UUID = "77d69541-cd2e-47d5-91fc-bdb5606aa8fb" SEC_TYPE = "ext2" TYPE = "ext4dev"
There is no error, now the file system is called ext4dev .
You can mount:
[root @ ad mnt] # mount -t ext4dev -o extents / dev / sdc1 ./test
How to format a partition under ext4
# mke2fs -E test_fs / dev / sdc1 # tune2fs -j / dev / sdc1
Where it is wise to use ext4 now
I can say for sure that it is not in the / var / lib / mysql directory .
I already use ext4dev , in the section where the nginx cache is added , as well as all the photo content (when rendering static to nginx , speed with the file system is important).
In order not to take risks, I changed the file system by formatting and filling the content onto a blank disk. During this procedure, a little funny thing happened. In ext3, all files occupied 97G , after reloading to a new ext4dev formatted partition, it turned out 90G. I cut the folder comparison in mc, compared half a day - everything is OK :). I can’t say why there was a saving, maybe the data on ext3 was very fragmented (there were a lot of directories with small files).
What are the risks?
The risks are obvious, this is experimental support - everything is possible!
When switching from ext2 to ext3, at any time you could refuse ext3 and mount ext3 as ext2 , if you have already switched to ext4, there is no turning back!
You can mount it with the -o noextents option and then it will be possible to roll everything back to ext3 , but this option cuts off almost all ext4 charms .
In the case of a “gathering” of the file system, you need to be ready to use tune2fs .
Maybe you have already decided to translate the / tmp directory to ext4 :)?
UPD1: To workfsck needs to copy fsck.ext3 to fsck.ext4 . Now let's run
# fsck.ext4 / dev / sdc1