2014-04-02 08:29:37 +00:00
|
|
|
mkfs.btrfs(8)
|
|
|
|
=============
|
|
|
|
|
|
|
|
NAME
|
|
|
|
----
|
|
|
|
mkfs.btrfs - create a btrfs filesystem
|
|
|
|
|
|
|
|
SYNOPSIS
|
|
|
|
--------
|
2014-05-19 15:49:35 +00:00
|
|
|
*mkfs.btrfs*
|
2014-04-02 08:29:37 +00:00
|
|
|
$$[-A|--alloc-start <alloc-start>]$$
|
|
|
|
$$[-b|--byte-count <byte-count>]$$
|
|
|
|
$$[-d|--data <data-profile>]$$
|
|
|
|
$$[-f|--force]$$
|
|
|
|
$$[-n|--nodesize <nodesize>]$$
|
|
|
|
$$[-l|--leafsize <leafsize>]$$
|
|
|
|
$$[-L|--label <label>]$$
|
|
|
|
$$[-m|--metadata <metadata profile>]$$
|
|
|
|
$$[-M|--mixed]$$
|
2014-12-17 20:14:05 +00:00
|
|
|
$$[-q|--quiet]$$
|
2014-04-02 08:29:37 +00:00
|
|
|
$$[-s|--sectorsize <sectorsize>]$$
|
|
|
|
$$[-r|--rootdir <rootdir>]$$
|
|
|
|
$$[-K|--nodiscard]$$
|
2014-05-19 15:08:56 +00:00
|
|
|
$$[-O|--features <feature1>[,<feature2>...]]$$
|
2014-05-14 17:39:07 +00:00
|
|
|
$$[-U|--uuid <UUID>]$$
|
2014-04-02 08:29:37 +00:00
|
|
|
$$[-h]$$
|
|
|
|
$$[-V|--version]$$
|
|
|
|
$$<device> [<device>...]$$
|
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
-----------
|
2014-05-19 15:49:35 +00:00
|
|
|
*mkfs.btrfs*
|
2014-04-02 08:29:37 +00:00
|
|
|
is used to create a btrfs filesystem (usually in a disk partition, or an array
|
|
|
|
of disk partitions).
|
|
|
|
|
|
|
|
<device>
|
|
|
|
is the special file corresponding to the device (e.g /dev/sdXX ).
|
|
|
|
If multiple devices are specified, btrfs is created
|
|
|
|
spanning across the specified devices.
|
|
|
|
|
|
|
|
OPTIONS
|
|
|
|
-------
|
|
|
|
-A|--alloc-start <offset>::
|
2014-05-15 17:14:40 +00:00
|
|
|
Specify the offset from the start of the device at which to start allocations
|
|
|
|
in this btrfs filesystem. The default value is zero, or the start of the
|
|
|
|
device. This option is intended only for debugging filesystem resize
|
|
|
|
operations.
|
2014-04-02 08:29:37 +00:00
|
|
|
|
|
|
|
-b|--byte-count <size>::
|
|
|
|
Specify the size of the resultant filesystem. If this option is not used,
|
|
|
|
mkfs.btrfs uses all the available storage for the filesystem.
|
|
|
|
|
|
|
|
-d|--data <type>::
|
|
|
|
Specify how the data must be spanned across the devices specified. Valid
|
|
|
|
values are 'raid0', 'raid1', 'raid5', 'raid6', 'raid10' or 'single'.
|
|
|
|
|
|
|
|
-f|--force::
|
|
|
|
Force overwrite when an existing filesystem is detected on the device.
|
2015-01-03 00:30:25 +00:00
|
|
|
By default, mkfs.btrfs will not write to the device if it suspects that
|
2014-04-02 08:29:37 +00:00
|
|
|
there is a filesystem or partition table on the device already.
|
|
|
|
|
|
|
|
-l|--leafsize <size>::
|
2015-01-03 00:26:31 +00:00
|
|
|
Alias for --nodesize. Deprecated.
|
|
|
|
|
|
|
|
-n|--nodesize <size>::
|
2014-04-02 08:29:37 +00:00
|
|
|
Specify the nodesize, the tree block size in which btrfs stores
|
|
|
|
data. The default value is 16KB (16384) or the page size, whichever is
|
2014-12-24 07:10:52 +00:00
|
|
|
bigger. Must be a multiple of the sectorsize, but not larger than 65536.
|
|
|
|
Leafsize always equals nodesize and the options are aliases.
|
2014-04-02 08:29:37 +00:00
|
|
|
|
|
|
|
-L|--label <name>::
|
|
|
|
Specify a label for the filesystem.
|
|
|
|
+
|
|
|
|
NOTE: <name> should be less than 256 characters.
|
|
|
|
|
|
|
|
-m|--metadata <profile>::
|
|
|
|
Specify how metadata must be spanned across the devices specified. Valid
|
|
|
|
values are 'raid0', 'raid1', 'raid5', 'raid6', 'raid10', 'single' or 'dup'.
|
|
|
|
+
|
|
|
|
Single device
|
|
|
|
will have dup set by default except in the case of SSDs which will default to
|
|
|
|
single. This is because SSDs can remap blocks internally so duplicate blocks
|
|
|
|
could end up in the same erase block which negates the benefits of doing
|
|
|
|
metadata duplication.
|
|
|
|
|
|
|
|
-M|--mixed::
|
2015-01-03 00:30:25 +00:00
|
|
|
Mix data and metadata chunks together for more efficient space
|
2014-04-02 08:29:37 +00:00
|
|
|
utilization. This feature incurs a performance penalty in
|
|
|
|
larger filesystems. It is recommended for use with filesystems
|
|
|
|
of 1 GiB or smaller.
|
|
|
|
|
2014-12-17 20:14:05 +00:00
|
|
|
-q|--quiet::
|
|
|
|
Print only error or warning messages. Options --features or --help are unaffected.
|
|
|
|
|
2014-04-02 08:29:37 +00:00
|
|
|
-s|--sectorsize <size>::
|
|
|
|
Specify the sectorsize, the minimum data block allocation unit.
|
|
|
|
+
|
|
|
|
The default
|
|
|
|
value is the page size. If the sectorsize differs from the page size, the
|
|
|
|
created filesystem may not be mountable by current kernel. Therefore it is not
|
|
|
|
recommended to use this option unless you are going to mount it on a system
|
|
|
|
with the appropriate page size.
|
|
|
|
|
|
|
|
-r|--rootdir <rootdir>::
|
|
|
|
Specify a directory to copy into the newly created btrfs filesystem.
|
|
|
|
+
|
|
|
|
NOTE: '-r' option is done completely in userland, and don't need root
|
|
|
|
privilege to mount the filesystem.
|
|
|
|
|
|
|
|
-K|--nodiscard::
|
|
|
|
Do not perform whole device TRIM operation by default.
|
|
|
|
|
|
|
|
-O|--features <feature1>[,<feature2>...]::
|
|
|
|
A list of filesystem features turned on at mkfs time. Not all features are
|
2015-06-23 22:46:13 +00:00
|
|
|
supported by old kernels. To disable a feature, prefix it with '^'.
|
2014-04-02 08:29:37 +00:00
|
|
|
+
|
2015-01-03 00:30:25 +00:00
|
|
|
To see all features run:
|
|
|
|
+
|
|
|
|
+mkfs.btrfs -O list-all+
|
2014-04-02 08:29:37 +00:00
|
|
|
|
2014-05-14 17:39:07 +00:00
|
|
|
-U|--uuid <UUID>::
|
|
|
|
Create the filesystem with the specified UUID, which must not already exist on
|
|
|
|
the system.
|
|
|
|
|
2014-04-02 08:29:37 +00:00
|
|
|
-V|--version::
|
2014-05-19 15:49:35 +00:00
|
|
|
Print the *mkfs.btrfs* version and exit.
|
2014-04-02 08:29:37 +00:00
|
|
|
|
|
|
|
-h::
|
|
|
|
Print help.
|
|
|
|
|
|
|
|
UNIT
|
|
|
|
----
|
|
|
|
As default the unit is the byte, however it is possible to append a suffix
|
|
|
|
to the arguments like 'k' for KBytes, 'm' for MBytes...
|
|
|
|
|
2015-10-14 17:39:37 +00:00
|
|
|
NOTES
|
|
|
|
-----
|
|
|
|
Since mixed block group creation is optional, we allow small
|
|
|
|
filesystem instances with differing values for sectorsize and nodesize
|
|
|
|
to be created and could end up in the following situation,
|
|
|
|
|
|
|
|
[root@localhost ~]# mkfs.btrfs -f -n 65536 /dev/loop0
|
|
|
|
btrfs-progs v3.19-rc2-405-g976307c
|
|
|
|
See http://btrfs.wiki.kernel.org for more information.
|
|
|
|
|
|
|
|
Performing full device TRIM (512.00MiB) ...
|
|
|
|
Label: (null)
|
|
|
|
UUID: 49fab72e-0c8b-466b-a3ca-d1bfe56475f0
|
|
|
|
Node size: 65536
|
|
|
|
Sector size: 4096
|
|
|
|
Filesystem size: 512.00MiB
|
|
|
|
Block group profiles:
|
|
|
|
Data: single 8.00MiB
|
|
|
|
Metadata: DUP 40.00MiB
|
|
|
|
System: DUP 12.00MiB
|
|
|
|
SSD detected: no
|
|
|
|
Incompat features: extref, skinny-metadata
|
|
|
|
Number of devices: 1
|
|
|
|
Devices:
|
|
|
|
ID SIZE PATH
|
|
|
|
1 512.00MiB /dev/loop0
|
|
|
|
[root@localhost ~]# mount /dev/loop0 /mnt/
|
|
|
|
mount: mount /dev/loop0 on /mnt failed: No space left on device
|
|
|
|
|
|
|
|
The ENOSPC occurs during the creation of the UUID tree. This is
|
|
|
|
because of things like large metadata block size, DUP mode used for
|
|
|
|
metadata and global reservation consuming space.
|
|
|
|
|
2014-04-02 08:29:37 +00:00
|
|
|
AVAILABILITY
|
|
|
|
------------
|
2015-10-14 17:39:37 +00:00
|
|
|
*mkfs.btrfs* is part of btrfs-progs.
|
2014-04-02 08:29:37 +00:00
|
|
|
Please refer to the btrfs wiki http://btrfs.wiki.kernel.org for
|
|
|
|
further details.
|
|
|
|
|
|
|
|
SEE ALSO
|
|
|
|
--------
|
2014-04-16 16:33:44 +00:00
|
|
|
`btrfs`(8)
|