1 Upstream-Status: Inappropriate [Backport]
2 From 6f81e1197015ab2dc41beec92c347919feb26967 Mon Sep 17 00:00:00 2001
3 From: Goffredo Baroncelli <kreijack@libero.it>
4 Date: Sun, 5 Dec 2010 17:47:45 +0000
5 Subject: [PATCH 09/15] Update/clean up btrfs help and man page V2
9 enclose you can find a patch which improves the help of the btrfs commands,
10 updates the INSTALL file and the btrfs (command) man page.
12 Regarding the help of the btrfs command:
13 - moved the "subvolume set-default" command in the "subvolume" commands group
14 - removed a wrong new line
15 - small tweak on the basis of Andreas suggestion
17 Regarding the btrfs command man page:
18 - renaming the command "device balance" in "filesystem balance" (thanks to
19 Andreas Phillipp to highlight that)
20 - adding the entry "subvolume find-new"
21 - document the switches of the command "filesystem defrag"
22 - document the <devid> facility of the command "filesystem resize"
23 - small tweak on the basis of Andreas suggestion
25 Regarding the INSTALL file, which was very old, I removed the reference of the
26 old btrfsctl utility and changed the examples using the btrfs command.
27 I removed the old (and now wrong) statement about the inability to delete a
30 Chris, you can pull the patch from the branch "help_cleanup" of the following
33 http://cassiopea.homelinux.net/git/btrfs-progs-unstable.git
35 (or you can browse the changes at
36 http://cassiopea.homelinux.net/git/btrfs-progs-unstable.git/?p=btrfs-
37 progs-unstable-all.git;a=summary)
39 The patch is very simple: only updates the man page, the INSTALL file and
40 moves/updates some lines in the help of btrfs command. Comments are welcome.
45 INSTALL | 29 ++++++++++++++++++++---------
46 btrfs.c | 24 ++++++++++++------------
47 man/btrfs.8.in | 45 +++++++++++++++++++++++++--------------------
48 3 files changed, 57 insertions(+), 41 deletions(-)
50 all the block devices.
52 @@ -138,21 +143,21 @@ can expand the partition before enlarging the filesystem
54 partition after reducing the size of the filesystem.
57 -\fBfilesystem show\fR [<uuid>|<label>]\fR
58 -Show the btrfs filesystem with some additional info. If no UUID or label is
59 -passed, \fBbtrfs\fR show info of all the btrfs filesystem.
60 +\fBfilesystem show\fR [<device>|<uuid>|<label>]\fR
61 +Show the btrfs filesystem with some additional info. If no argument is
62 +passed, \fBbtrfs\fR shows info of all the btrfs filesystems.
65 -\fBdevice balance\fR \fI<path>\fR
66 +\fBfilesystem balance\fR \fI<path>\fR
67 Balance the chunks of the filesystem identified by \fI<path>\fR
71 -\fBdevice add\fR\fI <dev> [<dev>..] <path>\fR
72 +\fBdevice add\fR\fI <device> [<device>...] <path>\fR
73 Add device(s) to the filesystem identified by \fI<path>\fR.
76 -\fBdevice delete\fR\fI <dev> [<dev>..] <path>\fR
77 +\fBdevice delete\fR\fI <device> [<device>...] <path>\fR
78 Remove device(s) from a filesystem identified by \fI<path>\fR.
81 Signed-off-by: Chris Mason <chris.mason@oracle.com>
83 INSTALL | 29 ++++++++++++++++++++---------
84 btrfs.c | 24 ++++++++++++------------
85 man/btrfs.8.in | 29 +++++++++++++++++------------
86 3 files changed, 49 insertions(+), 33 deletions(-)
88 diff --git a/INSTALL b/INSTALL
89 index 16b45a5..3840148 100644
92 @@ -22,23 +22,32 @@ in the e2fsprogs sources, and is usually available as libuuid or
93 e2fsprogs-devel from various distros.
95 Building the utilities is just make ; make install. The programs go
96 -into /usr/local/bin. The commands available are:
97 +into /usr/local/bin. The mains commands available are:
99 mkfs.btrfs: create a filesystem
101 -btrfsctl: control program to create snapshots and subvolumes:
103 +btrfs: control program to create snapshots and subvolumes:
104 + # mount a btrfs filesystem
106 - btrfsctl -s new_subvol_name /mnt
107 - btrfsctl -s snapshot_of_default /mnt/default
108 - btrfsctl -s snapshot_of_new_subvol /mnt/new_subvol_name
109 - btrfsctl -s snapshot_of_a_snapshot /mnt/snapshot_of_new_subvol
111 + # create a subvolume
112 + btrfs subvolume create /mnt/new_subvol_name
114 + # snapshot of a subvolume
115 + btrfs subvolume snapshot /mnt/default /mnt/snapshot_of_default
116 + btrfs subvolume snapshot /mnt/snapshot_of_default \
117 + /mnt/snapshot_of_a_snapshot
119 + # list of the subvolumes
121 default snapshot_of_a_snapshot snapshot_of_new_subvol
122 new_subvol_name snapshot_of_default
124 - Snapshots and subvolumes cannot be deleted right now, but you can
125 - rm -rf all the files and directories inside them.
126 + # removal of a subvolume or a snapshot
127 + btrfs subvolume delete /mn/snapshot_of_a_snapshot
129 + # look a the btrfs man page for further information
132 btrfsck: do a limited check of the FS extent trees.</li>
134 @@ -46,3 +55,5 @@ debug-tree: print all of the FS metadata in text form. Example:
136 debug-tree /dev/sda2 >& big_output_file
140 diff --git a/btrfs.c b/btrfs.c
141 index 1b4f403..62140ef 100644
144 @@ -61,6 +61,11 @@ static struct Command commands[] = {
145 { do_subvol_list, 1, "subvolume list", "<path>\n"
146 "List the snapshot/subvolume of a filesystem."
148 + { do_set_default_subvol, 2,
149 + "subvolume set-default", "<id> <path>\n"
150 + "Set the subvolume of the filesystem <path> which will be mounted\n"
153 { do_find_newer, 2, "subvolume find-new", "<path> <last_gen>\n"
154 "List the recently modified files in a filesystem."
156 @@ -68,11 +73,6 @@ static struct Command commands[] = {
157 "filesystem defragment", "[-vf] [-c[zlib,lzo]] [-s start] [-l len] [-t size] <file>|<dir> [<file>|<dir>...]\n"
158 "Defragment a file or a directory."
160 - { do_set_default_subvol, 2,
161 - "subvolume set-default", "<id> <path>\n"
162 - "Set the subvolume of the filesystem <path> which will be mounted\n"
166 "filesystem sync", "<path>\n"
167 "Force a sync on the filesystem <path>."
168 @@ -83,29 +83,29 @@ static struct Command commands[] = {
169 "will occupe all available space on the device."
171 { do_show_filesystem, 999,
172 - "filesystem show", "[<uuid>|<label>]\n"
173 - "Show the info of a btrfs filesystem. If no <uuid> or <label>\n"
174 + "filesystem show", "[<device>|<uuid>|<label>]\n"
175 + "Show the info of a btrfs filesystem. If no argument\n"
176 "is passed, info of all the btrfs filesystem are shown."
178 { do_df_filesystem, 1,
179 "filesystem df", "<path>\n"
180 - "Show space usage information for a mount point\n."
181 + "Show space usage information for a mount point."
184 "filesystem balance", "<path>\n"
185 "Balance the chunks across the device."
188 - 999, "device scan", "[<device> [<device>..]\n"
190 + "device scan", "[<device>...]\n"
191 "Scan all device for or the passed device for a btrfs\n"
195 - "device add", "<dev> [<dev>..] <path>\n"
196 + "device add", "<device> [<device>...] <path>\n"
197 "Add a device to a filesystem."
199 { do_remove_volume, -2,
200 - "device delete", "<dev> [<dev>..] <path>\n"
201 + "device delete", "<device> [<device>...] <path>\n"
202 "Remove a device from a filesystem."
205 diff --git a/man/btrfs.8.in b/man/btrfs.8.in
206 index 1ffed13..b9b8913 100644
209 @@ -21,15 +21,19 @@ btrfs \- control a btrfs filesystem
211 \fBbtrfs\fP \fBfilesystem defrag\fP\fI [options] <file>|<dir> [<file>|<dir>...]\fP
213 -\fBbtrfs\fP \fBdevice scan\fP\fI [<device> [<device>..]]\fP
214 +\fBbtrfs\fP \fBsubvolume find-new\fP\fI <subvolume> <last_gen>\fP
216 -\fBbtrfs\fP \fBdevice show\fP\fI <dev>|<label> [<dev>|<label>...]\fP
217 +\fBbtrfs\fP \fBfilesystem balance\fP\fI <path> \fP
219 -\fBbtrfs\fP \fBdevice balance\fP\fI <path> \fP
220 +\fBbtrfs\fP \fBfilesystem defragment\fP\fI <file>|<dir> [<file>|<dir>...]\fP
222 -\fBbtrfs\fP \fBdevice add\fP\fI <dev> [<dev>..] <path> \fP
223 +\fBbtrfs\fP \fBdevice scan\fP\fI [<device>...]\fP
225 -\fBbtrfs\fP \fBdevice delete\fP\fI <dev> [<dev>..] <path> \fP]
226 +\fBbtrfs\fP \fBdevice show\fP\fI [<device>|<uuid>|<label>]\fP
228 +\fBbtrfs\fP \fBdevice add\fP\fI <device> [<device>...] <path> \fP
230 +\fBbtrfs\fP \fBdevice delete\fP\fI <device> [<device>...] <path> \fP]
232 \fBbtrfs\fP \fBhelp|\-\-help|\-h \fP\fI\fP
234 @@ -48,17 +52,16 @@ For example: it is possible to run
236 .I btrfs subvolume snapshot.
240 is not allowed, because
243 may be interpreted both as
253 +returnsfilesystem sync
254 If a command is terminated by
256 , the detailed help is showed. If the passed command matches more commands,
257 @@ -125,9 +128,11 @@ The start position and the number of bytes to deframention can be specified by \
258 NOTE: defragmenting with kernels up to 2.6.37 will unlink COW-ed copies of data, don't
259 use it if you use snapshots, have de-duplicated your data or made copies with
261 +\fBsubvolume find-new\fR\fI <subvolume> <last_gen>\fR
262 +List the recently modified files in a subvolume, after \fI<last_gen>\fR ID.
265 -\fBdevice scan\fR \fI[<device> [<device>..]]\fR
266 +\fBdevice scan\fR \fI[<device>...]\fR
267 Scan devices for a btrfs filesystem. If no devices are passed, \fBbtrfs\fR scans
268 all the block devices.