From 8abcc8e713fdf6229d65dec23e6e104f8040d704 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Thu, 17 Oct 2013 15:33:00 +0200 Subject: [PATCH] devmapper: Use a smaller blocksize for the thin-pool As per the thin provisioning docs for creating the pool: $data_block_size gives the smallest unit of disk space that can be allocated at a time expressed in units of 512-byte sectors. $data_block_size must be between 128 (64KB) and 2097152 (1GB) and a multiple of 128 (64KB). $data_block_size cannot be changed after the thin-pool is created. People primarily interested in thin provisioning may want to use a value such as 1024 (512KB). People doing lots of snapshotting may want a smaller value such as 128 (64KB). The switch from 512 (which we used before) to 128 (recommended above for lots of snapshoting) means a simple container creation (based on the mattdm/fedora:f19 image) adds 1 MB of diskspace rather than 3.6. This seems more in tune with how docker is typically used. --- devmapper/devmapper.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devmapper/devmapper.go b/devmapper/devmapper.go index 8600c09e8f..23ca50b28a 100644 --- a/devmapper/devmapper.go +++ b/devmapper/devmapper.go @@ -451,7 +451,7 @@ func createPool(poolName string, dataFile *os.File, metadataFile *os.File) error return fmt.Errorf("Can't get data size") } - params := metadataFile.Name() + " " + dataFile.Name() + " 512 8192" + params := metadataFile.Name() + " " + dataFile.Name() + " 128 32768" if err := task.AddTarget(0, size/512, "thin-pool", params); err != nil { return fmt.Errorf("Can't add target") }