You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* start volume rework
* add landing page and nav and minor edits
* test typo
* fix typo
* fix links
* change tip to note
* updates and edits
* update nav and move index
* fixes
* update nav and fix some links
* capitalization and naming
* final changes and revert to old nav
Manage Fly Volumes using the [`fly volumes`](/docs/flyctl/volumes/) command.
9
+
10
+
<div class="note icon">**Note**: `fly volumes` is aliased to `fly volume` and `fly vol`.</div>
11
+
12
+
## Create a volume
13
+
14
+
Run:
15
+
16
+
```cmd
17
+
fly vol create <my_volume_name>
18
+
```
19
+
20
+
Use the `-r` option to set a [region](/docs/reference/regions/), or select a region when prompted.
21
+
22
+
For options, refer to the [`fly volumes create` docs](/docs/flyctl/volumes-create/) or run `fly vol create -h`.
23
+
24
+
To add a volume to your app, refer to [Add volume storage](/docs/apps/volume-storage/).
25
+
26
+
## Access a volume
27
+
28
+
You can access and write to a volume on a Machine just like a regular directory.
29
+
30
+
For Machines managed with Fly Launch, the `destination` under `[mounts]` in `fly.toml` is the path for the mounted volumes.
31
+
32
+
For Machines managed individually, specify the mount path in the `fly machine clone` command when you [clone a Machine and add a volume](/docs/apps/volume-storage/#add-a-volume-to-a-machine-clone).
33
+
34
+
## Extend a volume
35
+
36
+
You can extend (increase) a volume's size, but you can't make a volume smaller.
37
+
38
+
1. Run `fly volumes list` and copy the volume ID.
39
+
40
+
1. Extend the volume size:
41
+
42
+
```cmd
43
+
`fly vol extend <volume id> -s <new size in GB>`
44
+
```
45
+
46
+
1. (Optional) Check the new volume size in the Machine's file system:
Connecting to fdaa:0:3b99:a7b:ef:8cc4:dc49:2... complete
57
+
Filesystem 1K-blocks Used Available Use% Mounted on
58
+
devtmpfs 103068 0 103068 0% /dev
59
+
/dev/vda 8191416 172752 7582852 3% /
60
+
shm 113224 0 113224 0% /dev/shm
61
+
tmpfs 113224 0 113224 0% /sys/fs/cgroup
62
+
/dev/vdb 2043856 3072 1930400 1% /storage
63
+
```
64
+
65
+
In the preceding example, the volume is mounted under `/storage` and has been resized to 2GB. The `df` command shows disk space in 1K blocks by default. Use the `-h` flag to return a more human-readable format.
66
+
67
+
For options, refer to the [`fly volumes extend` docs](/docs/flyctl/volumes-extend/) or run `fly vol extend -h`.
68
+
69
+
## Restore a volume from a snapshot
70
+
71
+
We take daily snapshots and keep them for five days.
72
+
73
+
1. Run `fly volumes list` and copy the volume ID.
74
+
75
+
1. List the volume's snapshots:
76
+
77
+
```cmd
78
+
fly vol snapshots <volume id>
79
+
```
80
+
81
+
Example output:
82
+
```out
83
+
Snapshots
84
+
ID SIZE CREATED AT
85
+
vs_MgLAggLZkYx89fLy 17638389 1 hour ago
86
+
vs_1KRgwpDqZ2ll5tx 17649006 1 day ago
87
+
vs_nymJyYMwXpjxqTzJ 17677766 2 days ago
88
+
vs_R3OPAz5jBqzogF16 17689473 3 days ago
89
+
vs_pZlGZvq3gkAlAcaZ 17655830 4 days ago
90
+
vs_A9k6age3bQov6twj 17631880 5 days ago
91
+
```
92
+
93
+
1. Restore from the volume snapshot into a new volume of equal or greater size:
For options, refer to the [`fly volumes snapshots` docs](/docs/flyctl/volumes-snapshots/) or run `fly vol snapshots -h`.
113
+
114
+
## Clone a Machine with a volume
115
+
116
+
Clone a Machine with a volume to create a new Machine in the same region with an empty volume. Use the `-r` option to clone the Machine into a different [region](/docs/reference/regions/).
117
+
118
+
1. Run `fly status` and copy the Machine ID of the Machine to clone.
119
+
120
+
1. Clone the Machine:
121
+
122
+
```cmd
123
+
fly m clone <machine id>
124
+
```
125
+
126
+
1. List volumes to check the result:
127
+
128
+
```cmd
129
+
fly volumes list
130
+
```
131
+
132
+
Example output showing two volumes with attached Machines:
133
+
```out
134
+
ID STATE NAME SIZE REGION ZONE ENCRYPTED ATTACHED VM CREATED AT
135
+
vol_ez1nvxkwl3jrmxl7 created data 1GB lhr 4de2 true 91851edb6ee983 39 seconds ago
136
+
vol_zmjnv8m81p5rywgx created data 1GB lhr b6a7 true 5683606c41098e 7 minutes ago
137
+
```
138
+
139
+
<div class="warning icon">
140
+
<b>Warning:</b> `fly machine clone` doesn't write data into the new volume.
141
+
</div>
142
+
143
+
For options, refer to the [`fly machine clone` docs](/docs/flyctl/machine-clone/) or run `fly m clone -h`.
144
+
145
+
## Destroy a volume
146
+
147
+
When you destroy a volume, you delete all its data.
148
+
149
+
Run:
150
+
151
+
```cmd
152
+
fly vol destroy <volume id>
153
+
```
154
+
155
+
For options, refer to the [`fly vol destroy` docs](/docs/flyctl/volumes-destroy/) or run `fly vol destroy -h`.
0 commit comments