Slide 1

Slide 1 text

Btrfs: A “Next Generation” File System A gentle introduction Pavlos Ratis dastergon@gentoo.org FOSSCOMM 2014 Pavlos Ratis (dastergon@gentoo.org) Btrfs: A “Next Generation” File System FOSSCOMM 2014 1 / 24

Slide 2

Slide 2 text

About me Undergraduate Informatics Engineer @ T.E.I of Central Macedonia Gentoo Linux Developer since late 2012 Greek Gentoo Linux Community Member Pavlos Ratis (dastergon@gentoo.org) Btrfs: A “Next Generation” File System FOSSCOMM 2014 2 / 24

Slide 3

Slide 3 text

Outline 1 Introduction 2 Design & Architecture 3 Features 4 Future 5 Conclusion Pavlos Ratis (dastergon@gentoo.org) Btrfs: A “Next Generation” File System FOSSCOMM 2014 3 / 24

Slide 4

Slide 4 text

Introduction B-tree FS, Butter FS, Better FS, Bee Tee Arr Eff Ess Supported OS: Linux License: GPL History First Development: Oracle, 2007 Introduced: Linux kernel 2.6.29, 2009 Orgs Facebook Fujitsu Google Linux Foundation Oracle Red Hat SUSE Pavlos Ratis (dastergon@gentoo.org) Btrfs: A “Next Generation” File System FOSSCOMM 2014 4 / 24

Slide 5

Slide 5 text

Outline 1 Introduction 2 Design & Architecture 3 Features 4 Future 5 Conclusion Pavlos Ratis (dastergon@gentoo.org) Btrfs: A “Next Generation” File System FOSSCOMM 2014 5 / 24

Slide 6

Slide 6 text

Structure B-Tree data structure Max file/volume size: 16 EB Max file numbers: 16 EB Max file name length: 255 chars File allocation: extent Pavlos Ratis (dastergon@gentoo.org) Btrfs: A “Next Generation” File System FOSSCOMM 2014 6 / 24

Slide 7

Slide 7 text

First steps Get it! btrfs-progs / btrfs-tools (Gentoo, Debian, openSUSE, Fedora, etc) Create a new file system # mkfs.btrfs -L label /dev/partition # mount /dev/partition /mnt/btrfs # edit /etc/fstab Pavlos Ratis (dastergon@gentoo.org) Btrfs: A “Next Generation” File System FOSSCOMM 2014 7 / 24

Slide 8

Slide 8 text

Viewing filesystem information View allocated space # btrfs filesystem df / Data, single: total=121.01GiB, used=112.24GiB System, DUP: total=8.00MiB, used=24.00KiB System, single: total=4.00MiB, used=0.00 Metadata, DUP: total=11.00GiB, used=1.96GiB Metadata, single: total=8.00MiB, used=0.00 Showing Btrfs partition info # btrfs filesystem show /dev/partition Label: ’gentoo64’ uuid: dcea671d-b166-41cb-8cfd-60cff921ddc5 Total devices 1 FS bytes used 114.20GiB devid 1 size 538.17GiB used 143.04GiB path /dev/partition Pavlos Ratis (dastergon@gentoo.org) Btrfs: A “Next Generation” File System FOSSCOMM 2014 8 / 24

Slide 9

Slide 9 text

Outline 1 Introduction 2 Design & Architecture 3 Features 4 Future 5 Conclusion Pavlos Ratis (dastergon@gentoo.org) Btrfs: A “Next Generation” File System FOSSCOMM 2014 9 / 24

Slide 10

Slide 10 text

Btrfs Features 1 Copy-on-Write(CoW) Deduplication File cloning(reflink) Multi device support Volume manager Subvolumes Online Resizing Built-in RAID support Quota support Pavlos Ratis (dastergon@gentoo.org) Btrfs: A “Next Generation” File System FOSSCOMM 2014 10 / 24

Slide 11

Slide 11 text

Managing Btrfs Creating a sub-volume # btrfs subvolume create home Listing sub-volumes # btrfs subvolume list . ID 257 gen 218770 top level 5 path home Online Resizing Growing: # btrfs filesystem resize +2G /mnt/btrfs/home Shrinking:# btrfs filesystem resize -4G /mnt/btrfs/home Pavlos Ratis (dastergon@gentoo.org) Btrfs: A “Next Generation” File System FOSSCOMM 2014 11 / 24

