Skip to content

support btrfs for / #116

Closed
Closed

Description

I would really appreciate it if the raspberryPi kernel gets support to have a btrfs as root file system. Currently I need to compile my own kernel but keep the kernel as original as possible. The problem is that after a new kernel is installed my rPi doesn't boot. But when I just copy my 'older' kernel over I won't get the new upstream changes and fixes.

Activity

  1. edt-xx commented on Jan 20, 2013

    @edt-xx

    I would also love this. Since the PI is so limited by IO latency I would like to perform tests to see if using btrfs with lzo compression makes things faster. So I would require the btrfs and lzo modules to be built in.

  2. spacelama commented on Mar 7, 2013

    @spacelama

    It does depend on EXPERIMENTAL. But on the other hand, given how slow sdcards are at random writing, and given how few write cycles they have compared to "proper" SSD, the contiguous COW nature of BTRFS should extend the life of our pi filesystems substantially. No need to default to a btrfs filesystem, but please compile it into the kernel as ext4 has been, so it can be used for the root filesystem.

    (I'm guessing lvm wouldn't work either, because I can't see it in modules.builtin. Either one would suffice - whichever is smaller. LVM not so good, but at least we'd be able to have a minimal ext4 root, and everything else split out onto multiple logical volumes with btrfs)

  3. technion commented on Mar 7, 2013

    @technion

    If your goal is to achieve something experimental, are happy to compile your own kernel, and are frustrated by updates breaking it, the solution is to do updates this way:
    sudo SKIP_KERNEL=1 rpi-update (updates your firmware)
    git pull (from your kernel source directory)
    Compile and install as normal. It will retain your settings, and usually there are only a few changed files, meaning you can compile in a few minutes.

  4. edt-xx commented on Mar 8, 2013

    @edt-xx

    The experimental flag is pretty well meaningless. Think it disapears in
    .39. Btrfs may not be as feature complete as ext4 but it is already more
    feature rich. Bottom line is that it works, does the job well and has a
    good support community.
    On Mar 7, 2013 3:06 AM, "technion" notifications@github.com wrote:

    If your goal is to achieve something experimental, are happy to compile
    your own kernel, and are frustrated by updates breaking it, the solution is
    to do updates this way:
    sudo SKIP_KERNEL=1 rpi-update (updates your firmware)
    git pull (from your kernel source directory)
    Compile and install as normal. It will retain your settings, and usually
    there are only a few changed files, meaning you can compile in a few
    minutes.

    —
    Reply to this email directly or view it on GitHubhttps://github.com//issues/116#issuecomment-14547342
    .

  5. popcornmix commented on Oct 12, 2014

    @popcornmix
    Collaborator

    We build it as a module:
    CONFIG_BTRFS_FS=m

    So you are free to use it for non-root filesystems (e.g. create a btrfs partition that is mounted after the rootfs).

    I'm not sure it's worth embedding in the kernel as few people will need it and the module size suggests it will consume significant memory:

    -rw-rw-r-- 1 dc4 dc4 1042743 Sep  3 19:19 btrfs.ko
    
  6. P33M commented on Jul 14, 2015

    @P33M
    Contributor

    F2FS (flash-friendly-file-system) is preferable to btrfs. This is enabled by default on recent firmware.

    CONFIG_F2FS_FS=y
    CONFIG_F2FS_STAT_FS=y
    CONFIG_F2FS_FS_XATTR=y
    CONFIG_F2FS_FS_POSIX_ACL=y
    
  7. dsx724 commented on May 24, 2016

    @dsx724

    Can we reopen this issue? BTRFS is not very experimental anymore. F2FS is not the same thing. Compression alone is worth its weight in gold.

  8. dsx724 commented on May 24, 2016

    @dsx724

    Also F2FS in my experience has been far more unstable. The last version where I had an issue with BTRFS was kernel 3.16. F2FS is corruption prone for me to this day especially in emergency poweroff scenarios.

  9. 2 remaining items

  10. lapineige commented on Jun 13, 2023

    @lapineige

    Seconding this demand to reopen, it's a pain to setup right now while the filesystem has many advantages when using an external drive with a Raspberry Pi.

  11. SV-97 commented on Nov 16, 2023

    @SV-97

    Considering a reopen would be really nice. There's cases where ext isn't workable and the current way to get btrfs working is an absolute pain (I still couldn't get it to work) - especially for non-experts.

  12. XECDesign commented on Nov 16, 2023

    @XECDesign
    Contributor

    Why does it need to be re-opened? What's stopping people from using BTRFS right now?

    I believe in Raspberry Oi OS Bookworm, you should be able to convert to BTRFS without any issues as long as you don't use kernel_2712.

  13. pelwell commented on Nov 16, 2023

    @pelwell
    Contributor

    ...because Bookworm releases now use initramfs automatically, and the btrfs module is included.

  14. SV-97 commented on Nov 16, 2023

    @SV-97

    Thanks! I was looking for how to get btrfs to work since bullseye and was roughly following some older guides for the rpi4 and just kept on trying things along that line with bookworm which must've messed something up because I always got kernel panics when trying to use a btrfs root.

    In case someone else finds this thread when searching online: simply editing /etc/fstab and /boot/cmdline.txt for btrfs on a fresh image and running a btrfs-convert on the root partition appears to be working just fine (I also installed btrfs-progs prior to the convert which triggered a initramfs rebuild but that probably wouldn't be necessary)

    EDIT: I eventually (after a few reboot cycles) ran into some problems due to swap which prevented a boot. For my case it was sufficient and acceptable to simply permanently disable swap using (from Feriman's answer on the raspberry pi SE post How to permanently disable swap on Raspbian Stretch Lite)

    sudo dphys-swapfile swapoff
    sudo dphys-swapfile uninstall
    sudo update-rc.d dphys-swapfile remove
    sudo apt purge dphys-swapfile -y
    sudo sysctl -w vm.swappiness=0

    I haven't run into any other issues since.

  15. XECDesign commented on Nov 16, 2023

    @XECDesign
    Contributor

    That was even more straight-forward than I expected. Thanks for testing and reporting back.

  16. added a commit that references this issue on Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions