diff options
Diffstat (limited to 'Documentation/device-mapper/thin-provisioning.txt')
-rw-r--r-- | Documentation/device-mapper/thin-provisioning.txt | 65 |
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 | ||
76 | As a guide, we suggest you calculate the number of bytes to use in the | 76 | As a guide, we suggest you calculate the number of bytes to use in the |
77 | metadata device as 48 * $data_dev_size / $data_block_size but round it up | 77 | metadata device as 48 * $data_dev_size / $data_block_size but round it up |
78 | to 2MB if the answer is smaller. The largest size supported is 16GB. | 78 | to 2MB if the answer is smaller. If you're creating large numbers of |
79 | snapshots which are recording large amounts of change, you may find you | ||
80 | need to increase this. | ||
79 | 81 | ||
80 | If you're creating large numbers of snapshots which are recording large | 82 | The largest size supported is 16GB: If the device is larger, |
81 | amounts of change, you may need find you need to increase this. | 83 | a warning will be issued and the excess space will not be used. |
82 | 84 | ||
83 | Reloading a pool table | 85 | Reloading 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 | ||
172 | External snapshots | ||
173 | ------------------ | ||
174 | |||
175 | You can use an external _read only_ device as an origin for a | ||
176 | thinly-provisioned volume. Any read to an unprovisioned area of the | ||
177 | thin device will be passed through to the origin. Writes trigger | ||
178 | the allocation of new blocks as usual. | ||
179 | |||
180 | One use case for this is VM hosts that want to run guests on | ||
181 | thinly-provisioned volumes but have the base image on another device | ||
182 | (possibly shared between many VMs). | ||
183 | |||
184 | You must not write to the origin device if you use this technique! | ||
185 | Of course, you may write to the thin device and take internal snapshots | ||
186 | of the thin volume. | ||
187 | |||
188 | i) 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 | |||
195 | ii) 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 | |||
170 | Deactivation | 204 | Deactivation |
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 | ||
263 | i) Constructor | 293 | i) 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 | |||
274 | The pool doesn't store any size against the thin devices. If you | 309 | The pool doesn't store any size against the thin devices. If you |
275 | load a thin target that is smaller than you've been using previously, | 310 | load a thin target that is smaller than you've been using previously, |
276 | then you'll have no access to blocks mapped beyond the end. If you | 311 | then you'll have no access to blocks mapped beyond the end. If you |