Comments on Boot On BTRFS With Debian
Boot On BTRFS With Debian This tutorial will explain you how to boot from a BTRFS filesystem with kernel 2.6.31-RC4 and BTRFS 0.19. BTRFS is a new filesystem with some really interesting features like online defragmenting and snapshots. BTRFS is an experimental filesystem, use at your own risk. The kernel used is also experimental.
11 Comment(s)
Comments
http://debian-live.alioth.debian.org/
If you're going to do it debian, do it right.
If you install Grub2, you might be able to boot directly from a BTRFS partition. If you don't have a spare machine on which losing the entire contents of the hard drive is acceptable, virtualization can come to the rescue.
Pretty good tutorial! I have a few points, though:
1. It is not necessary to patch the 2.6.30 kernel, as patched 2.6.31 kernels can be downloaded from the same URL as the patches; the latest is now the linux-2.6.31-rc5.tar.bz2 archive.
2. When running "make menuconfig" the BTRFS module is already marked (M); it is important that this be changed to (*) (as is the case with the EXT2 file system).
3. When booted with the Ubuntu 9.04 liveCD, just download the btrfs-tools package from packages.debian.org for unstable/Sid (either i386 or amd64 will work on the Ubuntu generic kernel), then install it with "dpkg -i btrfs*.deb". No need to "repeat step 2"...
Thanks!It's actually not necessary to mark the BTRFS and the EXT2 file systems with (*) to have them built-in to the kernel. If you use an initrd, it will load the needed file system modules before trying to mount the root file system. If the initrd is properly set up, that is (and it should be, as if by magic).
Hi everyone, thanks for the replies.
I was very busy for the last few days so I couldn't answer before.
Yes you can use any liveCD debian-based that you want, I used Ubuntu because it was on my desk already burned and I didn't want to download another liveCD.
For grub, I installed debian from netinstall CD and I had grub installed with it but I'll probably test with grub2 if I have some time. And if this works I'll update the tutorial to get the two methods in it.
Yes, you are right we can download the rc kernel without patching, but I didn't see the "F" link on kernel.org so I supposed that there were only the patch and the patch baseline but you can download the kernel here http://www.kernel.org/pub/linux/kernel/v2.6/testing/ and skip the patch step.
I don't think that marking BTRFS with * instead of using it as a module is that important. I'm just used to compile all the thing I always need without using a module. But since I make an initrd, I think this will boot properly but I haven't tested it.
Indeed you can use the web to download the package without using apt, I've repeated step2 to be sure there was no dependency problem. But in the actual version I don't think there is problems.
I'll try to find some time to test with grub2 and to see if BTRFS as module is enough to boot and if there is something to edit I'll do it.
Thanks for the comments.
Bad_crow
I think that you skipped the most important partition
/home
It saved my a*** so many times that don't even count Not to mention you can install another distribution without losing your desktop and other personal settings. Have switched from Fedora to Opensuse and end up with Debian without losing a single KDE and other application settings.
Never forget to create /home!
Cheers
Hi,
you don't need any additional partitions anymore, that's what btrfs is all about. Just create a subvolume and mount it whereever you want (mount -osubvol=thesubvolume ...). And then, I wouldn't create one for /home, but one for each users /home/<user>.
Bye...
Dirk
I did the very same with Ubuntu Karmic (alpha3) just yesterday. Karmic already comes with a 2.6.31rc kernel and the btrfs module available.
While the installer doesn't yet let you choose btrfs for the root filesystem, it can be made working with a few steps. I tried the btrfs-convert method, too, but that leaves the old ext3 filesystem meta data in place (wasted filesystem space for me) - snapshots cannot be deleted yet with btrfs 0.19.
Basically I did: use the alternate/netboot installer of Karmic, and created a standard installation with ext3 root / and ext2 boot/ filesystem first. Then I booted that up, and added the modules "btrfs" and "libcrc32c" and "zlib_deflate" and "crc32c" (VERY IMPORTANT!) to /etc/initramfs-tools/modules, then run a update-initramfs. /etc/fstab should be adapted then as well. I also copied those modules and mkfs.btrfs to /boot. After again booting to a livecd or alternate installer / rescue mode, you can then load the kernel modules (btrfs and crc32c) from boot/. And now the simplistic workaround to btrfs-convert: I just made a tar backup of my ext3 root filesystem to an external hdd (flash stick would have sufficed). Then I deleted the rootfs - with mkfs.btrfs - creating a clean root system. Mount the new btrfs root with -o compress,ssd options. Then I simply extracted the backup back onto the new btrfs root system. And voila, reboot, it works. (I had some error messages from cryptoroot, see /usr/share/initramfs/.../local-top/..., but it boots anyhow.)
Since I use a small 4GB ssd (compactflash), I wanted to try how much btrfs compression saves. The whole Karmic base system and ubuntu-desktop occupy just 1.0GB, instead of >3 GB I saw earlier. Seriously, this should become the new default for netbook distributions.
... you don't boot from btrfs. You boot from ext2. AFAICS grub still lacks support for btrfs.
Please take your article offline - it didn't make much sense at the time it was posted, but now it's completely outdated and less than worthless.
^This.^
BTRFS and linux have changed so much since this was written, than even trying to follow any of its ideas is downright dangerous. Please take this page offline.