4

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.

1
  • If I use the spare space as a temporary holding-space for my data, copying it there, reformatting the original root partition to btrfs and copying my files back to the partition they started on, will this mitigate the need for any changes which would otherwise have been required?
    – Jeremy
    Oct 17, 2010 at 9:14

3 Answers 3

7

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.

1
  • A 150/200 mb ext2 partition will be more than enough for the purpose. If you have 4 kernels installed at the same time, it takes only about 60mb of space. No need to use ext3/ext4 for such a small partition.
    – jumbli
    Oct 18, 2010 at 7:17
3

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 / to media/your_external_drive. After you unmount the disk, you can reboot into a live cd with the btrfs utils and mkbtrfs /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.

1
0

You will at least need to edit /etc/fstab to change ext4 to btrfs, 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...

1
  • If your /etc/fstab uses UUID to locate the root partition, remember to change those as well -- or just switch to the old-fashioned device name. Oct 17, 2010 at 19:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .