Using The BTRFS Filesystem On Debian Lenny
This tutorial shows how you can build the kernel and tools to use the new BTRFS filesystem on Debian Lenny. Btrfs is a new copy on write filesystem for Linux aimed at implementing advanced features while focusing on fault tolerance, repair and easy administration.
Obtaining And Compiling A 2.6.29 Kernel
First, we must download the kernel source, unpack it and copy the actual kernel configuration to the source directory. This reduces the required changes to the kernel configuration to a minimum. Of course, we can change more in the configuration if we want. We also have to install some packages which are required to succesfully compile the kernel.
apt-get install bzip2 libncurses5-dev kernel-package zlib1g-dev
cd /usr/src
wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.29.tar.bz2
tar -xvjf linux-2.6.29.tar.bz2
cp /boot/config-`uname -r` /usr/src/linux-2.6.29/.config
Then we must configure the new kernel:
cd linux-2.6.29
make menuconfig
We should change at least two parameters in the kernel config. One is required, the second one is recommended.
File systems -> Btrfs filesystem (EXPERIMENTAL) Unstable disk format
Processor type and features -> Processor Family -> "our processor"
In both cases we have to type space when we highlight the right option. When we choose the processor we are back one level down and we can see our choosen processor next to "Processor family". When we choose Btrfs filesystem we can see an asterisk <*> right before "Btrfs filesystem".
Then we must tap ESC key two or more times and answer yes to the question of saving file changes. Now we can start to compile the kernel which takes some time.
make-kpkg linux-image linux-headers --initrd
Now we can install our brand new kernel:
cd ..
dpkg -i linux-image-2.6.29_2.6.29-10.00.Custom_i386.deb
dpkg -i linux-headers-2.6.29_2.6.29-10.00.Custom_i386.deb
After that we should reboot the computer and run it with the new kernel.
Compiling BTRFS Tools
cd /home/filip
Of course we use here our home directory.
apt-get install uuid-dev e2fslibs-dev libacl1-dev
wget http://www.kernel.org/pub/linux/kernel/people/mason/btrfs/btrfs-progs-0.18.tar.gz
tar -xvzf btrfs-progs-0.18.tar.gz
cd btrfs-progs-0.18
make
make convert
make install
Now we have all and we can start using disks in btrfs format.