Saturday, December 18, 2010

Howto Convert Ext3 filesystem to Ext4 Filesystem without Reinstalling OS in Ubuntu

You can convert your existing Ext3 filesystem to Ext4 with an easy procedure.

Things to remember
  • Unmount the filesystem before convert
  • Filesystem must be non-root
This way you can improve the performance, storage limits and features of your existing filesystem without reformatting and/or reinstalling your OS and softwares.

First, unmount the partition: umount /dev/sda2 (change sda2 with your Drive)

Next, run a filesystem check on it to make sure it is in sane condition.

fsck.ext3 -pf /dev/sda2
Enable new features of ext4 on the filesystem
tune2fs -O extents,uninit_bg,dir_index /dev/sda2
Run a filesystem check. to make sure that the filesystem is now clean.
fsck -pf /dev/sda2
Now edit your /etc/fstab file and replace "ext3" with "ext4" for /dev/sda1. Other options may differ for your system.
/dev/sda2 /disk ext4 defaults 0 2
Try to mount your new ext4 filesystem: mount /disk