Removing btrfsctl, btrfs-vol, btrfs-show
[platform/upstream/btrfs-progs.git] / INSTALL
1 Install Instructions
2
3 Btrfs uses libcrc32c in the kernel for file and metadata checksums.  You need
4 to compile the kernel with:
5
6 CONFIG_LIBCRC32C=m
7
8 libcrc32c can be static as well.  Once your kernel is setup, typing make in the
9 btrfs module sources will build against the running kernel.  When the build is
10 complete:
11
12 modprobe libcrc32c
13 insmod btrfs.ko
14
15 The Btrfs utility programs require libuuid to build.  This can be found
16 in the e2fsprogs sources, and is usually available as libuuid or
17 e2fsprogs-devel from various distros.
18
19 Building the utilities is just make ; make install.  The programs go
20 into /usr/local/bin.  The mains commands available are:
21
22 mkfs.btrfs: create a filesystem
23
24 btrfs: control program to create snapshots and subvolumes:
25         # mount a btrfs filesystem
26         mount /dev/sda2 /mnt
27
28         # create a subvolume
29         btrfs subvolume create /mnt/new_subvol_name
30
31         # snapshot of a subvolume
32         btrfs subvolume snapshot /mnt/default /mnt/snapshot_of_default 
33         btrfs subvolume snapshot /mnt/snapshot_of_default \
34                 /mnt/snapshot_of_a_snapshot
35
36         # list of the subvolumes
37         ls /mnt
38         default snapshot_of_a_snapshot snapshot_of_new_subvol
39         new_subvol_name snapshot_of_default
40
41         # removal of a subvolume or a snapshot
42         btrfs subvolume delete /mn/snapshot_of_a_snapshot
43
44         # look a the btrfs man page for further information
45         man btrfs
46
47 btrfsck: do a limited check of the FS extent trees.</li>
48
49 btrfs-debug-tree: print all of the FS metadata in text form.  Example:
50
51         btrfs-debug-tree /dev/sda2 >& big_output_file
52
53
54