btrfs-progs: Add information about libblkid requirement to INSTALL file
[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 The Btrfs utility programs also require libblkid (block device identification
20 library). This library is usually available as libblkid-dev or libblkid-devel.
21
22 Building the utilities is just make ; make install.  The programs go
23 into /usr/local/bin.  The mains commands available are:
24
25 mkfs.btrfs: create a filesystem
26
27 btrfs: control program to create snapshots and subvolumes:
28         # mount a btrfs filesystem
29         mount /dev/sda2 /mnt
30
31         # create a subvolume
32         btrfs subvolume create /mnt/new_subvol_name
33
34         # snapshot of a subvolume
35         btrfs subvolume snapshot /mnt/default /mnt/snapshot_of_default 
36         btrfs subvolume snapshot /mnt/snapshot_of_default \
37                 /mnt/snapshot_of_a_snapshot
38
39         # list of the subvolumes
40         ls /mnt
41         default snapshot_of_a_snapshot snapshot_of_new_subvol
42         new_subvol_name snapshot_of_default
43
44         # removal of a subvolume or a snapshot
45         btrfs subvolume delete /mn/snapshot_of_a_snapshot
46
47         # look a the btrfs man page for further information
48         man btrfs
49
50 btrfsck: do a limited check of the FS extent trees.</li>
51
52 btrfs-debug-tree: print all of the FS metadata in text form.  Example:
53
54         btrfs-debug-tree /dev/sda2 >& big_output_file
55
56
57