ext3 is a journaled file system that is commonly used by the Linux kernel. It is the default file system for many popular Linux distributions, including Debian. Stephen Tweedie. On June 28, 2006, Theodore Ts'o, the principal developer of ext3, announced an enhanced version, called ext4. Today, we will show how to convert ext3 to ext4 format on CentOS.
System environment:
Release version : CentOS release 5.4(Final)
Kernel: Linux localhost.localdomain 2.6.18-164.el5 #1 SMP Thu Sep 3 03:28:30 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux
Assume the partition be to converted is /dev/sda7 which is mounted on /data0 directory.
First, install the ext4 support
yum install -y e4fsprogs
Then unmount /dev/sda7
umount /dev/sda7
If the partition is in use and it cannot be unmounted, please use :
lsof | grep data0
to check what processes are using /data0 directory and then kill those processes. After than, unmount /dev/sda7 again.
Then activate ext4 on ext3 partition
tune4fs -O extents,uninit_bg,dir_index /dev/sda7
Then refine the converted ext4 partition
e4fsck -yfDC0 /dev/sda7
Lastly remount /dev/sda7 to /data0
mount /dev/sda7 /data0
We now can use mount to check format of /dev/sda7:
[root@localhost data0]# mount /dev/sda1 on / type ext3 (rw) proc on /proc type proc (rw) sysfs on /sys type sysfs (rw) ............................. /dev/sda7 on /data0 type ext4 (rw)
No, that's not done. One more step, please remember to change format of respective records in /etc/fstab to ext4.
Source : http://www.elmerzhang.com/2011/03/change-filesystem-from-ext3-to-ext4-centos/