aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/device-mapper/thin-provisioning.txt
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/device-mapper/thin-provisioning.txt')
-rw-r--r--Documentation/device-mapper/thin-provisioning.txt65
1 files changed, 50 insertions, 15 deletions
diff --git a/Documentation/device-mapper/thin-provisioning.txt b/Documentation/device-mapper/thin-provisioning.txt
index 1ff044d87ca4..3370bc4d7b98 100644
--- a/Documentation/device-mapper/thin-provisioning.txt
+++ b/Documentation/device-mapper/thin-provisioning.txt
@@ -75,10 +75,12 @@ less sharing than average you'll need a larger-than-average metadata device.
75 75
76As a guide, we suggest you calculate the number of bytes to use in the 76As a guide, we suggest you calculate the number of bytes to use in the
77metadata device as 48 * $data_dev_size / $data_block_size but round it up 77metadata device as 48 * $data_dev_size / $data_block_size but round it up
78to 2MB if the answer is smaller. The largest size supported is 16GB. 78to 2MB if the answer is smaller. If you're creating large numbers of
79snapshots which are recording large amounts of change, you may find you
80need to increase this.
79 81
80If you're creating large numbers of snapshots which are recording large 82The largest size supported is 16GB: If the device is larger,
81amounts of change, you may need find you need to increase this. 83a warning will be issued and the excess space will not be used.
82 84
83Reloading a pool table 85Reloading a pool table
84---------------------- 86----------------------
@@ -167,6 +169,38 @@ ii) Using an internal snapshot.
167 169
168 dmsetup create snap --table "0 2097152 thin /dev/mapper/pool 1" 170 dmsetup create snap --table "0 2097152 thin /dev/mapper/pool 1"
169 171
172External snapshots
173------------------
174
175You can use an external _read only_ device as an origin for a
176thinly-provisioned volume. Any read to an unprovisioned area of the
177thin device will be passed through to the origin. Writes trigger
178the allocation of new blocks as usual.
179
180One use case for this is VM hosts that want to run guests on
181thinly-provisioned volumes but have the base image on another device
182(possibly shared between many VMs).
183
184You must not write to the origin device if you use this technique!
185Of course, you may write to the thin device and take internal snapshots
186of the thin volume.
187
188i) Creating a snapshot of an external device
189
190 This is the same as creating a thin device.
191 You don't mention the origin at this stage.
192
193 dmsetup message /dev/mapper/pool 0 "create_thin 0"
194
195ii) Using a snapshot of an external device.
196
197 Append an extra parameter to the thin target specifying the origin:
198
199 dmsetup create snap --table "0 2097152 thin /dev/mapper/pool 0 /dev/image"
200
201 N.B. All descendants (internal snapshots) of this snapshot require the
202 same extra origin parameter.
203
170Deactivation 204Deactivation
171------------ 205------------
172 206
@@ -189,7 +223,13 @@ i) Constructor
189 <low water mark (blocks)> [<number of feature args> [<arg>]*] 223 <low water mark (blocks)> [<number of feature args> [<arg>]*]
190 224
191 Optional feature arguments: 225 Optional feature arguments:
192 - 'skip_block_zeroing': skips the zeroing of newly-provisioned blocks. 226
227 skip_block_zeroing: Skip the zeroing of newly-provisioned blocks.
228
229 ignore_discard: Disable discard support.
230
231 no_discard_passdown: Don't pass discards down to the underlying
232 data device, but just remove the mapping.
193 233
194 Data block size must be between 64KB (128 sectors) and 1GB 234 Data block size must be between 64KB (128 sectors) and 1GB
195 (2097152 sectors) inclusive. 235 (2097152 sectors) inclusive.
@@ -237,16 +277,6 @@ iii) Messages
237 277
238 Deletes a thin device. Irreversible. 278 Deletes a thin device. Irreversible.
239 279
240 trim <dev id> <new size in sectors>
241
242 Delete mappings from the end of a thin device. Irreversible.
243 You might want to use this if you're reducing the size of
244 your thinly-provisioned device. In many cases, due to the
245 sharing of blocks between devices, it is not possible to
246 determine in advance how much space 'trim' will release. (In
247 future a userspace tool might be able to perform this
248 calculation.)
249
250 set_transaction_id <current id> <new id> 280 set_transaction_id <current id> <new id>
251 281
252 Userland volume managers, such as LVM, need a way to 282 Userland volume managers, such as LVM, need a way to
@@ -262,7 +292,7 @@ iii) Messages
262 292
263i) Constructor 293i) Constructor
264 294
265 thin <pool dev> <dev id> 295 thin <pool dev> <dev id> [<external origin dev>]
266 296
267 pool dev: 297 pool dev:
268 the thin-pool device, e.g. /dev/mapper/my_pool or 253:0 298 the thin-pool device, e.g. /dev/mapper/my_pool or 253:0
@@ -271,6 +301,11 @@ i) Constructor
271 the internal device identifier of the device to be 301 the internal device identifier of the device to be
272 activated. 302 activated.
273 303
304 external origin dev:
305 an optional block device outside the pool to be treated as a
306 read-only snapshot origin: reads to unprovisioned areas of the
307 thin target will be mapped to this device.
308
274The pool doesn't store any size against the thin devices. If you 309The pool doesn't store any size against the thin devices. If you
275load a thin target that is smaller than you've been using previously, 310load a thin target that is smaller than you've been using previously,
276then you'll have no access to blocks mapped beyond the end. If you 311then you'll have no access to blocks mapped beyond the end. If you