blob: 16b45a56878df88a17776194c49bcfb102338fbc [file] [log] [blame]
Chris Mason34088782007-06-12 11:36:58 -04001Install Instructions
2
3Btrfs puts snapshots and subvolumes into the root directory of the FS. This
4directory can only be changed by btrfsctl right now, and normal filesystem
5operations do not work on it. The default subvolume is called 'default',
6and you can create files and directories in mount_point/default
7
Chris Mason22bb92f2007-06-22 14:49:31 -04008Btrfs uses libcrc32c in the kernel for file and metadata checksums. You need
9to compile the kernel with:
Chris Mason34088782007-06-12 11:36:58 -040010
Chris Mason22bb92f2007-06-22 14:49:31 -040011CONFIG_LIBCRC32C=m
Chris Mason34088782007-06-12 11:36:58 -040012
Chris Mason22bb92f2007-06-22 14:49:31 -040013libcrc32c can be static as well. Once your kernel is setup, typing make in the
14btrfs module sources will build against the running kernel. When the build is
15complete:
Chris Mason34088782007-06-12 11:36:58 -040016
Chris Mason22bb92f2007-06-22 14:49:31 -040017modprobe libcrc32c
Chris Mason34088782007-06-12 11:36:58 -040018insmod btrfs.ko
19
20The Btrfs utility programs require libuuid to build. This can be found
21in the e2fsprogs sources, and is usually available as libuuid or
22e2fsprogs-devel from various distros.
23
24Building the utilities is just make ; make install. The programs go
25into /usr/local/bin. The commands available are:
26
27mkfs.btrfs: create a filesystem
28
29btrfsctl: 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
43btrfsck: do a limited check of the FS extent trees.</li>
44
45debug-tree: print all of the FS metadata in text form. Example:
46
47 debug-tree /dev/sda2 >& big_output_file
48