1
- A swapfile is file-backed memory that the system uses to temporarily offload
2
- the RAM. It is supported since kernel 5.0. Use ``swapon(8) `` to activate it as
3
- a swap area, until then it's just a normal file (with NODATACOW set), for which
4
- the special restrictions for active swapfile areas don't apply.
1
+ A swapfile, when active, is a file-backed swap area. It is supported since kernel 5.0.
2
+ Use ``swapon(8) `` to activate it, until then (respectively again after deactivating it
3
+ with `` swapoff(8) ``) it's just a normal file (with NODATACOW set), for which the special
4
+ restrictions for active swapfiles don't apply.
5
5
6
6
There are some limitations of the implementation in BTRFS and Linux swap
7
7
subsystem:
8
8
9
9
* filesystem - must be only single device
10
10
* filesystem - must have only *single * data profile
11
- * swapfile - the containing subvolume cannot be snapshotted if there's an active swapfile
12
- * swapfile - the file must be preallocated (i.e. no holes)
13
- * swapfile - the file must be NODATACOW (i.e. also NODATASUM, no compression)
11
+ * subvolume - cannot be snapshotted if it contains any active swapfiles
12
+ * swapfile - must be preallocated (i.e. no holes)
13
+ * swapfile - must be NODATACOW (i.e. also NODATASUM, no compression)
14
14
15
15
The limitations come namely from the COW-based design and mapping layer of
16
16
blocks that allows the advanced features like relocation and multi-device
@@ -21,13 +21,13 @@ swap.
21
21
With active swapfiles, the following whole-filesystem operations will skip
22
22
swapfile extents or may fail:
23
23
24
- * balance - block groups with an active swapfile extents are skipped and
24
+ * balance - block groups with extents of any active swapfiles are skipped and
25
25
reported, the rest will be processed normally
26
26
* resize grow - unaffected
27
- * resize shrink - works as long as the extents of an active swapfile are
27
+ * resize shrink - works as long as the extents of any active swapfiles are
28
28
outside of the shrunk range
29
- * device add - a new device does not interfere with existing active swapfile
30
- and this operation will work, though no new swapfile can be activated
29
+ * device add - if the new devices do not interfere with any already active swapfiles
30
+ this operation will work, though no new swapfile can be activated
31
31
afterwards
32
32
* device delete - if the device has been added as above, it can be also deleted
33
33
* device replace - ditto
0 commit comments