]>
Commit | Line | Data |
---|---|---|
ea856d57 WB |
1 | [[storage_btrfs]] |
2 | BTRFS Backend | |
3 | ------------- | |
4 | ifdef::wiki[] | |
5 | :pve-toplevel: | |
6 | :title: Storage: BTRFS | |
7 | endif::wiki[] | |
8 | ||
9 | Storage pool type: `btrfs` | |
10 | ||
11 | On the surface, this storage type is very similar to the directory storage type, | |
12 | so see the directory backend section for a general overview. | |
13 | ||
14 | The main difference is that with this storage type `raw` formatted disks will be | |
15 | placed in a subvolume, in order to allow taking snapshots and supporting offline | |
16 | storage migration with snapshots being preserved. | |
17 | ||
18 | NOTE: BTRFS will honor the `O_DIRECT` flag when opening files, meaning VMs | |
19 | should not use cache mode `none`, otherwise there will be checksum errors. | |
20 | ||
21 | Configuration | |
22 | ~~~~~~~~~~~~~ | |
23 | ||
24 | This backend is configured similarly to the directory storage. Note that when | |
25 | adding a directory as a BTRFS storage, which is not itself also the mount point, | |
26 | it is highly recommended to specify the actual mount point via the | |
27 | `is_mountpoint` option. | |
28 | ||
29 | For example, if a BTRFS file system is mounted at `/mnt/data2` and its | |
30 | `pve-storage/` subdirectory (which may be a snapshot, which is recommended) | |
31 | should be added as a storage pool called `data2`, you can use the following | |
32 | entry: | |
33 | ||
34 | ---- | |
35 | btrfs: data2 | |
36 | path /mnt/data2/pve-storage | |
37 | content rootdir,images | |
38 | is_mountpoint /mnt/data2 | |
39 | ---- | |
40 | ||
41 | Snapshots | |
42 | ~~~~~~~~~ | |
43 | ||
44 | When taking a snapshot of a subvolume or `raw` file, the snapshot will be | |
45 | created as a read-only subvolume with the same path followed by an `@` and the | |
46 | snapshot's name. | |
47 | ||
48 | ifdef::wiki[] | |
49 | ||
50 | See Also | |
51 | ~~~~~~~~ | |
52 | ||
53 | * link:/wiki/Storage[Storage] | |
c1e9a769 | 54 | * link:/wiki/BTRFS[BTRFS Sysadmin] |
ea856d57 WB |
55 | |
56 | endif::wiki[] |