Thierry, uglier and LVM-only, but yes. I'd personally prefer blockdev moving forward, if only because it could work against other future options such as ZFS or Btrfs volumes. I agree there could be some value in lvs for the backport.
As a not-so-clean example on the shell:
$ sudo lvs --noheadings --separator , --units b stack-volumes/volume | cut -d, -f4 | sed 's/B$//'
versus:
$ sudo blockdev --getsize64 stack-volumes/volume
I've confirmed that the byte sizes reported are identical.
Thierry, uglier and LVM-only, but yes. I'd personally prefer blockdev moving forward, if only because it could work against other future options such as ZFS or Btrfs volumes. I agree there could be some value in lvs for the backport.
As a not-so-clean example on the shell: volume | cut -d, -f4 | sed 's/B$//' volume
$ sudo lvs --noheadings --separator , --units b stack-volumes/
versus:
$ sudo blockdev --getsize64 stack-volumes/
I've confirmed that the byte sizes reported are identical.