Migrate ext3 to ext4
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.
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.