Commit | Line | Data |
---|---|---|
34088780 CM |
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 | ||
22bb92f3 CM |
8 | Btrfs uses libcrc32c in the kernel for file and metadata checksums. You need |
9 | to compile the kernel with: | |
34088780 | 10 | |
22bb92f3 | 11 | CONFIG_LIBCRC32C=m |
34088780 | 12 | |
22bb92f3 CM |
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: | |
34088780 | 16 | |
22bb92f3 | 17 | modprobe libcrc32c |
34088780 CM |
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 |