2021-03-18 00:35:52 +00:00
|
|
|
# mkfs.btrfs
|
|
|
|
|
2024-02-14 20:25:13 +00:00
|
|
|
> Create a BTRFS filesystem.
|
|
|
|
> Defaults to `raid1`, which specifies 2 copies of a data block spread across 2 different devices.
|
2022-11-15 11:50:15 +00:00
|
|
|
> More information: <https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html>.
|
2021-03-18 00:35:52 +00:00
|
|
|
|
|
|
|
- Create a btrfs filesystem on a single device:
|
|
|
|
|
|
|
|
`sudo mkfs.btrfs --metadata single --data single {{/dev/sda}}`
|
|
|
|
|
|
|
|
- Create a btrfs filesystem on multiple devices with raid1:
|
|
|
|
|
|
|
|
`sudo mkfs.btrfs --metadata raid1 --data raid1 {{/dev/sda}} {{/dev/sdb}} {{/dev/sdN}}`
|
|
|
|
|
|
|
|
- Set a label for the filesystem:
|
|
|
|
|
|
|
|
`sudo mkfs.btrfs --label "{{label}}" {{/dev/sda}} [{{/dev/sdN}}]`
|