The debian "lenny" release comes with version 2.6.26-2 of the linux kernel. This kernel does not yet have support for BTRFS, so we'll download, compile and install the latest stable kernel release.
# install some required packages as root su aptitude install install bzip2 fakeroot kernel-package libncurses5-dev zlib1g-dev exit # download and extract linux kernel wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-184.108.40.206.tar.bz2 tar -xvjf linux-220.127.116.11.tar.bz2 cd linux-18.104.22.168 # copy existing kernel configuration from /boot cp /boot/config-2.6.26-2-686 .config # edit kernel configuration (navigate with arrows, toggle options with space) # - under "File Systems, enable "Btrfs filesystem (EXPERIMENTAL)" # - under "Virtualization", disable "Linux hypervisor example code" # # You can also take this opportunity to optimize the kernel for your CPU # architecture under "Processor type and features" - "Processor family" # Examine the output of "cat /proc/cpuinfo" if you're not sure of your CPU. make menuconfig # build kernel (this takes a while, especially on old machines) make-kpkg --rootcmd fakeroot --initrd linux-image linux-headers # install new kernel packages and reboot cd .. su dpkg -i linux-image-22.214.171.124_126.96.36.199-10.00.Custom_i386.deb dpkg -i linux-headers-188.8.131.52_184.108.40.206-10.00.Custom_i386.deb reboot
If everything went well, the system should boot up under the new kernel. If something goes wrong, you still have the option of booting under the old kernel by using the grub menu at startup.
Now we have a kernel with support for the btrfs filesystem, but still no userspace tools to use it. We'll download, compile and install the latest version of those tools:
aptitude install git-core uuid-dev e2fslibs-dev libacl1-dev git clone git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-progs-unstable.git cd btrfs-progs-unstable make su make install exit
Now we have mkfs.btrfs to create a BTRFS file system, and some other tools to manage such a filesystem. We'll start playing around with those in the next post.