2014-04-02 08:29:14 +00:00
|
|
|
btrfs-filesystem(8)
|
|
|
|
===================
|
|
|
|
|
|
|
|
NAME
|
|
|
|
----
|
|
|
|
btrfs-filesystem - control btrfs filesystem
|
|
|
|
|
|
|
|
SYNOPSIS
|
|
|
|
--------
|
2014-05-19 15:49:35 +00:00
|
|
|
*btrfs filesystem* <subcommand> <args>
|
2014-04-02 08:29:14 +00:00
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
-----------
|
2014-05-19 15:49:35 +00:00
|
|
|
*btrfs filesystem* is used to do the filesystem level control jobs, including
|
2014-04-02 08:29:14 +00:00
|
|
|
all the regular filesystem operations like setting/getting label,
|
|
|
|
resizing, defragment.
|
|
|
|
|
|
|
|
SUBCOMMAND
|
|
|
|
----------
|
2014-08-30 18:27:00 +00:00
|
|
|
*df* [options] <path>::
|
2014-04-02 08:29:14 +00:00
|
|
|
Show space usage information for a mount point.
|
2014-08-30 18:27:00 +00:00
|
|
|
+
|
|
|
|
`Options`
|
|
|
|
+
|
|
|
|
-b|--raw::::
|
|
|
|
raw numbers in bytes, without the 'B' suffix
|
2015-01-21 17:47:24 +00:00
|
|
|
-h|--human-readable::::
|
2014-08-30 18:27:00 +00:00
|
|
|
print human friendly numbers, base 1024, this is the default
|
|
|
|
-H::::
|
|
|
|
print human friendly numbers, base 1000
|
|
|
|
--iec::::
|
|
|
|
select the 1024 base for the following options, according to the IEC standard
|
|
|
|
--si::::
|
|
|
|
select the 1000 base for the following options, according to the SI standard
|
|
|
|
-k|--kbytes::::
|
|
|
|
show sizes in KiB, or kB with --si
|
|
|
|
-m|--mbytes::::
|
2014-11-04 17:22:51 +00:00
|
|
|
show sizes in MiB, or MB with --si
|
2014-08-30 18:27:00 +00:00
|
|
|
-g|--gbytes::::
|
2014-11-04 17:22:51 +00:00
|
|
|
show sizes in GiB, or GB with --si
|
2014-08-30 18:27:00 +00:00
|
|
|
-t|--tbytes::::
|
2014-11-04 17:22:51 +00:00
|
|
|
show sizes in TiB, or TB with --si
|
2014-04-02 08:29:14 +00:00
|
|
|
+
|
2015-01-03 00:49:24 +00:00
|
|
|
If conflicting options are passed, the last one takes precedence.
|
2014-04-02 08:29:14 +00:00
|
|
|
|
2014-05-19 15:49:35 +00:00
|
|
|
*defragment* [options] <file>|<dir> [<file>|<dir>...]::
|
2014-04-02 08:29:14 +00:00
|
|
|
Defragment file data and/or directory metadata *online*.
|
|
|
|
+
|
|
|
|
If '-r' is passed, files in dir will be defragmented recursively.
|
|
|
|
The start position and the number of bytes to defragment can be specified by
|
|
|
|
start and len using '-s' and '-l' options below.
|
|
|
|
Any extent bigger than threshold given by '-t' option, will be considered
|
|
|
|
already defragged.
|
Btrfs-progs: fix wrong manpage of defrag command
'btrfs filesystem defrag' has an option '-t', whose manpage says
"Any extent bigger than threshold given by -t option, will be
considered already defragged. Use 0 to take the kernel default, and
use 1 to say every single extent must be rewritten."
Here 'use 0' still works, it refers to the default value(256K), however,
'use 1' is an obvious typo, it should be -1, which means the largest value
it can be.
Right now, we use parse_size() which no more allow value '-1', so in
order to keep the manpage correct, this updates it to only keep value '0'.
If you want to make sure every single extent is rewritten, please use a fairly
large size, say 1G.
Reported-by: Sebastian Ochmann <ochmann@informatik.uni-bonn.de>
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
2014-07-17 10:46:01 +00:00
|
|
|
Use 0 to take the kernel default.
|
2014-04-02 08:29:14 +00:00
|
|
|
You can also turn on compression in defragment operations.
|
|
|
|
+
|
|
|
|
`Options`
|
|
|
|
+
|
|
|
|
-v::::
|
|
|
|
be verbose
|
|
|
|
-c::::
|
|
|
|
compress file contents while defragmenting
|
|
|
|
-r::::
|
|
|
|
defragment files recursively
|
|
|
|
-f::::
|
|
|
|
flush filesystem after defragmenting
|
2015-01-02 16:51:06 +00:00
|
|
|
-s <start>[kKmMgGtTpPeE]::::
|
2014-04-02 08:29:14 +00:00
|
|
|
defragment only from byte <start> onward
|
2015-01-02 16:51:06 +00:00
|
|
|
-l <len>[kKmMgGtTpPeE]::::
|
2014-04-02 08:29:14 +00:00
|
|
|
defragment only up to <len> bytes
|
2015-01-02 16:51:06 +00:00
|
|
|
-t <size>[kKmMgGtTpPeE]::::
|
2014-04-02 08:29:14 +00:00
|
|
|
defragment only files at least <size> bytes big
|
|
|
|
+
|
2015-01-02 16:51:06 +00:00
|
|
|
For <start>, <len>, <size> it is possible to append
|
|
|
|
units designator: \'K', \'M', \'G', \'T', \'P', or \'E', which represent
|
|
|
|
KiB, MiB, GiB, TiB, PiB, or EiB, respectively. Case does not matter.
|
2014-04-02 08:29:14 +00:00
|
|
|
+
|
|
|
|
WARNING: 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 `cp --reflink`.
|
|
|
|
|
2015-01-03 00:49:24 +00:00
|
|
|
*label* [<dev>|<mountpoint>] [<newlabel>]::
|
|
|
|
Show or update the label of a filesystem.
|
|
|
|
+
|
|
|
|
[<device>|<mountpoint>] is used to identify the filesystem.
|
|
|
|
If a newlabel optional argument is passed, the label is changed.
|
|
|
|
+
|
|
|
|
NOTE: the maximum allowable length shall be less than 256 chars
|
|
|
|
|
2014-04-02 08:29:14 +00:00
|
|
|
// Some wording are extracted by the resize2fs man page
|
2015-01-02 16:51:06 +00:00
|
|
|
*resize* [<devid>:][+/-]<size>[kKmMgGtTpPeE]|[<devid>:]max <path>::
|
2014-04-02 08:29:14 +00:00
|
|
|
Resize a filesystem identified by <path> for the underlying device
|
|
|
|
devid *online*. +
|
2014-05-19 15:49:35 +00:00
|
|
|
The devid can be found with *btrfs filesystem show* and
|
2014-04-02 08:29:14 +00:00
|
|
|
defaults to 1 if not specified.
|
|
|
|
The <size> parameter specifies the new size of the filesystem.
|
|
|
|
If the prefix + or - is present the size is increased or decreased
|
|
|
|
by the quantity <size>.
|
|
|
|
If no units are specified, the unit of the <size> parameter defaults to
|
|
|
|
bytes. Optionally, the size parameter may be suffixed by one of the following
|
2015-01-02 16:22:07 +00:00
|
|
|
units designators: \'K', \'M', \'G', \'T', \'P', or \'E', which represent
|
2015-01-02 16:51:06 +00:00
|
|
|
KiB, MiB, GiB, TiB, PiB, or EiB, respectively. Case does not matter.
|
2014-04-02 08:29:14 +00:00
|
|
|
+
|
|
|
|
If \'max' is passed, the filesystem will occupy all available space on the
|
|
|
|
device devid.
|
|
|
|
+
|
|
|
|
The resize command does not manipulate the size of underlying
|
|
|
|
partition. If you wish to enlarge/reduce a filesystem, you must make sure you
|
|
|
|
can expand the partition before enlarging the filesystem and shrink the
|
|
|
|
partition after reducing the size of the filesystem. This can done using
|
|
|
|
`fdisk`(8) or `parted`(8) to delete the existing partition and recreate
|
|
|
|
it with the new desired size. When recreating the partition make sure to use
|
|
|
|
the same starting disk cylinder as before.
|
|
|
|
|
2015-01-03 00:49:24 +00:00
|
|
|
*show* [--mounted|--all-devices|<path>|<uuid>|<device>|<label>]::
|
|
|
|
Show the btrfs filesystem with some additional info.
|
2015-01-03 00:36:39 +00:00
|
|
|
+
|
2015-01-03 00:49:24 +00:00
|
|
|
If no option nor <path>|<uuid>|<device>|<label> is passed, btrfs shows
|
|
|
|
information of all the btrfs filesystem both mounted and unmounted.
|
|
|
|
If '--mounted' is passed, it would probe btrfs kernel to list mounted btrfs
|
|
|
|
filesystem(s);
|
|
|
|
If '--all-devices' is passed, all the devices under /dev are scanned;
|
|
|
|
otherwise the devices list is extracted from the /proc/partitions file.
|
|
|
|
|
|
|
|
*sync* <path>::
|
|
|
|
Force a sync for the filesystem identified by <path>.
|
2014-04-02 08:29:14 +00:00
|
|
|
|
2014-12-18 14:20:11 +00:00
|
|
|
*usage* [options] <path> [<path>...]::
|
|
|
|
Show detailed information about internal filesystem usage.
|
|
|
|
+
|
|
|
|
`Options`
|
|
|
|
+
|
|
|
|
-b|--raw::::
|
|
|
|
raw numbers in bytes, without the 'B' suffix
|
2015-01-21 17:47:24 +00:00
|
|
|
-h|--human-readable::::
|
2014-12-18 14:20:11 +00:00
|
|
|
print human friendly numbers, base 1024, this is the default
|
|
|
|
-H::::
|
|
|
|
print human friendly numbers, base 1000
|
|
|
|
--iec::::
|
|
|
|
select the 1024 base for the following options, according to the IEC standard
|
|
|
|
--si::::
|
|
|
|
select the 1000 base for the following options, according to the SI standard
|
|
|
|
-k|--kbytes::::
|
|
|
|
show sizes in KiB, or kB with --si
|
|
|
|
-m|--mbytes::::
|
|
|
|
show sizes in MiB, or MB with --si
|
|
|
|
-g|--gbytes::::
|
|
|
|
show sizes in GiB, or GB with --si
|
|
|
|
-t|--tbytes::::
|
|
|
|
show sizes in TiB, or TB with --si
|
|
|
|
-T::::
|
|
|
|
show data in tabular format
|
2015-01-03 00:49:24 +00:00
|
|
|
+
|
2014-12-18 14:20:11 +00:00
|
|
|
If conflicting options are passed, the last one takes precedence.
|
|
|
|
|
2014-04-02 08:29:14 +00:00
|
|
|
EXIT STATUS
|
|
|
|
-----------
|
2014-09-19 01:49:59 +00:00
|
|
|
*btrfs filesystem* returns a zero exit status if it succeeds. Non zero is
|
2014-04-02 08:29:14 +00:00
|
|
|
returned in case of failure.
|
|
|
|
|
|
|
|
AVAILABILITY
|
|
|
|
------------
|
2014-05-19 16:04:26 +00:00
|
|
|
*btrfs* is part of btrfs-progs.
|
2014-04-02 08:29:14 +00:00
|
|
|
Please refer to the btrfs wiki http://btrfs.wiki.kernel.org for
|
|
|
|
further details.
|
|
|
|
|
|
|
|
SEE ALSO
|
|
|
|
--------
|
|
|
|
`mkfs.btrfs`(8),
|