A proposition for zeroed logical volume The kernel target reads zeros from all uninitialized block. The target accesses an underlying logical volume and a bitmap logical volume. Each bit in the bitmap corresponds to one 4k block (the value could be changed) of the underlying logical volume. The bit specifies if the block is initialized or not. When reading from uninitialized block, zero is returned. When doing a full write to uninitialized block, the block is written and then marked as initialized in the bitmap. When doing a partial write to uninitialized block, the write is padded with zeros, the block is written and then marked as initialized in the bitmap. When reading or writing to initialized block, request are passed thru directly to the underlying logical volume. DM table format vg1-zeroed: 0 131072 zeroed 8 254:1 254:2 /* arguments: 8 --- block size, 254:1 --- data device, 254:2 --- log device */ vg1-zeroed_mimage_0: 12345 131072 linear 8:1 vg1-zeroed_mlog: 23456 4 linear 8:1 "mlog" contains a header (similar to mirror log header) and a bitmap. Create: allocate vg1-zeroed_mimage_0 allocate vg1-zeroed_mlog, zero the first sector (the header) load the table for vg1-zeroed vg1-zeroed target driver detect zeros in the log header and initializes the log Resize: suspend vg1-zeroed suspend vg1-zeroed_mimage_0 suspend vg1-zeroed_mlog Resize vg1-zeroed_mimage_0 and vg1-zeroed_mlog resume vg1-zeroed_mlog and vg1-zeroed_mimage_0 resume vg1-zeroed --- target driver checks size at resume and initializes parts of the log eventually. Remove: delete vg1-zeroed delete vg1-zeroed_mimage_0 delete vg1-zeroed_mlog