Friday, October 24, 2014

Linux convert ext4 to btrfs

Btrfs filesystem tool btrfs-convert can be used for convert ext2/ext3/ext4 to btrfs. Because of the copy on write algorithms of Btrfs it is posible to rollback the conversion even after you start using the converted file system.

The following is sample commands and output from an ext4 conversion to Btrfs in openSUSE 13.1. openSUSE will have Btrfs as the default filesystem from 13.2 which is going to be released next month. Go to openSUSE website for more information:

chris-linux:/home/chris # btrfs-convert /dev/sdb2
/dev/sdb2 is mounted
chris-linux:/home/chris # umount /dev/sdb2
chris-linux:/home/chris # btrfs-convert /dev/sdb2
creating btrfs metadata.
creating ext2fs image file.
cleaning up system chunk.
conversion complete.