btrfs-progs: build btrfs.static needs libbtrfsutil to build
[platform/upstream/btrfs-progs.git] / Documentation / btrfstune.asciidoc
1 btrfstune(8)
2 ============
3
4 NAME
5 ----
6 btrfstune - tune various filesystem parameters
7
8 SYNOPSIS
9 --------
10 *btrfstune* [options] <device> [<device>...]
11
12 DESCRIPTION
13 -----------
14 *btrfstune* can be used to enable, disable, or set various filesystem
15 parameters. The filesystem must be unmounted.
16
17 The common usecase is to enable features that were not enabled at mkfs time.
18 Please make sure that you have kernel support for the features.  You can find a
19 complete list of features and kernel version of their introduction at
20 https://btrfs.wiki.kernel.org/index.php/Changelog#By_feature .  Also, the
21 manual page `mkfs.btrfs`(8) contains more details about the features.
22
23 Some of the features could be also enabled on a mounted filesystem by other
24 means.  Please refer to the 'FILESYSTEM FEATURES' in `btrfs`(5).
25
26 OPTIONS
27 -------
28 -S <0|1>::
29 Enable seeding on a given device. Value 1 will enable seeding, 0 will disable it. +
30 A seeding filesystem is forced to be mounted read-only. A new device can be added
31 to the filesystem and will capture all writes keeping the seeding device intact.
32
33 -r::
34 (since kernel: 3.7)
35 +
36 Enable extended inode refs (hardlink limit per file in a directory is 65536),
37 enabled by mkfs feature 'extref'.
38
39 -x::
40 (since kernel: 3.10)
41 +
42 Enable skinny metadata extent refs (more efficient representation of extents),
43 enabled by mkfs feature 'skinny-metadata'.
44 +
45 All newly created extents will use the new representation. To completely switch
46 the entire filesystem, run a full balance of the metadata. Please refer to
47 `btrfs-balance`(8).
48
49 -n::
50 (since kernel: 3.14)
51 +
52 Enable no-holes feature (more efficient representation of file holes), enabled
53 by mkfs feature 'no-holes'.
54
55 -f::
56 Allow dangerous changes, e.g. clear the seeding flag or change fsid. Make sure
57 that you are aware of the dangers.
58
59 -u::
60 Change fsid to a randomly generated UUID or continue previous fsid change
61 operation in case it was interrupted.
62
63 -U <UUID>::
64 Change fsid to 'UUID'.
65 +
66 The 'UUID' should be a 36 bytes string in `printf`(3) format
67 '"%08x-%04x-%04x-%04x-%012x"'.
68 If there is a previous unfinished fsid change, it will continue only if the
69 'UUID' matches the unfinished one or if you use the option '-u'.
70
71 WARNING: Cancelling or interrupting a UUID change operation will make the
72 filesystem temporarily unmountable.  To fix it, rerun 'btrfstune -u' to restore
73 the UUID and let it complete.
74
75 WARNING: Clearing the seeding flag on a device may be dangerous.
76 If a previously-seeding device is changed, all filesystems that used that
77 device will become unmountable. Setting the seeding flag back will not fix
78 that. +
79 A valid usecase is 'seeding device as a base image'. Clear the seeding
80 flag, update the filesystem and make it seeding again, provided that it's OK
81 to throw away all filesystems built on top of the previous base.
82
83 EXIT STATUS
84 -----------
85 *btrfstune* returns 0 if no error happened, 1 otherwise.
86
87 COMPATIBILITY NOTE
88 ------------------
89
90 This deprecated tool exists for historical reasons but is still in use today.
91 Its functionality will be merged to the main tool, at which time *btrfstune*
92 will be declared obsolete and scheduled for removal.
93
94 SEE ALSO
95 --------
96 `btrfs`(5),
97 `btrfs-balance`(8),
98 `mkfs.btrfs`(8)