Commit Graph

6 Commits

Author SHA1 Message Date
Kern Walster
f1d79d33b8 Discard blocks when removing a thin device
dmsetup does not discard blocks when removing a thin device. The unused blocks
are reused by the thin-pool, but will remain allocated in the underlying
device indefinitely. For loop device backed thin-pools, this results in
"lost" disk space in the underlying file system as the blocks remain allocated
in the loop device's backing file.

This change adds an option, discard_blocks, to the devmapper snapshotter which
causes the snapshotter to issue blkdiscard ioctls on the thin device before
removal. With this option enabled, loop device setups will see disk space
return to the underlying filesystem immediately on exiting a container.

Fixes #5691

Signed-off-by: Kern Walster <walster@amazon.com>
2021-07-21 16:06:29 +00:00
Maksym Pavlenko
bd22653003 Add devmapper configuration examples
Signed-off-by: Maksym Pavlenko <makpav@amazon.com>
2020-03-17 18:16:58 -07:00
Eric Ren
b6bf7b97c2 devmapper: async remove device using Cleanup
Fix: #3923
Signed-off-by: Eric Ren <renzhen@linux.alibaba.com>
2020-02-29 13:32:48 +08:00
Eric Ernst
731e144a48 devmapper: update example base image size in README
base_image_size effectively is the limit of a layer size that can be
created using the devmapper snapshotter. While this will also depend on
the thinpool size itself, something closer to the total image size
(80%?) is more appropriate.

As is, if you try to run an image like elastic, you'll need a much
larger base_image_size than 128MB.

Signed-off-by: Eric Ernst <eric.ernst@intel.com>
2019-11-20 12:26:16 -08:00
Maksym Pavlenko
734989c2a0
Update README
Signed-off-by: Maksym Pavlenko <makpav@amazon.com>
2019-02-22 11:10:51 -08:00
Maksym Pavlenko
0c6d194cce
devmapper: add README and minor fixes
Signed-off-by: Maksym Pavlenko <makpav@amazon.com>
2019-02-21 16:25:55 -08:00