Erik @ IMH

How To Upgrade From Ext3 To Ext4 Without Formatting The Hard Disk

Archived post, originally published March 31, 2010. Kept for reference — commands and package names reflect the distributions of the time and may have changed.

Disclaimer: ALWAYS BACKUP YOUR DATA WHEN MAKING ANY CHANGES TO ANY FILE SYSTEMS. I will not be held responsible for any damage that you may incur as a result of following these instructions, and this should be used for informational purposes only, and as an outline of a process that worked for me on my particular hardware. KTHX.

First of all, make sure you have a fully updated system, regardless of your Ubuntu version.

Press Alt + F2 on your keyboard and type in

update-manager -d

The Update Manager will appear. Click on the Upgrade button. After the updates have completed, close and move on...

Now go to System->Partition Editor. This will show all the partition in your hard disk. Record down the filesystem ID of the partition that you want to convert to ext4.

Now, open a terminal and type the following:

sudo tune2fs -O extents,uninit_bg,dir_index /dev/XXXXXX

(Replace XXXX with the filesystem ID that you learned earlier)

sudo fsck -pf /dev/XXXXXX

Now, mount the drive:

sudo mount -t ext4 /dev/XXXXXX /mnt

You will now need to edit your system's fstab file, which you can find in /mnt/etc/fstab (after mounting above) and change the ext3 entry to ext4.

Now you're done, reinstall grub, reboot, and cross ya fingahz:

sudo grub-install /dev/XXXXXX 
shutdown -r now

:-)