This is an old revision of the document!


Table of Contents

BTRFS

B-TREE filesystem for Linux

Install

apt-get install btrfs-progs
echo "btrfs" >> /etc/modules
reboot

Setup

Create a disk partition using gdisk

gdisk /dev/sda
GPT fdisk (gdisk) version 1.0.6

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.

Command (? for help): p
Disk /dev/sda: 7814037167 sectors, 3.6 TiB
Model: Portable
Sector size (logical/physical): 512/4096 bytes
Disk identifier (GUID): ED98F650-DC25-46BC-9D36-FCE4C20783C4
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 7814037133
Partitions will be aligned on 2048-sector boundaries
Total free space is 7811939948 sectors (3.6 TiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048         2099199   1024.0 MiB  8300  Linux filesystem

Format partition

mkfs.btrfs -f /dev/sda1
btrfs-progs v5.10.1
See http://btrfs.wiki.kernel.org for more information.

Label:              (null)
UUID:               4ec8fe62-e6a2-432d-8fec-7eaf1e4bed19
Node size:          16384
Sector size:        4096
Filesystem size:    1.00GiB
Block group profiles:
  Data:             single            8.00MiB
  Metadata:         DUP              51.19MiB
  System:           DUP               8.00MiB
SSD detected:       no
Incompat features:  extref, skinny-metadata
Runtime features:
Checksum:           crc32c
Number of devices:  1
Devices:
   ID        SIZE  PATH
    1     1.00GiB  /dev/sda1

Mount partition

mkdir /mnt/1
mount /dev/sda1 /mnt/1
df -h /mnt/1
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1       1.0G  3.5M  905M   1% /mnt/1
This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies