Chris Mason | 3408878 | 2007-06-12 11:36:58 -0400 | [diff] [blame] | 1 | Install Instructions |
| 2 | |
| 3 | Btrfs puts snapshots and subvolumes into the root directory of the FS. This |
| 4 | directory can only be changed by btrfsctl right now, and normal filesystem |
| 5 | operations do not work on it. The default subvolume is called 'default', |
| 6 | and you can create files and directories in mount_point/default |
| 7 | |
Chris Mason | 22bb92f | 2007-06-22 14:49:31 -0400 | [diff] [blame] | 8 | Btrfs uses libcrc32c in the kernel for file and metadata checksums. You need |
| 9 | to compile the kernel with: |
Chris Mason | 3408878 | 2007-06-12 11:36:58 -0400 | [diff] [blame] | 10 | |
Chris Mason | 22bb92f | 2007-06-22 14:49:31 -0400 | [diff] [blame] | 11 | CONFIG_LIBCRC32C=m |
Chris Mason | 3408878 | 2007-06-12 11:36:58 -0400 | [diff] [blame] | 12 | |
Chris Mason | 22bb92f | 2007-06-22 14:49:31 -0400 | [diff] [blame] | 13 | libcrc32c can be static as well. Once your kernel is setup, typing make in the |
| 14 | btrfs module sources will build against the running kernel. When the build is |
| 15 | complete: |
Chris Mason | 3408878 | 2007-06-12 11:36:58 -0400 | [diff] [blame] | 16 | |
Chris Mason | 22bb92f | 2007-06-22 14:49:31 -0400 | [diff] [blame] | 17 | modprobe libcrc32c |
Chris Mason | 3408878 | 2007-06-12 11:36:58 -0400 | [diff] [blame] | 18 | insmod btrfs.ko |
| 19 | |
| 20 | The Btrfs utility programs require libuuid to build. This can be found |
| 21 | in the e2fsprogs sources, and is usually available as libuuid or |
| 22 | e2fsprogs-devel from various distros. |
| 23 | |
| 24 | Building the utilities is just make ; make install. The programs go |
| 25 | into /usr/local/bin. The commands available are: |
| 26 | |
| 27 | mkfs.btrfs: create a filesystem |
| 28 | |
| 29 | btrfsctl: control program to create snapshots and subvolumes: |
| 30 | |
| 31 | mount /dev/sda2 /mnt |
| 32 | btrfsctl -s new_subvol_name /mnt |
| 33 | btrfsctl -s snapshot_of_default /mnt/default |
| 34 | btrfsctl -s snapshot_of_new_subvol /mnt/new_subvol_name |
| 35 | btrfsctl -s snapshot_of_a_snapshot /mnt/snapshot_of_new_subvol |
| 36 | ls /mnt |
| 37 | default snapshot_of_a_snapshot snapshot_of_new_subvol |
| 38 | new_subvol_name snapshot_of_default |
| 39 | |
| 40 | Snapshots and subvolumes cannot be deleted right now, but you can |
| 41 | rm -rf all the files and directories inside them. |
| 42 | |
| 43 | btrfsck: do a limited check of the FS extent trees.</li> |
| 44 | |
| 45 | debug-tree: print all of the FS metadata in text form. Example: |
| 46 | |
| 47 | debug-tree /dev/sda2 >& big_output_file |
| 48 | |