Vgextend fails with error "Devices have inconsistent logical block sizes" when trying to add a VDO device.

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux 7
  • Red Hat Enterprise Linux 8
  • VDO

Issue

  • Unable to extend the VG using VDO device. Getting error as:
[root@rhel8 test4]# vgextend vg1 /dev/mapper/vdo4 
 Devices have inconsistent logical block sizes (512 and 4096).
  • vgextend fails due to inconsistent block size of the underline physical volume on sd device and VDO device.

Resolution

  • By default, allow_mixed_block_sizes is disabled. Enable allow_mixed_block_sizes in lvm.conf file in order to allow the same VG to have two PV with different block sizes:
[root@rhel8 test4]# cat /etc/lvm/lvm.conf | grep -i "allow_mixed_block_sizes" | grep -v "#"
    allow_mixed_block_sizes =1 
  • The default logical block size of VDO is 4096K (8 Sectors).

Root Cause

  • By default, the same logical block size is allowed for a VG for two different PV's. To use two different block sizes in same VG, enable allow_mixed_block_sizes in lvm.conf file.

Diagnostic Steps

  • Verify the value set for allow_mixed_block_sizes in lvm.conf:
[root@rhel8 test4]# cat /etc/lvm/lvm.conf | grep -i "allow_mixed_block_sizes" | grep -v "#"
    allow_mixed_block_sizes =0
  • Verify the block size of a disk by using parted or sg_readcap command:
[root@rhel8 test4]# parted /dev/sdb u s p                         
Model: VMware Virtual disk (scsi)
Disk /dev/sdb: 20971520s
Sector size (logical/physical): 512B/512B   <<<<< Sector Size
Partition Table: msdos
Disk Flags: 

Number  Start  End  Size  Type  File system  Flags

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments