I have an existing install of Ubuntu 10.10, I have installed using ext4 as my filesystem. I want to change to btrfs.
1) Is this sane? If a reinstall is really the only sane way to do this, please let me know.
2) What is the safest way to do this?
I have enough space on the HDD to create another partition of equal size to the root partition and copy over the data, but will I have to make any changes in /etc
or anywhere else?
Thanks.
I think you will find a fresh install is the most hassle free way to do this. Bear in mind GRUB cannot currently boot from btrfs so you will need an additional ext3/4 partition for
/boot
.btrfs is marked as experimental, so it's not recommended. But it's your machine... I'd make sure I have backups of everything I cared about.
If it's just system data that you have ( ie from packages) then a fresh install is the way to go. You can keep your existing configuration by backing up the ones you want in
/etc
.The other way to do this is, if you have an external drive, you can
cp -rfp /
tomedia/your_external_drive
. After you unmount the disk, you can reboot into a live cd with the btrfs utils andmkbtrfs /dev/sda
( or whatever dev your disk is on ).This should preserve grub if you have installed it to the MBR. Then you can plug in your external media and copy back the files. Making sure to change /etc/fstab from ext4 to btrfs.
You could also do the same thing by splitting your drive in two as you mentioned. However if you wish to format your second partition as btrfs before copying, and use it as the root file system, you will also need to change your GRUB configuration to look at the new partition.
You will at least need to edit /etc/fstab to change
ext4
tobtrfs
, change the UUID (thanks Riccardo for reminding me!) and maybe add to or change the mount options (and make sure it gets copied to the initramfs too...). Plus the changes required to add a /boot partition of course.Also, remember that btrfs is still very new; it's more than likely that it still has lots of bugs. Make sure you don't put important data on it unless you have backups...