Guides & Solutions (No Questions)Post your guides here (No links to Blogs accepted). You can also append your comments/questions to a guide, but don't start a new thread to ask a question. Use another forum for that.

One of the cool features in Fedora 13 is better support for the next Linux file system Btrfs.

However, there are two limitations:
1. Due to the stability concern, Anaconda can only create Btrfs partition when paring btrfs parameter during DVD installation process. This leaves the users who upgrade from previous releases or use other installation media out of the scope.
2. AFAIK, though btrfs parameter was passed, Anaconda can only format the partition as btrfs, which is a destructible operation to the data. Unless you are new to Fedora, there will be many files sitting in the /home partition. Backing up and re-formatting are possible but difficult.

This HOWTO provides a workaround to the limitations above, which means you can still enjoy btrfs in Fedora 13 no matter what installation media you used and without the annoying backing up stuff.

CAUTION: This is not and never meant to be a step-by-step guide because I suppose the users who want to try btrfs have sufficient knowledge in relative areas. What they need is a successful case LIKE THIS to motivate themselves.

OK, Let's start the revolution on your hard drive.

STEP 1: Get the Fedora 13 installed on your hard drive. No matter by which way, on either ext3 or ext4 file system type. Remember the partition number of the ones you would like to convert to btrfs latter.

STEP 2: Install the btrfs toolbox, which is not installed by default without btrfs parameter. System needs them when booting from a btrfs partition.

Code:

su -c 'yum install btrfs-progs'

STEP 3: Get a Fedora 13 LiveCD or LiveUSB. There are plenty of tutorials around on this topic. When succeed, restart the computer and boot form the Live media.

STEP 4: Gain root privilege in Live. Then install the btrfs tool box in the Live media using the identical commend above. We need to use the btfs-convert inside that toolbox.

STEP 5: Replace your actually partition name with <your_partition_name> in the following command

Code:

btrfs-convert <your_partition_name>

It would take some time depending on the size of partition. My 400G ext4 partition takes almost 2 hours to be converted. So be patient.
Repeat this steps if you have several partitions to be converted.

CAUTION: DO NOT ATTEMPT TO CONVERT /boot PARTITION !

STEP 6: Use blkid to see the new UUID for converted partition. Edit /etc/fstab (the one on the HARD DRIVE, NOT LIVE MEDIA) according to those UUIDs. Do not forget to change the partition type ! You may want to add compress mount option, too. Also, ssd for SSD users.
If you converted / partition, you probably need to edit /boot/grub/grub.conf (same,the one on the HARD DRIVE, NOT LIVE MEDIA ) kernel boot line as well.

STEP 7: Fix the SELinux context by create an empty file called .autorelabel in / partition of HARD DRIVE. 'touch' would do the job. It is the simplest way if you converted the / partition. 'restorecon' would work if it does not required auto-mount during booting.

STEP 8: Restart the computer and boot into Fedora 13 on the HARD DRIVE. It might take some time if .autorelabel file was created.

CONGRATULATIONS! Btrfs is on your disk and your data is there, too. Enjoy those tempting btrfs features crowed on the recent Linux press.

Even if you are not happy, you can roll back to previous file system! The procedure is similar, except in STEP 5 using these command:

Code:

btrfs-convert -r <your_partition_name>

When you think you are ready to settle down on btrfs land, you can delete the snapshot of original file system:

Code:

btrfs subvolume delete <your_btrfs_partition_mount_point>/ext2_saved

That's all. Hope you have a good time with Btrfs!

Appreciation to @sirpengi @ender2070 @eeefak on Identi.ca AND hyperair on IRC #btrfs.