Some time ago ext4 was released and served as a built-in feature in linux kernel mainline. Ext4 provides additional benefits compared to ext3. The next release of Fedora, version 11, will by default use ext4 unless serious regressions occured. In this article I’d give you a general way on converting filesystems from ext3 to ext4.
EXT4 Filesystem Features
* Delayed allocation & mballoc allocator for better on-disk allocation
* Sub-second timestamps
* Space preallocation
* Journal checksumming
* Large (>2T) file support
* Large (>16T) filesystem support
* Defragmentation support
Once you converted your file system to ext4, the fs cannot be mounted as ext3. Note that ext4 may have some bugs so do not use it on productive servers. It’s also recommended that keep your /boot in ext3.
You need to check ext4 is supported and compiled in you current kernel. Otherwise, you need to apply the patch, and re-compile your kernel. I assume that your kernel supports ext4.
Simply follow these steps to convert an existing ext3 file-system to ext4. For example, in order to converting /dev/sdb1 to ext4, you need to type:
# cd /; umount /dev/sdb1
# tune2fs -O extents,uninit_bg,dir_index /dev/sdb1
# fsck -pf /dev/sdb1
Now, all’s OK, just mount it as ext4:
mount -t ext4 /dev/sdb1 /ext4
If you have converted /boot file system , you need to update /boot/grub.conf. Use your favourite editor to open this file, find out current kernel config section and append the following parameter:
Here is sample config:
title Ubuntu 8.10, kernel 184.108.40.206
kernel /boot/vmlinuz-220.127.116.11 ro quiet splash rootfstype=ext4
Save and close the file. And run update-grub:
Next, update your /etc/fstab file so that it can be mounted as ext4 file system by default. And finally, reboot your system:
All’s done, have a nice tour!