Skip to content

Migrate ext3 to ext4

2009 February 4
by Philippe Delodder

I have now a kernel 2.6.28 on my system and going to try out the new ext4 filesystem. From 2.6.28 kernel the ext4 filesystem is stable, so lets give it a go…

Before you can start converting you need to boot into a livecd. I used the daily-live cd of jaunty.

Now lets start converting:

sudo tune2fs -O extents,uninit_bg,dir_index /dev/sdb1
sudo fsck -pf /dev/sdb1

Now after this is done you can mount your converted to ext4 partition:

sudo mount -t ext4 /dev/sdb1 /mnt

Don’t forget to change the filesystem type from ext3 to ext4 in the fstab file… :

sudo vim /mnt/etc/fstab

Another option is simple mount it as an ext4 filesystem with the conversion.  It will use only the features that don’t change the file format, such as mballoc or delayed allocation. You can find the mount statement above.

Found the information here.

One Response leave one →
  1. December 9, 2009

    Don’t forget to mention this:

    “There’s another thing that must be mentioned. All your existing files will continue using the old indirect mapping to map all the blocks of data. The online defrag tool will be able to migrate each one of those files to a extent format (using a ioctl that tells the filesystem to rewrite the file with the extent format; you can use it safely while you’re using the filesystem normally)”

    In other words, migrating from ext3 to ext4 does NOT give you all the benefits of ext4. Existing files won’t use extents.

Leave a Reply

Note: You can use basic XHTML in your comments. Your email address will never be published.

Subscribe to this comment feed via RSS

Bad Behavior has blocked 116 access attempts in the last 7 days.