Slide 12

Slide 12 text

Btrfs Features 2 Checksums (Data & Metadata) Online Scrubbing Online Balancing Online file system defragmentation Offline file system check (btrfsck) Transparent compression (ZLIB, LZ0) SSD optimizations / TRIM support Pavlos Ratis (dastergon@gentoo.org) Btrfs: A “Next Generation” File System FOSSCOMM 2014 12 / 24

Slide 13

Slide 13 text

Defragmentation / Scrubbing Online defrag # btrfs filesystem defragment -r / Online scrubbing # btrfs scrub start / Pavlos Ratis (dastergon@gentoo.org) Btrfs: A “Next Generation” File System FOSSCOMM 2014 13 / 24

Slide 14

Slide 14 text

Sysadmin Perspective RAID (1,0,10,5,6) support Snapshots & Rollback Manually Snapper: Awesome Snapshotting Tool Misc scripts Send/Receive changes Pavlos Ratis (dastergon@gentoo.org) Btrfs: A “Next Generation” File System FOSSCOMM 2014 14 / 24

Slide 15

Slide 15 text

Managing Snapshots manually Creating a snapshot # btrfs subvolume snapshot /mnt/btrfs/home /mnt/btrfs/home/snapshot Rolling back a snapshot # mount /mnt/btrfs # umount /home # mount -o defaults,subvol=home snapshot 28042014 /dev/sda /home # btrfs subvolume delete /mnt/btrfs/home # mv /mnt/btrfs/home snapshot 28042014 /mnt/btrfs/home # umount /mnt/btrfs Pavlos Ratis (dastergon@gentoo.org) Btrfs: A “Next Generation” File System FOSSCOMM 2014 15 / 24

Slide 16

Slide 16 text

Outline 1 Introduction 2 Design & Architecture 3 Features 4 Future 5 Conclusion Pavlos Ratis (dastergon@gentoo.org) Btrfs: A “Next Generation” File System FOSSCOMM 2014 16 / 24

Slide 17

Slide 17 text

Limitation No Swap files No built-in encryption support dm-crypt / LUKS TrueCrypt EncFS RAID 5/6 Pavlos Ratis (dastergon@gentoo.org) Btrfs: A “Next Generation” File System FOSSCOMM 2014 17 / 24

Slide 18

Slide 18 text

Future Features Improved offline file system check Online file system check More compression: Snappy, LZ4 Alternative checksum algorithms Completion of RAID 5/6 Pavlos Ratis (dastergon@gentoo.org) Btrfs: A “Next Generation” File System FOSSCOMM 2014 18 / 24

Slide 19

Slide 19 text

Outline 1 Introduction 2 Design & Architecture 3 Features 4 Future 5 Conclusion Pavlos Ratis (dastergon@gentoo.org) Btrfs: A “Next Generation” File System FOSSCOMM 2014 19 / 24

Slide 20

Slide 20 text

Btrfs wins Production use in Jolla Facebook (Currently: Testing for production use) Default file system in openSUSE 13.2 Support in SUSE Linux Enterprise 11 SP2 Support in Docker Pavlos Ratis (dastergon@gentoo.org) Btrfs: A “Next Generation” File System FOSSCOMM 2014 20 / 24

Slide 21

Slide 21 text

ext* VS Btrfs Offline ext3/4 to Btrfs migration BACKUP YOUR DATA FIRST! ... # btrfs-convert /dev/partition ... Pavlos Ratis (dastergon@gentoo.org) Btrfs: A “Next Generation” File System FOSSCOMM 2014 21 / 24

Slide 22

Slide 22 text

Contribute Website: https://btrfs.wiki.kernel.org/ Mailing list: http://bit.ly/1j3cjpv Bugzilla: http://bit.ly/1floheK Pavlos Ratis (dastergon@gentoo.org) Btrfs: A “Next Generation” File System FOSSCOMM 2014 22 / 24

Slide 23

Slide 23 text

Q&A Pavlos Ratis (dastergon@gentoo.org) Btrfs: A “Next Generation” File System FOSSCOMM 2014 23 / 24

Slide 24

Slide 24 text

Thank you! Pavlos Ratis http://blog.dastergon.gr Twitter: @dastergon Pavlos Ratis (dastergon@gentoo.org) Btrfs: A “Next Generation” File System FOSSCOMM 2014 24 / 24