When running lvm commands inside lvm shell, the --reportformat option is ignored: ❯ lvm lvm> pvs --reportformat json PV VG Fmt Attr PSize PFree /dev/sda vg lvm2 a-- 124.00m 124.00m /dev/sdb vg lvm2 a-- 124.00m 124.00m /dev/sdc vg lvm2 a-- 124.00m 124.00m /dev/vda3 fedora lvm2 a-- <18.00g 0 The same works if executed from command line directly: ❯ pvs --reportformat json { "report": [ { "pv": [ {"pv_name":"/dev/sda", "vg_name":"vg", "pv_fmt":"lvm2", "pv_attr":"a--", "pv_size":"124.00m", "pv_free":"124.00m"}, {"pv_name":"/dev/sdb", "vg_name":"vg", "pv_fmt":"lvm2", "pv_attr":"a--", "pv_size":"124.00m", "pv_free":"124.00m"}, {"pv_name":"/dev/sdc", "vg_name":"vg", "pv_fmt":"lvm2", "pv_attr":"a--", "pv_size":"124.00m", "pv_free":"124.00m"}, {"pv_name":"/dev/vda3", "vg_name":"fedora", "pv_fmt":"lvm2", "pv_attr":"a--", "pv_size":"<18.00g", "pv_free":"0 "} ] } ] } I remember this worked, so it must have regressed at some point. I'll try to bisect when I have some spare time...
I got mislead a bit - this hasn't ever been supported. We can change reportformat only for the lvm shell as a whole, not for individual command executed inside the shell. The --reportformat option was just silently ignored so I've added a check and now we error out if an unsupported argument is used. For example: lvm> pvs --reportformat json Argument --reportformat cannot be used in interactive mode. Error during parsing of command line. https://sourceware.org/git/?p=lvm2.git;a=commit;h=e6b6a09f90f53a5cea3a712b2b84af57f4514a02