I started with a few specific goals. First, of course, was just to get my new system on btrfs and make sure it would boot, successfully. Next, I wanted it to use my two fast internal drives in a RAID-0 configuration. Finally, I decided I would try not having /home on separate partitions, but making it a subvolume of the main filesystem.
So, first I created two 40 GB partitions, one on each disk drive. Next, I installed Hot Dog to one of the partitions, letting bbqinstaller format it as ext4. Then I made the grub config and verified that the new system would boot.
Next, I booted to another Linux system (a live iso would do just as well), because the filesystem being converted cannot be mounted. The command to do the conversion was simple:
Code: Select all
btrfs-convert /dev/sda6
The next step was to add the other partition on the other drive to the btrfs array. Since this was being done to an existing filesystem, it was necessarily a two-step process:
Code: Select all
btrfs device add /dev/sdb6 /
btrfs balance start -dconvert=raid0 -mconvert=raid1 /
The final thing I wanted to accomplish was to make /home into a btrfs subvolume instead of simply a directory under root. It took a little thought, but it was easy in the end. I did this as root so that no one would be using /home while I made the change:
Code: Select all
mv /home /homeold
btrfs subvolume create /home
cp -ar /homeold/* /home
So, that's it. Not too bad, was it?
Tim
ADDENDUM 9-Oct-2014
Well, I had some problems, some simple and some not so much. I think I am to a "solid" place now.
1) Since the filesystem was converted, it came to have a different UUID from the original ext4. At least, I think that's why it changed. So, I had to edit fstab with the new UUID.
2) Also, even though it didn't seem to be causing problems, I also edited the filesystem in fstab to include the standard options for btrfs, "rw,relatime,space_cache". And I edited the filesystem type from ext4 to btrfs. Finally, I made the final field a 0 instead of 1, because btrfs's should not be fsck'ed.
3) This was the difficult problem. The filesystem became full, even though it was 80 GB in size and less than three GB were being used. It could not be written to because of being full. I tried a lot of stuff and did a lot of searches. To make a long story short, I fixed it by remounting it as rw, then running "btrfs subv delete /ext2_saved". That was a subvolume where btrfs had saved the ext4 filesystem when the btrfs-convert was run. After that, I ran "btrfs balance start /", which relocated all of the filesystem's data chunks.