Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive
 

btrfs has some nice features. That's why it makes sense to convert the root filesystem of a Raspberry running RaspbianOS from ext4 to btrfs.

Note: The following instructions require basic Linux knowledge because it's just a memory aid for me and the instructions are not very detailed.

 

Prerequisites

  1. A running RaspbianOS which uses ext4 for the root filesystem
  2. A second SD card the same OS
  • Update the system
    sudo apt-get update
    sudo apt-get upgrade
    
  • Install required tools
    sudo apt-get install btrfs-tools initramfs-tools
    
  • Add btrfs to initramfs modules
    echo 'btrfs' | sudo tee -a /etc/initramfs-tools/modules
    
  • Initramfs updaten
    sudo update-initramfs -c -k $(uname -r)
    
  • Reboot und check dass btrfs unterstützt wird
    dmesg | grep -i btrfs
    
  • Optional: Backup your system
  • Boot the seconds RaspbianOS with the same kernel level and attach the SD card with the system to convert
  • Check filesystem for errors
    sudo fsck.ext4 /dev/<zu konvertierende partition>
  • Convert the ext4 filesystem to btrfs
    sudo btrfs-convert /dev/<zu konvertierende partition>
  • Update cmdline.txt with the UUID of the new root filesystem and update the filesystem used from ext4 to btrfs. Use follwoing command to retrieve the required informatio
    lsblk -fs
  • Update /etc/fstab with zje UUIDs of the boot and root partition and update the filesystem used from ext4 to btrfs

  • Boot the converted system and enjoy the btrfs features

 

 References

Debian btrfs Wiki

btrfs rootfilesystem on Raspberry

 

Add comment

*** Note ***

Comments are welcome. But in order to reject spam posts please consider following rules:
  1. Comments with string http are rejected with message You have no rights to use this tag
  2. All comments are reviewed by hand and thus it usually takes one day until a comment will be published.