On Mon, Jul 27, 2020 at 11:58:07AM +0200, Nicolas Martin wrote:
> Hi,
> 
> Using parted-3.1-29
> We have a 16TB RAID6 array. Size in GB reported by parted is 16000GB.
> The size in MiB is reported as 15251152 MiB which amounts to 15992 GB.
> 
> With a 8TB RAID6 array, size is reported as 7992GB. The size in MiB is
> consistent with the size in GB.
> 
> How come the size is rounded in one case and not the other ?
> 
> Since we create partitions programmatically, we need to use an accurate
> size.
> 
> Which unit or way is recommended to retrieve the size of the disk ?

When using non-IEC units like MB, GB parted will round the request to
+/- 50% of the unit. Usually it will snap to someplace near what you
expect, but not always, depending on the surrounding partitions.

To specify exact locations use either sectors ('s') or IEC units like
MiB, GiB, etc.

Brian

-- 
Brian C. Lane (PST8PDT) - weldr.io - lorax - parted - pykickstart




Reply via email to