LVM cache and mismatched logical block sizes
LVM cache needs the origin and cache disks to share the same logical sector size (512 vs 4096). If they differ, LVM errors out.
The problem
When you attach LVM cache (dm-cache / lvmcache) so a fast disk backs a slower volume, operations can fail with an error like:
“Devices have inconsistent logical block sizes (4096 and 512).”
Until the underlying devices agree on logical sector size, you may be unable to create the cache pool, extend the volume group, or attach cache to the origin volume—depending on where LVM enforces the check.
Why it happens
Logical block size is how the kernel addresses sectors on each disk—usually 512 bytes or 4096 bytes (4 Kn). You can see it as LOG-SEC in lsblk or logical_block_size under /sys/block/<device>/queue/.
LVM expects a consistent geometry across devices that belong together in the same stack: physical volumes in one volume group, and especially the origin and cache sides of a cached logical volume. If one device is 512-byte logical and another is 4096-byte logical, that combination is rejected (unless you explicitly relax policy, which has its own risks).
Typical real-world mix: 512e HDDs or older arrays with 512 logical sectors, and SSDs or newer disks that expose 4096 logical sectors. Partitions do not change this—it is a property of the block device itself.
Fix: align sector sizes
The durable fix is to make origin and cache devices use the same logical block size before you build or extend LVM cache.
On SCSI / SAS / SATA-class drives that support changing the formatted block length, one approach is to low-level format the disk to 4096-byte sectors using sg_format (from sg3_utils), when your goal is to standardize on 4 Kn to match the other member of the pair. Exact flags depend on your sg_format version and the drive; use the tool’s help and the vendor’s documentation.
Important:
- The operation is destructive: it erases the drive.
- Not every drive supports a different logical sector size; confirm before formatting.
- After formatting, you must re-create partitions, PVs, and any LVM structures on that disk.
- NVMe devices are handled with
nvme formatand namespace settings, notsg_format.
After both sides report the same logical sector size, recreate or reattach the cache; the inconsistent block size error should no longer apply.