Monday, July 27, 2009

How to convert Ext2/Ext3 file system to Ext4 (in 9.04 Jaunty Jackalope)

First of all make sure you have Ubuntu 9.04 installed so that you have an Ext3 file-system.

- Back-up all of your valued data.

- To convert the partition, reboot from the real CD, and run this code:

sudo bash
tune2fs -O extents,uninit_bg,dir_index /dev/sda1
e2fsck -pf /dev/sda1

In this case, the partiton you need to convert is /dev/sda1.

-Next, you must change Ext3 to Ext4 quite simply like below,

# /dev/sda1
UUID=XXXXXXXXXXXXXXXXXXXXXX / ext3
relatime,errors=remount-ro 0 1

Change this code to:

# /dev/sda1
UUID=XXXXXXXXXXXXXXXXXXXXXX / ext4
relatime,errors=remount-ro 0 1

No doubt you can tell that all that has changed is Ext3 and Ext4! You now MUST save the changes.

If you are upgrading from ext2 to ext4, when converting the partition use this code instead:

sudo bashtune2fs -O extents,uninit_bg,dir_index,has_journal /dev/sda1
e2fsck -pf /dev/sda1

That should be it for most people, all you need to restart your computer and voila, you are now running from an Ext 4 file system. However, if you come across the dreaded error 13 when restarting, it might be because it did not like one of the updates. This might help though,

sudo bashmount /dev/sda1 /mnt
grub-install /dev/sda –root-directory=/mnt –recheck

You have now successfully completed the conversion! enjoy !

No comments: