Diff for "btrfs"


Differences between revisions 1 and 30 (spanning 29 versions)
Revision 1 as of 2009-01-14 21:08:02
Size: 310
Editor: 204
Comment: Initial TOC dump. To be revised later.
Revision 30 as of 2010-06-27 13:27:21
Size: 5208
Editor: wnpgmb1307w-ad02-206-224
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
Placeholder page for btrfs info and usage instructions. = What is btrfs? =
The B tree file system is a “copy-on-write (COW)” check-summed file system with multi-device support and writable snapshots.
Line 3: Line 4:
= What is btrfs = A snapshot is a frozen image of the file system at a point in time. This feature facilitates system rollback and instant backup when combined with supporting software.

Btrfs uses Rodeh's btrees which are COW friendly.

Check-summing is a data integrity method.

Multi-device support is part of the subvolume structure btrfs uses to grow a file system.

“A short history of btrfs” (LWN.NET July 22, 2009) by Valerie Aurora (formerly Henson) is available at [[http://lwn.net/Articles/342892/]]

More Information on btrfs is available at [[https://btrfs.wiki.kernel.org/index.php/Main_Page]] and [[http://en.wikipedia.org/wiki/Btrfs]]


== Features: ==
 * Extent based file storage (2^64 max file size)
 * Space efficient packing of small files
 * Space efficient indexed directories
 * Dynamic inode allocation
 * Writable snapshots
 * Subvolumes (separate internal filesystem roots)
 * Object level mirroring and striping
 * Checksums on data and metadata (multiple algorithms available)
 * Compression
 * Integrated multiple device support, with several raid algorithms
 * Online filesystem check
 * Very fast offline filesystem check
 * Efficient incremental backup and FS mirroring
 * Online filesystem defragmentation
Line 6: Line 35:
== Ubuntu 8.10 Intrepid ==
== Ubuntu 9.04 Jaunty ==
== Ubuntu 10.10 Maverick ==
Line 9: Line 37:
= How to use = Obtain the latest '''alternative''' install cd from [[http://cdimage.ubuntu.com/]]
Line 11: Line 39:
= Trouble shooting = Do a regular installation except use manual partitioning to create:
 * a ext2 or ext3 partition of about 512 to 1024 MB for /boot
 * a btrfs partition for /
 * a linux swap partition about 2.5 times your memory
Line 15: Line 46:
[http://btrfs.wiki.kernel.org/ btrfs home page]
[http://en.wikipedia.org/wiki/Btrfs btrfs wikipedia page]
== Ubuntu 8.10 Intrepid ==

=== PPA deb packages ===

[[https://launchpad.net/~brcha/+archive/ppa]]

Lines for sources.list.d:
{{{
deb http://ppa.launchpad.net/brcha/ppa/ubuntu intrepid main
deb-src http://ppa.launchpad.net/brcha/ppa/ubuntu intrepid main
}}}

Add the GPG key:
{{{
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 17f547c39c5c4071e254d0a7313d312748a22a95
}}}

Download module source and btrfs tools:
{{{
sudo apt-get install btrfs btrfs-progs module-assistant
}}}

Build and install kernel module:
{{{
sudo module-assistant auto-install btrfs
sudo modprobe btrfs
}}}

=== Compile from Source ===
'''NOT ACTUALLY WORKING YET'''

[[http://btrfs.wiki.kernel.org/index.php/Getting_started | btrfs wiki getting started page]]

==== Kernel Module Dependencies ====
8.10 Kernel 2.6.27-9-generic
 * CONFIG_LIBCRC32C=m
 * CONFIG_ZLIB_INFLATE=y
 * CONFIG_ZLIB_DEFLATE=m


 * build-essential: make, compiler, etc
 * linux-headers-2.6.27-9-generic: latest kernel headers

{{{
sudo apt-get install build-essential linux-headers-2.6.27-9-generic
}}}

Patch: [[http://permalink.gmane.org/gmane.comp.file-systems.btrfs/2562]]

Download, patch and compile code:
{{{
wget http://www.kernel.org/pub/linux/kernel/people/mason/btrfs/btrfs-0.17.tar.bz2
tar -jxvf btrfs-0.17.tar.bz2
cd btrfs-0.17
#apply patch
make
}}}

'''Currently btrfs does not work with kernel 2.6.27'''

Ensure modules are up and running, and insert btrfs module into kernel.
{{{
sudo modprobe libcrc32c zlib_inflate zlib_deflate
sudo insmod btrfs.ko
}}}

==== btrfs progs dependencies ====
{{{
sudo apt-get install e2fsprogs uuid-dev
}}}

{{{
wget http://www.kernel.org/pub/linux/kernel/people/mason/btrfs/btrfs-progs-0.17.tar.bz2
tar -jxvf btrfs-progs-0.17.tar.bz2
make
}}}

'''btrfs-progs compile fine'''


= How to Validate Filesystem Integrity =

Fsck a device:
{{{
btrfsck <device>
}}}

Scrub a directory:

Install btrfs-scrub using instructions at [[http://xercestech.com/how-to-scrub-btrfs.geek]]
{{{
btrfs-scrub Videos
}}}
The btrfs-scrub routine reads every file in the directory Videos. Use dmesg to view errors.

= How to Improve Filesystem Performance =

Balance the B-Tree:
{{{
btrfs filesystem balance /home/myhome
}}}
In this case the Rodeh b-trees in path /home/myhome are being balanced. This could take some time.

Defragment a directory:
{{{
sudo btrfs filesystem defragment Videos
}}}
All the files in the Videos directory are defragmented. Sudo is required to get ioctl access to the files.

= How to use =
 * How to format disk as btrfs
 * How to grow/shrink file system
 * How to create snapshots
 * How to access snapshots
 * How to convert ext2/3(/4?) partitions to btrfs
 * How to create an image of a btrfs file system
 * How to restore from an image of a btrfs file system
 * How to recover from a failed device
 * How to add another device to file system

[[http://btrfs.wiki.kernel.org/index.php/Category:Documentation|btrfs wiki documentation category]]

= Troubleshooting =

= Alternatives =
 * Tux3?
 * ZFS over Fuse?
 * Hammer FS (DragonFly BSD)

= Links =
 * [[http://btrfs.wiki.kernel.org/|btrfs home page]]
 * [[http://en.wikipedia.org/wiki/Btrfs|btrfs wikipedia page]]
 * [[http://geb.german-elite.net/blog.php?b=113| Installation BTRFS 0.18 on Ubuntu Intrepid(german)]]

What is btrfs?

The B tree file system is a “copy-on-write (COW)” check-summed file system with multi-device support and writable snapshots.

A snapshot is a frozen image of the file system at a point in time. This feature facilitates system rollback and instant backup when combined with supporting software.

Btrfs uses Rodeh's btrees which are COW friendly.

Check-summing is a data integrity method.

Multi-device support is part of the subvolume structure btrfs uses to grow a file system.

“A short history of btrfs” (LWN.NET July 22, 2009) by Valerie Aurora (formerly Henson) is available at http://lwn.net/Articles/342892/

More Information on btrfs is available at https://btrfs.wiki.kernel.org/index.php/Main_Page and http://en.wikipedia.org/wiki/Btrfs

Features:

  • Extent based file storage (2^64 max file size)
  • Space efficient packing of small files
  • Space efficient indexed directories
  • Dynamic inode allocation
  • Writable snapshots
  • Subvolumes (separate internal filesystem roots)
  • Object level mirroring and striping
  • Checksums on data and metadata (multiple algorithms available)
  • Compression
  • Integrated multiple device support, with several raid algorithms
  • Online filesystem check
  • Very fast offline filesystem check
  • Efficient incremental backup and FS mirroring
  • Online filesystem defragmentation

How to install

Ubuntu 10.10 Maverick

Obtain the latest alternative install cd from http://cdimage.ubuntu.com/

Do a regular installation except use manual partitioning to create:

  • a ext2 or ext3 partition of about 512 to 1024 MB for /boot
  • a btrfs partition for /
  • a linux swap partition about 2.5 times your memory

Ubuntu 8.10 Intrepid

PPA deb packages

https://launchpad.net/~brcha/+archive/ppa

Lines for sources.list.d:

deb http://ppa.launchpad.net/brcha/ppa/ubuntu intrepid main
deb-src http://ppa.launchpad.net/brcha/ppa/ubuntu intrepid main

Add the GPG key:

sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 17f547c39c5c4071e254d0a7313d312748a22a95

Download module source and btrfs tools:

sudo apt-get install btrfs btrfs-progs module-assistant

Build and install kernel module:

sudo module-assistant auto-install btrfs
sudo modprobe btrfs

Compile from Source

NOT ACTUALLY WORKING YET

btrfs wiki getting started page

Kernel Module Dependencies

8.10 Kernel 2.6.27-9-generic

  • CONFIG_LIBCRC32C=m
  • CONFIG_ZLIB_INFLATE=y
  • CONFIG_ZLIB_DEFLATE=m
  • build-essential: make, compiler, etc
  • linux-headers-2.6.27-9-generic: latest kernel headers

sudo apt-get install build-essential linux-headers-2.6.27-9-generic

Patch: http://permalink.gmane.org/gmane.comp.file-systems.btrfs/2562

Download, patch and compile code:

wget http://www.kernel.org/pub/linux/kernel/people/mason/btrfs/btrfs-0.17.tar.bz2
tar -jxvf btrfs-0.17.tar.bz2
cd btrfs-0.17
#apply patch
make

Currently btrfs does not work with kernel 2.6.27

Ensure modules are up and running, and insert btrfs module into kernel.

sudo modprobe libcrc32c zlib_inflate zlib_deflate
sudo insmod btrfs.ko

btrfs progs dependencies

sudo apt-get install e2fsprogs uuid-dev

wget http://www.kernel.org/pub/linux/kernel/people/mason/btrfs/btrfs-progs-0.17.tar.bz2
tar -jxvf btrfs-progs-0.17.tar.bz2
make

btrfs-progs compile fine

How to Validate Filesystem Integrity

Fsck a device:

btrfsck <device>

Scrub a directory:

Install btrfs-scrub using instructions at http://xercestech.com/how-to-scrub-btrfs.geek

btrfs-scrub Videos

The btrfs-scrub routine reads every file in the directory Videos. Use dmesg to view errors.

How to Improve Filesystem Performance

Balance the B-Tree:

btrfs filesystem balance /home/myhome

In this case the Rodeh b-trees in path /home/myhome are being balanced. This could take some time.

Defragment a directory:

sudo btrfs filesystem defragment Videos

All the files in the Videos directory are defragmented. Sudo is required to get ioctl access to the files.

How to use

  • How to format disk as btrfs
  • How to grow/shrink file system
  • How to create snapshots
  • How to access snapshots
  • How to convert ext2/3(/4?) partitions to btrfs
  • How to create an image of a btrfs file system
  • How to restore from an image of a btrfs file system
  • How to recover from a failed device
  • How to add another device to file system

btrfs wiki documentation category

Troubleshooting

Alternatives

  • Tux3?
  • ZFS over Fuse?
  • Hammer FS (DragonFly BSD)

Links

btrfs (last edited 2013-07-03 18:13:17 by localhost)