aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorJoe Thornber <ejt@redhat.com>2012-03-28 13:41:28 -0400
committerAlasdair G Kergon <agk@redhat.com>2012-03-28 13:41:28 -0400
commit2dd9c257fbc243aa76ee6db0bb8371f9f74fad2d (patch)
tree51c82de6e41b4f53f9d41dfe1211c4feba55dc6d /Documentation
parentc4a69ecdb463a901b4645230613961e134e897cd (diff)
dm thin: support read only external snapshot origins
Support the use of an external _read only_ device as an origin for a thin device. Any read to an unprovisioned area of the thin device will be passed through to the origin. Writes trigger allocation of new blocks as usual. One possible use case for this would be VM hosts that want to run guests on thinly-provisioned volumes but have the base image on another device (possibly shared between many VMs). Signed-off-by: Joe Thornber <ejt@redhat.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/device-mapper/thin-provisioning.txt39
1 files changed, 38 insertions, 1 deletions
diff --git a/Documentation/device-mapper/thin-provisioning.txt b/Documentation/device-mapper/thin-provisioning.txt
index a119fbdd0604..310c1201d621 100644
--- a/Documentation/device-mapper/thin-provisioning.txt
+++ b/Documentation/device-mapper/thin-provisioning.txt
@@ -169,6 +169,38 @@ ii) Using an internal snapshot.
169 169
170 dmsetup create snap --table "0 2097152 thin /dev/mapper/pool 1" 170 dmsetup create snap --table "0 2097152 thin /dev/mapper/pool 1"
171 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
172Deactivation 204Deactivation
173------------ 205------------
174 206
@@ -254,7 +286,7 @@ iii) Messages
254 286
255i) Constructor 287i) Constructor
256 288
257 thin <pool dev> <dev id> 289 thin <pool dev> <dev id> [<external origin dev>]
258 290
259 pool dev: 291 pool dev:
260 the thin-pool device, e.g. /dev/mapper/my_pool or 253:0 292 the thin-pool device, e.g. /dev/mapper/my_pool or 253:0
@@ -263,6 +295,11 @@ i) Constructor
263 the internal device identifier of the device to be 295 the internal device identifier of the device to be
264 activated. 296 activated.
265 297
298 external origin dev:
299 an optional block device outside the pool to be treated as a
300 read-only snapshot origin: reads to unprovisioned areas of the
301 thin target will be mapped to this device.
302
266The pool doesn't store any size against the thin devices. If you 303The pool doesn't store any size against the thin devices. If you
267load a thin target that is smaller than you've been using previously, 304load a thin target that is smaller than you've been using previously,
268then you'll have no access to blocks mapped beyond the end. If you 305then you'll have no access to blocks mapped beyond the end. If you