mirror of
https://github.com/apple/container.git
synced 2026-09-22 15:45:38 +00:00
Adds journal option to container volume create. (#1412)
- Closes #1411. - Default behavior doesn't change today - with no `journal` option, no journal gets created.
This commit is contained in:
@@ -820,7 +820,32 @@ container volume create [--label <label> ...] [--opt <opt> ...] [-s <s>] [--debu
|
||||
|
||||
* `--label <label>`: Set metadata for a volume
|
||||
* `--opt <opt>`: Set driver specific options
|
||||
* `-s <s>`: Size of the volume in bytes, with optional K, M, G, T, or P suffix
|
||||
* `-s <s>`: Size of the volume in bytes, with optional K, M, G, T, or P suffix. Takes precedence over `--opt size=` if both are specified.
|
||||
|
||||
**Driver Options**
|
||||
|
||||
Driver options are passed with `--opt key=value`. The following options are supported for the default `local` driver:
|
||||
|
||||
* `size=<value>`: Volume size with optional unit suffix (K, M, G, T, P). Minimum 1 MiB. Equivalent to `-s`; if `-s` is also specified, `-s` takes precedence.
|
||||
* `journal=<mode>[:<size>]`: Configure ext4 journaling on the volume. `<mode>` must be one of:
|
||||
* `ordered` — journals metadata only; data is written to disk before its metadata is committed (default kernel behavior, good balance of safety and performance)
|
||||
* `writeback` — journals metadata only; data ordering relative to metadata commits is not guaranteed (fastest, least safe)
|
||||
* `journal` — journals both metadata and data (safest, highest write amplification)
|
||||
|
||||
An optional `:<size>` suffix sets the journal size (same unit suffixes as `size`). If omitted, the kernel selects a default journal size.
|
||||
|
||||
**Examples**
|
||||
|
||||
```bash
|
||||
# create a volume with ordered journaling
|
||||
container volume create --opt journal=ordered myvolume
|
||||
|
||||
# create a volume with writeback journaling and a 64 MiB journal
|
||||
container volume create --opt journal=writeback:64m myvolume
|
||||
|
||||
# create a volume with full data journaling and an explicit volume size
|
||||
container volume create --opt journal=journal --opt size=10g myvolume
|
||||
```
|
||||
|
||||
**Anonymous Volumes**
|
||||
|
||||
|
||||
Reference in New Issue
Block a user