summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--INSTALL29
-rw-r--r--btrfs.c24
-rw-r--r--man/btrfs.8.in29
3 files changed, 49 insertions, 33 deletions
diff --git a/INSTALL b/INSTALL
index 16b45a56..38401481 100644
--- a/INSTALL
+++ b/INSTALL
@@ -22,23 +22,32 @@ in the e2fsprogs sources, and is usually available as libuuid or
e2fsprogs-devel from various distros.
Building the utilities is just make ; make install. The programs go
-into /usr/local/bin. The commands available are:
+into /usr/local/bin. The mains commands available are:
mkfs.btrfs: create a filesystem
-btrfsctl: control program to create snapshots and subvolumes:
-
+btrfs: control program to create snapshots and subvolumes:
+ # mount a btrfs filesystem
mount /dev/sda2 /mnt
- btrfsctl -s new_subvol_name /mnt
- btrfsctl -s snapshot_of_default /mnt/default
- btrfsctl -s snapshot_of_new_subvol /mnt/new_subvol_name
- btrfsctl -s snapshot_of_a_snapshot /mnt/snapshot_of_new_subvol
+
+ # create a subvolume
+ btrfs subvolume create /mnt/new_subvol_name
+
+ # snapshot of a subvolume
+ btrfs subvolume snapshot /mnt/default /mnt/snapshot_of_default
+ btrfs subvolume snapshot /mnt/snapshot_of_default \
+ /mnt/snapshot_of_a_snapshot
+
+ # list of the subvolumes
ls /mnt
default snapshot_of_a_snapshot snapshot_of_new_subvol
new_subvol_name snapshot_of_default
- Snapshots and subvolumes cannot be deleted right now, but you can
- rm -rf all the files and directories inside them.
+ # removal of a subvolume or a snapshot
+ btrfs subvolume delete /mn/snapshot_of_a_snapshot
+
+ # look a the btrfs man page for further information
+ man btrfs
btrfsck: do a limited check of the FS extent trees.</li>
@@ -46,3 +55,5 @@ debug-tree: print all of the FS metadata in text form. Example:
debug-tree /dev/sda2 >& big_output_file
+
+
diff --git a/btrfs.c b/btrfs.c
index 1b4f4039..62140efb 100644
--- a/btrfs.c
+++ b/btrfs.c
@@ -61,6 +61,11 @@ static struct Command commands[] = {
{ do_subvol_list, 1, "subvolume list", "<path>\n"
"List the snapshot/subvolume of a filesystem."
},
+ { do_set_default_subvol, 2,
+ "subvolume set-default", "<id> <path>\n"
+ "Set the subvolume of the filesystem <path> which will be mounted\n"
+ "as default."
+ },
{ do_find_newer, 2, "subvolume find-new", "<path> <last_gen>\n"
"List the recently modified files in a filesystem."
},
@@ -68,11 +73,6 @@ static struct Command commands[] = {
"filesystem defragment", "[-vf] [-c[zlib,lzo]] [-s start] [-l len] [-t size] <file>|<dir> [<file>|<dir>...]\n"
"Defragment a file or a directory."
},
- { do_set_default_subvol, 2,
- "subvolume set-default", "<id> <path>\n"
- "Set the subvolume of the filesystem <path> which will be mounted\n"
- "as default."
- },
{ do_fssync, 1,
"filesystem sync", "<path>\n"
"Force a sync on the filesystem <path>."
@@ -83,29 +83,29 @@ static struct Command commands[] = {
"will occupe all available space on the device."
},
{ do_show_filesystem, 999,
- "filesystem show", "[<uuid>|<label>]\n"
- "Show the info of a btrfs filesystem. If no <uuid> or <label>\n"
+ "filesystem show", "[<device>|<uuid>|<label>]\n"
+ "Show the info of a btrfs filesystem. If no argument\n"
"is passed, info of all the btrfs filesystem are shown."
},
{ do_df_filesystem, 1,
"filesystem df", "<path>\n"
- "Show space usage information for a mount point\n."
+ "Show space usage information for a mount point."
},
{ do_balance, 1,
"filesystem balance", "<path>\n"
"Balance the chunks across the device."
},
- { do_scan,
- 999, "device scan", "[<device> [<device>..]\n"
+ { do_scan, 999,
+ "device scan", "[<device>...]\n"
"Scan all device for or the passed device for a btrfs\n"
"filesystem."
},
{ do_add_volume, -2,
- "device add", "<dev> [<dev>..] <path>\n"
+ "device add", "<device> [<device>...] <path>\n"
"Add a device to a filesystem."
},
{ do_remove_volume, -2,
- "device delete", "<dev> [<dev>..] <path>\n"
+ "device delete", "<device> [<device>...] <path>\n"
"Remove a device from a filesystem."
},
/* coming soon
diff --git a/man/btrfs.8.in b/man/btrfs.8.in
index 1ffed135..b9b89130 100644
--- a/man/btrfs.8.in
+++ b/man/btrfs.8.in
@@ -21,15 +21,19 @@ btrfs \- control a btrfs filesystem
.PP
\fBbtrfs\fP \fBfilesystem defrag\fP\fI [options] <file>|<dir> [<file>|<dir>...]\fP
.PP
-\fBbtrfs\fP \fBdevice scan\fP\fI [<device> [<device>..]]\fP
+\fBbtrfs\fP \fBsubvolume find-new\fP\fI <subvolume> <last_gen>\fP
.PP
-\fBbtrfs\fP \fBdevice show\fP\fI <dev>|<label> [<dev>|<label>...]\fP
+\fBbtrfs\fP \fBfilesystem balance\fP\fI <path> \fP
.PP
-\fBbtrfs\fP \fBdevice balance\fP\fI <path> \fP
+\fBbtrfs\fP \fBfilesystem defragment\fP\fI <file>|<dir> [<file>|<dir>...]\fP
.PP
-\fBbtrfs\fP \fBdevice add\fP\fI <dev> [<dev>..] <path> \fP
+\fBbtrfs\fP \fBdevice scan\fP\fI [<device>...]\fP
.PP
-\fBbtrfs\fP \fBdevice delete\fP\fI <dev> [<dev>..] <path> \fP]
+\fBbtrfs\fP \fBdevice show\fP\fI [<device>|<uuid>|<label>]\fP
+.PP
+\fBbtrfs\fP \fBdevice add\fP\fI <device> [<device>...] <path> \fP
+.PP
+\fBbtrfs\fP \fBdevice delete\fP\fI <device> [<device>...] <path> \fP]
.PP
\fBbtrfs\fP \fBhelp|\-\-help|\-h \fP\fI\fP
.PP
@@ -48,17 +52,16 @@ For example: it is possible to run
instead of
.I btrfs subvolume snapshot.
But
-.I btrfs dev s
+.I btrfs file s
is not allowed, because
-.I dev s
+.I file s
may be interpreted both as
-.I device show
+.I filesystem show
and as
-.I device scan.
+.I filesystem sync.
In this case
.I btrfs
-returns an error.
-
+returnsfilesystem sync
If a command is terminated by
.I --help
, the detailed help is showed. If the passed command matches more commands,
@@ -125,9 +128,11 @@ The start position and the number of bytes to deframention can be specified by \
NOTE: defragmenting with kernels up to 2.6.37 will unlink COW-ed copies of data, don't
use it if you use snapshots, have de-duplicated your data or made copies with
\fBcp --reflink\fP.
+\fBsubvolume find-new\fR\fI <subvolume> <last_gen>\fR
+List the recently modified files in a subvolume, after \fI<last_gen>\fR ID.
.TP
-\fBdevice scan\fR \fI[<device> [<device>..]]\fR
+\fBdevice scan\fR \fI[<device>...]\fR
Scan devices for a btrfs filesystem. If no devices are passed, \fBbtrfs\fR scans
all the block devices.
.TP