WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 3260d5b

Browse files
committed
DOCS: Add volume pinning functionality
Signed-off-by: tobwen <[email protected]>
1 parent 61fa665 commit 3260d5b

9 files changed

+102
-4
lines changed

docs/source/markdown/podman-system-prune.1.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ podman\-system\-prune - Remove all unused pods, containers, images, networks, an
1111

1212
Use the **--all** option to delete all unused images. Unused images are dangling images as well as any image that does not have any containers based on it.
1313

14-
By default, volumes are not removed to prevent important data from being deleted if there is currently no container using the volume. Use the **--volumes** flag when running the command to prune volumes as well.
14+
By default, volumes are not removed to prevent important data from being deleted if there is currently no container using the volume. Use the **--volumes** flag when running the command to prune volumes as well. By default, pinned volumes are excluded from pruning even when **--volumes** is specified. Use the **--include-pinned** flag to include pinned volumes in the prune operation.
1515

1616
By default, build containers are not removed to prevent interference with builds in progress. Use the **--build** flag when running the command to remove build containers as well.
1717

@@ -59,6 +59,10 @@ Do not prompt for confirmation
5959

6060
Print usage statement
6161

62+
#### **--include-pinned**
63+
64+
Include pinned volumes in the prune operation when **--volumes** is specified. By default, pinned volumes are excluded from pruning to protect important data. This flag only has an effect when **--volumes** is also used.
65+
6266
#### **--volumes**
6367

6468
Prune volumes currently unused by any container

docs/source/markdown/podman-system-reset.1.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ podman\-system\-reset - Reset storage back to initial state
1111
It also removes the configured graphRoot and runRoot directories. Make sure these are not set to
1212
some important directory.
1313

14+
By default, pinned volumes are excluded from the reset operation to protect important data. Use the **--include-pinned** flag to include pinned volumes in the reset.
15+
1416
This command must be run **before** changing any of the following fields in the
1517
`containers.conf` or `storage.conf` files: `driver`, `static_dir`, `tmp_dir`
1618
or `volume_path`.
@@ -30,6 +32,10 @@ Do not prompt for confirmation
3032

3133
Print usage statement
3234

35+
#### **--include-pinned**
36+
37+
Include pinned volumes in the reset operation. By default, pinned volumes are excluded from the reset to protect important data.
38+
3339
## EXAMPLES
3440

3541
Reset all storage back to a clean initialized state.

docs/source/markdown/podman-volume-create.1.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ This option is mandatory when using the **image** driver.
7373

7474
When not using the **local** and **image** drivers, the given options are passed directly to the volume plugin. In this case, supported options are dictated by the plugin in question, not Podman.
7575

76+
#### **--pinned**
77+
78+
Mark the volume as pinned. Pinned volumes are excluded from **podman system prune** and **podman system reset** operations by default, protecting them from accidental deletion during cleanup operations. The pinned status can be changed later using **podman volume pin**.
79+
7680
#### **--uid**=*uid*
7781

