Data alignment
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I have been getting warnings from mke2fs lately that my logical volumes are not aligned properly. I am using a raid5 array as a pv and it has a 1.5 MB stripe width, so logical volumes should be aligned to that, but it appears lvm is not doing this.
It looks like you can specify this alignment at pvcreate time, but I don't think I did and it doesn't seem to have been picked up automatically. Is there a way to change this without rebuilding the vg?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (MingW32)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iQEcBAEBAgAGBQJRGliwAAoJEJrBOlT6nu75u38IANP/fcPpeXdzymKzDBmKFjJ/ hVSR0Ig8lcym3nbL9wCz/PIGRrta5j9M2lVrIoMP68iTcywqsyON7f+iPN3f20MO v3Vjm0kRET4rw8inJE2g+6o5RlOAn+45vN6G6LtkncPFEo8MhxwHO2EMno3nql7Y Ds5eFd9OjK8BkpUaMjzUJR61of5SL32HXTAm7mVMXSzV1IIzFvSMq8P5bzI6GGnx mtoMqcND64+5AvU/FBnmB12k0MVNbnpLRvj1CZnhM8rrHu5cN921O1zK3M8rZ7sb vk9GalquS+AuELBwLOiY2t6a5ebW2aWB4Yi2docdOjudeN1y7LrvgmNmhIbxE+k= =C45A
-----END PGP SIGNATURE-----
Quoted 11 lines · Phillip Susi
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1I have been getting warnings from mke2fs lately that my logical volumes are not aligned properly. I am using a raid5 array as a pv and it has a 1.5 MB stripe width, so logical volumes should be aligned to that, but it appears lvm is not doing this.
It looks like you can specify this alignment at pvcreate time, but I don't think I did and it doesn't seem to have been picked up automatically. Is there a way to change this without rebuilding the vg?
Please provide the version of lvm2 that you're using.
For MD raid5, lvm2 should pick up the alignment without any manual flags being required. The manual flags are only required for users who have hardware raid where the minimum_io_size and optimal_io_size isn't populated in /sys/block/<dev>/queue/
But MD does populate those and lvm2 should definitely consume them when laying out the data area of a PV. You should be able to see what pvcreate determines the {minimum,optimal}_io_size to be by running:
pvcreate -vvvv <args>
But no, after the data area is established there is no way to change the alignment after the fact.