7882
Set the UID that the volume will be created as. Differently than `--opt o=uid=*uid*`, the specified value is not passed to the mount operation. The specified UID will own the volume's mount point directory and affects the volume chown operation.
@@ -137,6 +141,11 @@ Create volume overriding the owner UID and GID.
137141
# podman volume create --uid 1000 --gid 1000 myvol
138142
```
139143

144+
Create a pinned volume that is protected from system prune operations.
145+
```
146+
$ podman volume create --pinned datavol
147+
```
148+
140149
Create image named volume using the specified local image in containers/storage.
141150
```
142151
# podman volume create --driver image --opt image=fedora:latest fedoraVol
@@ -214,7 +223,7 @@ If performance is the priority, please check out the more performant [goofys](ht
214223
215224

216225
## SEE ALSO
217-
**[podman(1)](podman.1.md)**, **[containers.conf(5)](https://github.com/containers/common/blob/main/docs/containers.conf.5.md)**, **[podman-volume(1)](podman-volume.1.md)**, **mount(8)**, **xfs_quota(8)**, **xfs_quota(8)**, **projects(5)**, **projid(5)**
226+
**[podman(1)](podman.1.md)**, **[containers.conf(5)](https://github.com/containers/common/blob/main/docs/containers.conf.5.md)**, **[podman-volume(1)](podman-volume.1.md)**, **[podman-volume-pin(1)](podman-volume-pin.1.md)**, **mount(8)**, **xfs_quota(8)**, **xfs_quota(8)**, **projects(5)**, **projid(5)**
218227

219228
## HISTORY
220229
January 2020, updated with information on volume plugins by Matthew Heon <[email protected]>

docs/source/markdown/podman-volume-inspect.1.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ Valid placeholders for the Go template are listed below:
4545
| .StorageID | StorageID of the volume |
4646
| .Timeout | Timeout of the volume |
4747
| .UID | UID the volume was created with |
48+
| .Pinned | Whether the volume is pinned |
4849

4950
#### **--help**
5051

docs/source/markdown/podman-volume-ls.1.md.in

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Volumes can be filtered by the following attributes:
3030
| label | [Key] or [Key=Value] Label assigned to a volume |
3131
| name | [Name] Volume name (accepts regex) |
3232
| opt | Matches a storage driver options |
33+
| pinned | [Bool] Matches volumes based on their pinned status (true/false) |
3334
| scope | Filters volume by scope |
3435
| after/since | Filter by volumes created after the given VOLUME (name or tag) |
3536
| until | Only remove volumes created before given timestamp |
@@ -60,6 +61,7 @@ Valid placeholders for the Go template are listed below:
6061
| .StorageID | StorageID of the volume |
6162
| .Timeout | Timeout of the volume |
6263
| .UID | UID of volume |
64+
| .Pinned | Whether the volume is pinned |
6365
| .VolumeConfigResponse ... | Don't use |
6466

6567
#### **--help**
@@ -99,6 +101,16 @@ List volumes with the label key=value.
99101
$ podman volume ls --filter label=key=value
100102
```
101103

104+
List all pinned volumes.
105+
```
106+
$ podman volume ls --filter pinned=true
107+
```
108+
109+
List all non-pinned volumes.
110+
```
111+
$ podman volume ls --filter pinned=false
112+
```
113+
102114
## SEE ALSO
103115
**[podman(1)](podman.1.md)**, **[podman-volume(1)](podman-volume.1.md)**
104116

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
% podman-volume-pin 1
2+
3+
## NAME
4+
podman\-volume\-pin - Mark or unmark volumes as pinned
5+
6+
## SYNOPSIS
7+
**podman volume pin** [*options*] *volume* [*volume* ...]
8+
9+
## DESCRIPTION
10+
11+
Mark or unmark one or more volumes as pinned. Pinned volumes are excluded from **podman system prune** and **podman system reset** operations by default, protecting them from accidental deletion.
12+
13+
This is useful for volumes containing important persistent data that should be preserved during cleanup operations.
14+
15+
By default, **podman volume pin** marks volumes as pinned. Use the **--unpin** option to remove the pinned status from volumes.
16+
17+
## OPTIONS
18+
19+
#### **--unpin**
20+
21+
Remove the pinned status from the specified volumes instead of pinning them.
22+
23+
#### **--help**
24+
25+
Print usage statement.
26+
27+
## EXAMPLES
28+
29+
Mark a volume as pinned.
30+
```
31+
$ podman volume pin myvol
32+
Volume myvol is now pinned
33+
```
34+
35+
Mark multiple volumes as pinned.
36+
```
37+
$ podman volume pin vol1 vol2 vol3
38+
Volume vol1 is now pinned
39+
Volume vol2 is now pinned
40+
Volume vol3 is now pinned
41+
```
42+
43+
Remove the pinned status from a volume.
44+
```
45+
$ podman volume pin --unpin myvol
46+
Volume myvol is now unpinned
47+
```
48+
49+
## SEE ALSO
50+
**[podman(1)](podman.1.md)**, **[podman-volume(1)](podman-volume.1.md)**, **[podman-volume-create(1)](podman-volume-create.1.md)**, **[podman-volume-prune(1)](podman-volume-prune.1.md)**, **[podman-volume-rm(1)](podman-volume-rm.1.md)**, **[podman-system-prune(1)](podman-system-prune.1.md)**, **[podman-system-reset(1)](podman-system-reset.1.md)**
51+
52+
## HISTORY
53+
October 2025, Originally compiled by TobWen

docs/source/markdown/podman-volume-prune.1.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ Removes unused volumes. By default all unused volumes are removed, the **--filte
1212
be used to filter specific volumes. Users are prompted to confirm the removal of all the
1313
unused volumes. To bypass the confirmation, use the **--force** flag.
1414

15+
By default, pinned volumes are excluded from pruning to protect important data. Use the **--include-pinned** flag to include pinned volumes in the prune operation.
16+
1517

1618
## OPTIONS
1719

@@ -46,6 +48,10 @@ Do not prompt for confirmation.
4648

4749
Print usage statement
4850

51+
#### **--include-pinned**
52+
53+
Include pinned volumes in the prune operation. By default, pinned volumes are excluded from pruning to protect important data.
54+
4955

5056
## EXAMPLES
5157

@@ -66,7 +72,7 @@ $ podman volume prune --filter label=mylabel=mylabelvalue
6672
```
6773

6874
## SEE ALSO
69-
**[podman(1)](podman.1.md)**, **[podman-volume(1)](podman-volume.1.md)**
75+
**[podman(1)](podman.1.md)**, **[podman-volume(1)](podman-volume.1.md)**, **[podman-volume-pin(1)](podman-volume-pin.1.md)**
7076

7177
## HISTORY
7278
November 2018, Originally compiled by Urvashi Mohnani <[email protected]>

docs/source/markdown/podman-volume-rm.1.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ If a volume is being used by a container, an error is returned unless the **--fo
1313
flag is being used. To remove all volumes, use the **--all** flag.
1414
Volumes can be removed individually by providing their full name or a unique partial name.
1515

16+
By default, pinned volumes are excluded from removal operations to protect important data. Use the **--include-pinned** flag to allow removal of pinned volumes.
17+
1618
## OPTIONS
1719

1820
#### **--all**, **-a**
@@ -28,6 +30,10 @@ If it is being used by containers, the containers are removed first.
2830

2931
Print usage statement
3032

33+
#### **--include-pinned**
34+
35+
Include pinned volumes in the removal operation. By default, pinned volumes are excluded from removal to protect important data. This flag must be used if you want to remove volumes that have been marked as pinned.
36+
3137
#### **--time**, **-t**=*seconds*
3238

3339
Seconds to wait before forcibly stopping running containers that are using the specified volume. The --force option must be specified to use the --time option. Use -1 for infinite wait.
@@ -59,7 +65,7 @@ $ podman volume rm --force myvol
5965
**125** The command fails for any other reason
6066

6167
## SEE ALSO
62-
**[podman(1)](podman.1.md)**, **[podman-volume(1)](podman-volume.1.md)**
68+
**[podman(1)](podman.1.md)**, **[podman-volume(1)](podman-volume.1.md)**, **[podman-volume-pin(1)](podman-volume-pin.1.md)**
6369

6470
## HISTORY
6571
November 2018, Originally compiled by Urvashi Mohnani <[email protected]>

docs/source/markdown/podman-volume.1.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ podman volume is a set of subcommands that manage volumes.
2020
| inspect | [podman-volume-inspect(1)](podman-volume-inspect.1.md) | Get detailed information on one or more volumes. |
2121
| ls | [podman-volume-ls(1)](podman-volume-ls.1.md) | List all the available volumes. |
2222
| mount | [podman-volume-mount(1)](podman-volume-mount.1.md) | Mount a volume filesystem. |
23+
| pin | [podman-volume-pin(1)](podman-volume-pin.1.md) | Mark or unmark volumes as pinned. |
2324
| prune | [podman-volume-prune(1)](podman-volume-prune.1.md) | Remove all unused volumes. |
2425
| reload | [podman-volume-reload(1)](podman-volume-reload.1.md) | Reload all volumes from volumes plugins. |
2526
| rm | [podman-volume-rm(1)](podman-volume-rm.1.md) | Remove one or more volumes. |

0 commit comments

Comments
 (0)